C Provide Passwords Non-Interactively Using a Wallet

You can avoid entering passwords in the command line and run the ZDMCLI MIGRATE DATABASE command without user interaction.

Currently, whenever you submit the $ZDM_HOME/bin/zdmcli migrate database command, it prompts for the source database SYS password, Object Store user swift authentication token, and the source database Transparent Data Encryption (TDE) keystore password (if the wallet was configured as a PASSWORD-based TDE wallet). If you don't want to be required to enter the password at the command line, such as when you do automation using Rundeck, complete the following steps.

Run the following commands on the Zero Downtime Migration service host as Zero Downtime Migration software owner (for example, zdmuser).

  1. Create an auto-login wallet for the source database SYS user.

    1. Create a directory where you want to create and store the wallet.

      zdmuser> mkdir sys_wallet_path

      For example:

      /u01/app/zdmhome> mkdir sysWallet
    2. Creat a wallet.

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

      For example

      /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. Add a SYS user login credentials to wallet.

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

      At the prompt, enter the source database SYS password.

      For example

      /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. Verify that the wallet files were created.

      zdmuser> ls -l sys_wallet_path

      For example

      /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. Create an auto-login wallet for the Object Store user.

    1. Create a directory where you want to create and store the wallet.

      zdmuser> mkdir oss_wallet_path

      For example

      /u01/app/zdmhome> mkdir ossWallet
    2. Create a wallet

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

      For example

      /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. Add the Object Store user login credentials to the wallet.

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

      For the prompt,

      • If the backup destination is Object Store (Bucket), then enter the user swift authentication token.

      • If the backup destination is Storage Classic (Container), then enter your tenancy login password.

      For example

      /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. Verify that the wallet files were created.

      zdmuser> ls -l oss_wallet_path

      For example

      /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. Create an auto-login wallet for the source database TDE keystore.

    1. Create a directory where you want to create and store the wallet.

      zdmuser> mkdir tde_wallet_path

      For example

      /u01/app/zdmhome> mkdir tdeWallet
    2. Create a wallet.

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

      For example

      /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. Add the source database TDE keystore credentials to the wallet.

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

      At the prompt, enter the TDE keystore password.

      For example

      /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. Verify that the wallet files were created.

      zdmuser> ls -l tde_wallet_path

      For example

      /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

Setting Command Options to Access the Wallets

To specify wallet information in the ZDMCLI MIGRATE DATABASE command, set the -sourcesyswallet, -osswallet, and -tdekeystorewallet options as shown here.

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 specifies the full path for the auto-login wallet file on the Zero Downtime Migration host containing the SYS password of the source database
  • -osswallet oss_wallet_path specifies the full path for the auto-login wallet file on the Zero Downtime Migration host containing credentials for the Object Storage Sservice backup user
  • -tdekeystorewallet tde_wallet_path specifies the full path for the auto-login wallet file on the Zero Downtime Migration host containing the TDE keystore password

Evaluation Mode Example

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".

Migration Mode Example

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".