旧バージョンのCData Virtuality Server からのアップグレードには、対象サーバーバージョンに付属のCData Virtuality Upgrade Utility (Exporter) をご利用ください。

このページでは、サポートされている設定オプションのリスト、いくつかの使用例、ファサード(新しく追加されたカラムを使用して、あるバージョンから別のバージョンへのアップグレードを容易にするために特別に設計されたクエリのセット)、JDKの使用法、JDBCドライバーの使用法に関する情報を提供します。

Properties

Mandatory Properties

Property

Description

--host

The host where the CData Virtuality Server is running

Optional Properties

To view the full table, click the expand button in its top right corner

Property

Default value

Description

--username

(none)

User name used to connect to the server. Mandatory in case the auth-type property is not set to OPENID or OAUTH2

--password

(none)

User password. Mandatory in case the auth-type property is not set to OPENID or OAUTH2

--port

31000

Server port

--ssl

FALSE

Indicates whether to use a secure connection or not

--database

datavirtuality

The CData Virtuality VDB schema

--file

dv-export-<current-date>.sql

Destination file name

--dv-facade-file

(none)

SQL facade file in the file system

--skip-aggr

FALSE

Indicates whether to skip aggregation optimizations or not

--ds-validation

FALSE

Indicates whether to validate data sources on import or not.

If enabled, data sources are exported with the createDatasource/Connection statements or importDatasource/Connection otherwise.

Please note that the import will fail if validation is enabled and the data source is unreachable

--opt-validation

FALSE

Indicates whether to validate optimizations on import or not.

If enabled, optimizations are exported with the createOptimization statement or importOptimization otherwise.

Please note that it is impossible to export materialized tables state if the validation is enabled

--export-mattable-state

TRUE

Indicates whether to export the state of materialized tables or not. It is used when the new CData Virtuality installation uses the same internal DWH database with materialized tables.

Please note that this option requires the optimization validation (see previous entry) to be disabled

--view-proc-validation

FALSE

Indicates whether to validate virtual views and procedures on import or not.

If enabled, virtual views and procedures are exported by printing definitions directly to the export script or wrapping them with the importView/Procedure otherwise

--use-maintenance-mode

TRUE

Runs export in maintenance server mode

--purge-system-data

FALSE

Indicates whether to purge the system data or not.

If enabled, adds the script to purge the existing data at the beginning of the export script. With this option, the following objects will be purged: Data sources, Connections, Procedures, VirtualSchemas, ViewDefinitions, ScheduleJobs (except 'cleanup' and 'performance'), Schedules (except 'performance'), RecommendedOptimizations, Users, and Roles

--use-model-file

FALSE

Indicates whether to use a different file for "model" export or not.

If enabled, separate files will be used for exporting data sources, virtual schemas with views and procedures, and the rest

--export-jboss-settings

FALSE

Indicates whether to export JBoss settings or not. 

If enabled, JBoss settings are exported to separate files

--java-7

FALSE

Needed to connect to server versions that use Java 7 (2.3 and below) when using an SSL connection

--export-smtp-configuration

TRUE

If enabled, SMTP configuration is exported, otherwise not

--export-global-job-email-notifications

TRUE

If enabled, Ggobal job email notifications are exported, otherwise not

--export-job-specific-email-notifications

TRUE

If enabled, job-specific email notifications are exported, otherwise not

--export-global-job-slack-notifications

TRUE

If enabled, global job Slack notifications are exported, otherwise not

--export-job-specific-slack-notifications

TRUE

If enabled, job-specific Slack notifications are exported, otherwise not

--export-modular-connectors

FALSE

If enabled, deployed modular connectors are exported, otherwise not

export-modular-connectors property is available since v4.5

OAuth 2.0 and OpenID Connect Authorization Properties

ユーザー名とパスワードによる認証、またはトークンによる認証を使用できます。以下はその留意点です:

  • auth-userauth-passwordが設定されている場合、トークンを設定すべきではありません;
  • access-tokenrefresh-tokenが設定されている場合、auth-userauth-passwordは設定しないでください;
  • auth-user / auth-passwordとトークンの両方が設定されている場合、トークン認証が使用されます。

Property

Default value

Description

--auth-type

(none)

Authentication type (OPENID or OAUTH2). If not set, the CData Virtuality security authentication is used

--configuration-url

(none)

Configuration URL. Mandatory if OPENID or OAUTH2 authentication type is used

--client-id

(none)

Client identifier. Mandatory if OPENID or OAUTH2 authentication type is used

--client-secret

(none)

Client secret key. Mandatory if OPENID or OAUTH2 authentication type is used

--auth-user

(none)

Username of the user. Mandatory if an access token is not provided

--auth-password

(none)

Password of the user. Mandatory if an access token is not provided

--access-token

(none)

Access token

--refresh-token

(none)

Refresh token

Usage Examples

1) サーバーには標準的なポートとデータベース名があります:

export.bat --username admin --password admin --host localhost

2) サーバーにカスタム構成とカスタム宛先スクリプトファイル名が指定されています:

export.bat --username admin --password admin --host localhost --port 31002 --ssl true --database dvbase-1 --file upgrade-server1-to-server2.sql

3) 集約最適化のエクスポートのスキップ:

export.bat --username admin --password admin --host localhost --skip-aggr true

4) import* の代わりに create* ステートメントを使用してエクスポートします:

export.bat --username admin --password admin --host localhost --ds-validation true --opt-validation true --export-mattable-state false --view-proc-validation true

5) ユーザーとパスワードを使ってOAuth2を使ってエクスポートします:

export.bat --host localhost --auth-type OAUTH2 --configuration-url http://localhost:8080/realms/oauth/.well-known/openid-configuration --client-id oauth1 --client-secret 1FrHGnl1cdeNxUYzpKtaALk11pTeF11a --auth-user user_name --auth-password user_pass

6) トークンを使ったエクスポートOPENID

export.bat --host localhost --auth-type OPENID --configuration-url http://localhost:8080/realms/oauth/.well-known/openid-configuration --client-id oauth1 --client-secret 1FrHGnl1cdeNxUYzpKtaALk11pTeF11a --access-token dDo4MTgwIl0sInJlc291cmNlX2FjY2VzcyI6eyJvZGF0YTQtb2F1dGgiOnsicm9sZXMiOlsiYWRtaW4tcm9sZSJdfX0sInNjb3BlIjoiZW1haWwgcHJvZmlsZSIsInNpZCI6 --refresh-token CwianRpIjoiMDgzZjYzZjItYTcwMy00ZjE4LTg2N2EtNjJiYWY0ZWU1ZDVkIiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgwL3JlYWxtcy9vZGF0YS1vYXV0aCIsImF1ZCI6Imh0dHA6Ly9

Facade

SQL ファサードは、ソースサーバーとターゲットエクスポーター間の互換性の問題を解決するための、コンテキスト固有のインターフェースです。

CData Virtuality Server の新しいバージョンでシステムテーブルに新しいカラムが追加された場合、Facades は便利です。新しく追加された列がNULL でない場合、CData Virtuality Upgrade Utility は有効な値で埋める必要があります。ファサードはダミーデータを作成するためのクエリです。

このようなファサードの例を、詳しい説明とともにご紹介します:

getRecommendedIndexes=SELECT columnName, id, parentRecOptID, recOptID, type, cast('SINGLE' as varchar(30)) AS kind, cast(1 as biginteger) AS freq, cast('NEW' as varchar(20)) AS status FROM SYSADMIN.RecommendedIndexes
getRecommendedOptimizations=SELECT Enabled, Freq, ID, MatchDescriptor, Type, dwhState, dwhStateComment, lastMaterialized, lastReplicationState, lastReplicationStateComment, lastUsed, matTablePrefix, nextReplicationState, nextSelectState, sourceState, sourceStateComment, cast('ALL' as varchar(64)) AS allowIndexCreationByType, cast('NEW_ACCEPTED' as varchar(64)) AS allowIndexCreationByStatus FROM SYSADMIN.RecommendedOptimizations

この例では、getRecommendedIndexesgetRecommendedOptimizationsの2つのプロシージャを更新しています。ターゲットバージョンでは、最初のプロシージャは新しいフィールドkind, freq, status を受け取り、それらには任意のデフォルト値が割り当てられます。allowIndexCreationByTypeallowIndexCreationByStatusの2つのフィールドが新たに追加され、それらにもデフォルト値が割り当てられます。

あるバージョンから次のバージョンにアップグレードする場合、シングル・ステップのファサードが必要になることがあります。アップグレードが複数のバージョンをスキップする場合、(ステップオーバーするバージョンのうち1つだけがファサードの使用を必要とする場合)シングルステップファサードか、ステップのそれぞれ(または一部)のシングルステップファサードで構成される累積ファサードのいずれかが必要になる可能性があります。インスタンスを必要なバージョンにアップグレードするために必要なファサードの詳細や入手方法については、サポートチームにお問い合わせください。

JDK Usage

JDKがサーバーに含まれていて、そのパスが %dvserver%/JDKで、エクスポータのパスが%dvserver%/bin,  の場合、エクスポートを実行するときにサーバーJavaを使用します。

JDK がサーバーに含まれていない場合、またはエクスポーターが%dvserver%/bin で実行されていない場合、 システム Java を使用します。これはログに反映されます:

f:\datavirtuality\exporter\1_10\cli-export-1.0>export.bat
JDK is not defined at f:\datavirtuality\exporter\JDK\bin
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 -Duser.language=en -Duser.country=US
INFO: Export tool v.1.0 (rev.5525 built on 2016-07-26 03:54) [Tue Jul 26 09:54:56 MSK 2016]
=================================================================================================

JDK がサーバーに含まれていないか、エクスポーターが %dvserver%/binで実行されておらず、システム Java が存在しない場合、ログに次のような警告が表示されます:

halina@halina-VirtualBox:/media/datavirtuality/exporter/1_11/cli-export-1.0$ ./export.sh
JDK is not defined at /media/datavirtuality/exporter/JDK/bin
JAVA_HOME is not set. Unexpected results may occur.
Set JAVA_HOME to the directory of your local JDK to avoid the message.
./export.sh: line 37: java: command is not found

JDBC Driver Usage

特にサーバーのメジャーバージョン間(2.1から2.3など)をアップグレードする場合、エクスポートしたスクリプトのデータが完全で、正しく、ターゲットサーバーで使用できることを保証するために、特定のJDBCドライバーを使用することが理にかなっていることがあります(例えば、JDBCドライバーv2.1でCLI-exporter v2.3を使用する場合など)。JDBC ドライバーへのパスは、export.bat/export.shファイルのjdbcDriverPath変数で指定できます。 

Do not enclose the path in double quotes, even if it contains a space!