C ウォレットを使用した非対話型のパスワード指定

コマンドラインでパスワードを入力せず、ユーザーとのやり取りなしにZDMCLI MIGRATE DATABASEコマンドを実行することができます。

現在、$ZDM_HOME/bin/zdmcli migrate databaseコマンドを発行するたびに、ソース・データベースのSYSパスワード、Object Storeユーザー・スイフト認証トークンおよびソース・データベースの透過的データ暗号化(TDE)キーストア・パスワード(PASSWORDベースのTDEウォレットとしてウォレットが構成されている場合)の入力を求められます。コマンドラインでパスワードを入力する必要がない場合(Rundeckを使用して自動化を実行する場合など)は、次のステップを実行します。

Zero Downtime Migrationサービス・ホストで、Zero Downtime Migrationソフトウェア所有者(zdmuserなど)として次のコマンドを実行します。

  1. ソース・データベースSYSユーザーの自動ログイン・ウォレットを作成します。

    1. ウォレットを作成して格納するディレクトリを作成します。

      zdmuser> mkdir sys_wallet_path

      次に例を示します。

      /u01/app/zdmhome> mkdir sysWallet
    2. ウォレットを作成します。

      zdmuser> $ZDM_HOME/bin/orapki wallet create -wallet sys_wallet_path 
      -auto_login_only

      次に例を示します

      /u01/app/zdmhome> $ZDM_HOME/bin/orapki wallet create -wallet sysWallet 
      -auto_login_only
      Oracle PKI Tool Release 19.0.0.0.0 - Production
      Version 19.4.0.0.0
      Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
      
      Operation is successfully completed.
    3. SYSユーザー・ログイン資格証明をウォレットに追加します。

      zdmuser> $ZDM_HOME/bin/mkstore -wrl sys_wallet_path 
      -createCredential store sysuser

      プロンプトで、ソース・データベースのSYSパスワードを入力します。

      次に例を示します

      /u01/app/zdmhome> $ZDM_HOME/bin/mkstore -wrl ./sysWallet 
      -createCredential store sysuser
      Oracle Secret Store Tool Release 19.0.0.0.0 - Production
      Version 19.4.0.0.0
      Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
      
      Your secret/Password is missing in the command line
      Enter your secret/Password:
      Re-enter your secret/Password:
    4. ウォレット・ファイルが作成されたことを確認します。

      zdmuser> ls -l sys_wallet_path

      次に例を示します

      /u01/app/zdmhome> ls -l sysWallet/
      total 4
      -rw-------. 1 opc opc 581 Jun  2 08:00 cwallet.sso
      -rw-------. 1 opc opc   0 Jun  2 08:00 cwallet.sso.lck
  2. Object Storeユーザーの自動ログイン・ウォレットを作成します。

    1. ウォレットを作成して格納するディレクトリを作成します。

      zdmuser> mkdir oss_wallet_path

      次に例を示します

      /u01/app/zdmhome> mkdir ossWallet
    2. ウォレットを作成します

      zdmuser> $ZDM_HOME/bin/orapki wallet create -wallet oss_wallet_path 
      -auto_login_only

      次に例を示します

      /u01/app/zdmhome> $ZDM_HOME/bin/orapki wallet create 
      -wallet ./ossWallet -auto_login_only 
      Oracle PKI Tool Release 19.0.0.0.0 -Production
      Version 19.4.0.0.0
      Copyright (c) 2004, 2019,
      Oracle and/or its affiliates. All rights reserved.
      
       Operation is successfully completed.
    3. Object Storeユーザー・ログイン資格証明をウォレットに追加します。

      zdmuser> $ZDM_HOME/bin/mkstore -wrl oss_wallet_path 
      -createCredential store ossuser

      プロンプトで、

      • バックアップ先がObject Store (バケット)の場合は、ユーザーswift認証トークンを入力します。

      • バックアップ先がStorage Classic (コンテナ)の場合は、テナンシ・ログイン・パスワードを入力します。

      次に例を示します

      /u01/app/zdmhome> $ZDM_HOME/bin/mkstore -wrl ./ossWallet 
      -createCredential store ossuser
      Oracle Secret Store Tool Release 19.0.0.0.0 - Production
      Version 19.4.0.0.0
      Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
      
      Your secret/Password is missing in the command line
      Enter your secret/Password:
      Re-enter your secret/Password:
    4. ウォレット・ファイルが作成されたことを確認します。

      zdmuser> ls -l oss_wallet_path

      次に例を示します

      /u01/app/zdmhome> ls -l ./ossWallet
      total 4
      -rw-------. 1 opc opc 597 Jun  2 08:02 cwallet.sso
      -rw-------. 1 opc opc   0 Jun  2 08:01 cwallet.sso.lck
  3. ソース・データベースTDEキーストアの自動ログイン・ウォレットを作成します。

    1. ウォレットを作成して格納するディレクトリを作成します。

      zdmuser> mkdir tde_wallet_path

      次に例を示します

      /u01/app/zdmhome> mkdir tdeWallet
    2. ウォレットを作成します。

      zdmuser> $ZDM_HOME/bin/orapki wallet create -wallet tde_wallet_path 
      -auto_login_only

      次に例を示します

      /u01/app/zdmhome> $ZDM_HOME/bin/orapki wallet create -wallet ./tdeWallet 
      -auto_login_only
      Oracle PKI Tool Release 19.0.0.0.0 - Production
      Version 19.4.0.0.0
      Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
      
      Operation is successfully completed.
    3. ソース・データベースTDEキーストア資格証明をウォレットに追加します。

      zdmuser> $ZDM_HOME/bin/mkstore -wrl tde_wallet_path 
      -createCredential store tdeuser

      プロンプトで、TDEキーストア・パスワードを入力します。

      次に例を示します

      /u01/app/zdmhome> $ZDM_HOME/bin/mkstore -wrl ./tdeWallet 
      -createCredential store tdeuser
      Oracle Secret Store Tool Release 19.0.0.0.0 - Production
      Version 19.4.0.0.0
      Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
      
      Your secret/Password is missing in the command line
      Enter your secret/Password:
      Re-enter your secret/Password:
    4. ウォレット・ファイルが作成されたことを確認します。

      zdmuser> ls -l tde_wallet_path

      次に例を示します

      /u01/app/zdmhome> ls -l tdeWallet
      total 4
      -rw-------. 1 opc opc 581 Jun  2 08:06 cwallet.sso
      -rw-------. 1 opc opc   0 Jun  2 08:04 cwallet.sso.lck

ウォレットにアクセスするためのコマンド・オプションの設定

ZDMCLI MIGRATE DATABASEコマンドでウォレット情報を指定するには、次に示すように-sourcesyswallet-osswalletおよび-tdekeystorewalletオプションを設定します。

zdmuser> $ZDM_HOME/bin/zdmcli migrate database 
-sourcedb source_db_unique_name_value
-sourcenode source_database_server_name -srcauth zdmauth
-srcarg1 user:source_database_server_login_user_name
-srcarg2 identity_file:zdm_installed_user_private_key_file_location
-srcarg3 sudo_location:/usr/bin/sudo -targetnode target_database_server_name
-backupuser object_store_login_user_name -rsp response_file_location
-tgtauth zdmauth -tgtarg1 user:target_database_server_login_user_name
-tgtarg2 identity_file:zdm_installed_user_private_key_file_location 
-tgtarg3 sudo_location:/usr/bin/sudo -sourcesyswallet sys_wallet_path 
-osswallet oss_wallet_path  -tdekeystorewallet tde_wallet_path 
-eval
  • -sourcesyswallet sys_wallet_pathは、ソース・データベースのSYSパスワードを含むZero Downtime Migrationホスト上の自動ログイン・ウォレット・ファイルのフルパスを指定します。
  • -osswallet oss_wallet_pathは、Object Storage Serviceバックアップ・ユーザーの資格証明を含むZero Downtime Migrationホスト上の自動ログイン・ウォレット・ファイルのフルパスを指定します。
  • -tdekeystorewallet tde_wallet_pathは、TDEキーストア・パスワードを含むZero Downtime Migrationホスト上の自動ログイン・ウォレット・ファイルのフルパスを指定します。

評価モードの例

zdmuser> $ZDM_HOME/bin/zdmcli migrate database -sourcedb zdmsdb -sourcenode ocicdb1 
-srcauth zdmauth -srcarg1 user:opc 
-srcarg2 identity_file:/home/zdmuser/.ssh/zdm_service_host.ppk 
-srcarg3 sudo_location:/usr/bin/sudo -targetnode ocidb1 
-backupuser backup_user@example.com 
-rsp /u01/app/zdmhome/rhp/zdm/template/zdm_template_zdmsdb.rsp -tgtauth zdmauth 
-tgtarg1 user:opc -tgtarg2 identity_file:/home/zdmuser/.ssh/zdm_service_host.ppk 
-tgtarg3 sudo_location:/usr/bin/sudo -sourcesyswallet /u01/app/zdmhome/sysWallet 
-osswallet /u01/app/zdmhome/ossWallet -eval

Operation "zdmcli migrate database" scheduled with the job ID "1".

移行モードの例

zdmuser> $ZDM_HOME/bin/zdmcli migrate database -sourcedb zdmsdb -sourcenode ocicdb1 
-srcauth zdmauth -srcarg1 user:opc 
-srcarg2 identity_file:/home/zdmuser/.ssh/zdm_service_host.ppk 
-srcarg3 sudo_location:/usr/bin/sudo -targetnode ocidb1 
-backupuser backup_user@example.com 
-rsp /u01/app/zdmhome/rhp/zdm/template/zdm_template_zdmsdb.rsp -tgtauth zdmauth 
-tgtarg1 user:opc -tgtarg2 identity_file:/home/zdmuser/.ssh/zdm_service_host.ppk 
-tgtarg3 sudo_location:/usr/bin/sudo -sourcesyswallet /u01/app/zdmhome/sysWallet 
-osswallet /u01/app/zdmhome/ossWallet

Operation "zdmcli migrate database" scheduled with the job ID "2".