F Zero Downtime Migration ZDMCLI Command Reference

ZDMCLI is the command line interface for Zero Downtime Migration migration operations.

To run ZDMCLI commands, go to the /bin directory in the Zero Downtime Migration software home and enter one of the commands listed in the topics below. For example:

zdmuser> $ZDM_HOME/bin/zdmcli migrate database

To list help pages for any ZDMCLI command use the -help option. The following command lists the help for all of the ZDMCLI commands.

zdmuser> $ZDM_HOME/bin/zdmcli -help

To get the current release information for your Zero Downtime Migration software, run ZDMCLI with the -build option.

zdmuser> $ZDM_HOME/bin/zdmcli -build

The following topics describe the Zero Downtime Migration ZDMCLI command usage and options.

ZDMCLI Options

You can run options on ZDMCLI without specifying a command.

Syntax

$ZDM_HOME/bin/zdmcli -option

Options

Table F-1 ZDMCLI Options

Option Description
-build Returns Zero Downtime Migration version information, including Cloud Premigration Advisor version.

abort job

Terminates the specified job, if running.

Syntax

$ZDM_HOME/bin/zdmcli abort job
  -jobid job_id

Options

Table F-2 ZDMCLI abort job Options

Option Description
-jobid job_id Unique job ID value (integer) for the scheduled job. The job ID is assigned when the job is scheduled.

add imagetype

Configures a new image type of the specified name and its associated user actions.

Syntax

$ZDM_HOME/bin/zdmcli add imagetype
  -imagetype image_type
  -basetype CUSTOM_PLUGIN
  [-useractions user_action_list]

Options

Table F-3 ZDMCLI add imagetype Options

Option Description
-imagetype image_type

Name of the image type to be created

-basetype CUSTOM_PLUGIN

The base image type for which the image type is created.

Note that CUSTOM_PLUGIN is the only valid value for this mandatory argument.

-useractions user_action_list

Comma-separated list of user action names

add useraction

Configures a new user action of the specified name with its associated script and action file.

Syntax

$ZDM_HOME/bin/zdmcli add useraction
  -useraction user_action_name 
  -actionscript script_name 
  [-actionfile file_name] 
  {-pre | -post}
  -optype MIGRATE_DATABASE 
  [-phase operation_phase]
  [-onerror {ABORT | CONTINUE}]
  [-runscope
     {ONENODE |
      ALLNODES |
      AUTO}]
  [-outputfrom useraction_names]

Options

Table F-4 ZDMCLI add useraction Options

Option Description
-useraction user_action_name

Name of the user action

-actionscript script_name

Script file to be run

-actionfile file_name

File associated with and needed by the user action

-pre

Runs the user action before the operation

-post

Runs the user action after the operation

-optype MIGRATE_DATABASE

Defines the operation for which the user action is configured as MIGRATE_DATABASE.

-phase phase_of_operation

Migration operation phase for which the user action is configured

-onerror {ABORT | CONTINUE}

The response if the user action encounters an error during execution

-runscope {ONENODE | ALLNODES | AUTO}

The servers on which the user action is run.

Specify AUTO to choose the run scope based on the other command options.

-outputfrom useraction_names

Comma-separated list of user action names whose output is to be supplied to the current user action.

Examples

For more examples, see Registering User Actions.

migrate database

Performs a migration of a database to the Oracle Cloud.

Syntax

$ZDM_HOME/bin/zdmcli migrate database  
  [-sourcedb db_name |
     -sourcesid source_oracle_sid}
  -rsp zdm_template_path
  -sourcenode source_host_name
  -targetnode target_host_name
  [-targethome target_home] 
  [-eval] 
  [-tdekeystorepasswd
     [-tgttdekeystorepasswd]] 
  [-tdemasterkey] 
  [-useractiondata user_action_data]
  [-imagetype] 
  [-backupuser user_name]
  [-dvowner database_vault_owner]   [-backuppasswd]
  [-tdewallet wallet_path
     [-tgttdewallet wallet_path]] 
  [-tdekeystorewallet tde_wallet_path
     [-tgttdekeystorewallet tde_wallet_path]]
  [-sourcesyswallet sys_wallet_path]
  [-osswallet oss_wallet_path]
  [-dvwallet dv_wallet_path] 
  [-backupwallet backup_wallet_path] 
  [{-srcroot |
     -srccred cred_name |
     -srcuser user_name |
     {-srcsudouser sudo_user_name -srcsudopath sudo_binary_path} |
        {-srcauth plugin_name 
            [-srcarg1 user:source_database_server_login_user_name 
             -srcarg2 identity_file:ZDM_installed_user_private_key_file_location 
             -srcarg3 sudo_location:sudo_location]}}]
  {-tgtroot |
     -tgtcred cred_name |
     -tgtuser user_name |
     {-tgtsudouser sudo_user_name -tgtsudopath sudo_binary_path} |
       {-tgtauth plugin_name 
          [-tgtarg1 user:target_database_server_login_user_name
           -tgtarg2 identity_file:ZDM_installed_user_private_key_file_location  
           -tgtarg3 sudo_location:sudo_location]}} 
  [-schedule {timer_value | NOW}] 
  [-pauseafter phase] 
  [-stopafter phase]
  [-listphases] 
  [-ignoremissingpatches patch_name
     [,patch_name...]] 
  [-ignore {ALL | WARNING | PATCH_CHECK}]
  [-incrementalinterval timer_minutes] 
  [-advisor |
     -ignoreadvisor |
     -skipadvisor]  [-genfixup {YES | NO}]

Options

Table F-5 ZDMCLI migrate database Options

Option Description
-advisor

Similar to -eval, migrate database will run the minimum phases required for exclusively running Cloud Premigration Advisor Tool (CPAT) on the migration job, without actually running the migration job against the source and target

-backuppasswd password

In a physical migration, allows you to

1. Create an RMAN backup with provided backup password

2. Use an existing RMAN backup with backup password authentication

-backupuser user_name

Name of the user allowed to back up or restore the database

-backupwallet backup_wallet_path

Full path for the auto-login wallet file on the Zero Downtime Migration host containing the RMAN backup password

-dvowner database_vault_owner

Name of the Oracle Database Vault owner allowed to grant or revoke SYS privileges

-dvwallet dv_wallet_path

Full path for the auto-login wallet file on the Zero Downtime Migration host, containing the credential for the Oracle Database Vault owner

-eval

Evaluates the migration job without actually running the migration job against the source and target

-genfixup {YES | NO}

Displays remedial scripts for failing checks when a migration is run with Cloud Premigration Advisor Tool (CPAT) enabled. Any remedies that can be run automatically on the source database are run.

See Cloud Premigration Advisor Tool Support for CPAT use cases supported by Zero Downtime Migration.

-ignore {ALL | WARNING | PATCH_CHECK}

Ignore all checks or specific type of checks

-ignoreadvisor

Runs Cloud Premigration Advisor Tool (CPAT), but ignores errors generated by CPAT.

-ignoremissingpatches

Proceeds with the migration even though the specified patches, which are present in the source path or working copy, might be missing from the destination path or working copy

-imagetype image_type

Name of the user action imagetype

-incrementalinterval timer_minutes

Run periodic incremental RMAN backup every interval (in minutes)

-listphases

Lists the phases for the migration job

-osswallet oss_wallet_path

Full path for the auto-login wallet file on the Zero Downtime Migration host containing the credential for the Object Storage Service (OSS) backup user

-pauseafter phase

Pause the job after running the specified phase

-rsp zdm_template_path

Location of the Zero Downtime Migration response file

-schedule timer_value

Scheduled time to run the migration, in ISO-8601 format.

For example, 2016-12-21T19:13:17+05

-skipadvisor

Skips the CPAT phase of the migration job

-sourcedb db_name

Name of the source database you want to migrate

-sourcenode source_host_name

Host on which the source database is running

-sourcesid source_oracle_sid

ORACLE_SID of the source single instance database without Grid Infrastructure

-sourcesyswallet sys_wallet_path

Full path for the auto-login wallet file on the Zero Downtime Migration host containing the SYS password of the source database

-srcauth plug-in_name [plug-in_args]

Use the zdmauth authentication plug-in to access the source database server, and enter the following arguments:

-srcarg1 user:source_database_server_login_user_name 
-srcarg2 identity_file:ZDM_installed_user_private_key_file_location 
-srcarg3 sudo_location:sudo_location 

If you don't specify the sudo location, the default (/usr/bin/sudo) is used by Zero Downtime Migration.

-srccred cred_name

Credential name with which to associate the user name and password credentials to access the source database server

-srcroot

Directs Zero Downtime Migration to use root credentials to access the source database server

-srcsudopath sudo_binary_path

Location of sudo binary on the source database server

-srcsudouser user_name

Perform super user operations as sudo user name on the source database server

-srcuser user_name

Name of the privileged user performing operations on the source database server

-stopafter phase

Truncates the work flow by the specified phase, and upon completion of the specified phase, the migration job is marked with status completed.

There is no option to resume the job beyond this phase.

For example, if you intend to stop the work flow after Data Guard setup, then specifying -stopafter ZDM_CONFIGURE_DG_SRC stops the job at this phase and the job is marked completed once the ZDM_CONFIGURE_DG_SRC is completed successfully.

-targethome target_home

Location of the target database ORACLE_HOME

-targetnode target_host_name

Target server to which the source database is migrated

-tdekeystorepasswd

Transparent Data Encryption (TDE) keystore password, required for password-based keystore or wallet

-tdekeystorewallet tde_wallet_path

Full path for the auto-login wallet file on the Zero Downtime Migration host containing the Transparent Data Encryption (TDE) keystore password

-tdemasterkey

Transparent Data Encryption (TDE) master encryption key

-tdewallet wallet_path

Full path for the auto-login wallet file on the Zero Downtime Migration host containing the Transparent Data Encryption (TDE) keystore password

-tgtauth plugin_name [plugin_args]

Use the zdmauth authentication plug-in to access the target database server, and enter the following arguments:

-tgtarg1 user:target_database_server_login_user_name
-tgtarg2 identity_file:ZDM_installed_user_private_key_file_location  
-tgtarg3 sudo_location:sudo_location

If you don't specify the sudo location the default (/usr/bin/sudo) is used by Zero Downtime Migration.

-tgtcred cred_name

Credential name with which to associate the user name and password credentials to access the target database server

-tgtroot

Use root credentials to access the target database server

-tgtsudopath sudo_binary_path

Location of the sudo binary on the target database server

-tgtsudouser user_name

Perform super user operations as sudo user name on the target database server

-tgttdekeystorepasswd

Target container database TDE keystore password

-tgttdekeystorewallet tde_wallet_path

Full path for the auto-login wallet file on the Zero Downtime Migration host that contains the target TDE keystore password

-tgttdewallet wallet_path

Full path for the auto-login wallet file on the Zero Downtime Migration host containing target container database Transparent Data Encryption (TDE) keystore password

If you are converting a non-multitenant source database to a multitenant architecture on the target, that is a pluggable database (PDB), then you can also create an auto-login wallet for the target container database (CDB) TDE keystore password.

-tgtuser user_name

Name of the user performing operations on the target database server

-useractiondata user_action_data

Value to be passed to useractiondata parameter of the user action script

Examples

ZDMCLI migrate database options for an Autonomous Database migration:

zdmuser> $ZDM_HOME/bin/zdmcli migrate database -rsp file_path -sourcenode host
 -srcauth zdmauth -srcarg1 user:username -srcarg2 identity_file:ssh_key_path
 -srcarg3 sudo_location:sudo_path -eval [-advisor [-ignoreadvisor] | -skipadvisor]]

ZDMCLI migrate database options for a co-managed database migration:

zdmuser> $ZDM_HOME/bin/zdmcli migrate database -rsp file_path -sourcenode host
 -srcauth zdmauth -srcarg1 user:username -srcarg2 identity_file:ssh_key_path
 -srcarg3 sudo_location:sudo_path -targetnode host -tgtauth zdmauth
 -tgtarg1 user:username -tgtarg2 identity_file:ssh_key_path 
 -tgtarg3 sudo_location:sudo_path -eval [-advisor [-ignoreadvisor] | -skipadvisor]]

modify useraction

Modifies the configuration of the user action with the specified name.

Syntax

$ZDM_HOME/bin/zdmcli modify useraction
  -useraction user_action_name 
  [-actionscript script_name] 
  [-actionfile file_name] 
  [-pre | -post] 
  [-optype MIGRATE_DATABASE] 
  [-phase phase] 
  [-onerror {ABORT | CONTINUE}] 
  [-runscope 
     {ONENODE |
      ALLNODES |
      AUTO}]
  [-outputfrom useraction_names]

Options

Table F-6 ZDMCLI modify useraction Options

Option Description
-useraction user_action_name

Name of the user action

-actionscript script_name

Script file to be run

-actionfile file_name

Accompanying file needed by the user action

-pre

Runs the user action before the operation

-post

Runs the user action after the operation

-optype MIGRATE_DATABASE

Defines the operation for which the user action is configured as MIGRATE_DATABASE

-onerror {ABORT | CONTINUE}

Defines whether to stop or continue running if an error occurs while the user action is running

-runscope {ONENODE | ALLNODES | AUTO}

The servers where the user action will be run.

Specify AUTO to choose the run scope based on the other command options.

-outputfrom useraction_names

Comma-separated list of user action names whose output is to be supplied to the current user action.

query job

Gets the current status of scheduled migration jobs.

Syntax

$ZDM_HOME/bin/zdmcli query job
  [-jobid job_id
     [-jobtype]] 
  [-sourcenode source_host_name
     [-sourcedb db_name |
     -sourcesid sid]]
  [-targetnode target_host_name]
  [-latest]
  [-eval |
  -migrate] 
  [-status 
     {SCHEDULED |
      EXECUTING |
      UNKNOWN |
      TERMINATED |
      FAILED |
      SUCCEEDED |
      PAUSED |
      ABORTED}] 
  [-phase]
  [-dbname database_name] 
  [-since timer_value] 
  [-upto timer_value] 
  [-brief]
  [-statusonly]

Options

Table F-7 ZDMCLI query job Options

Option Description
-jobid job_id

Unique job ID value (integer) for the scheduled migration job

The job ID is assigned when the migration job is scheduled.

-job_type

Returns the type of the scheduled job

-sourcenode source_host_name

Server on which the source database is running

-sourcedb db_name

Name of the source database to be migrated

-sourcesid sid

The ORACLE_SID of the source single instance database without Grid Infrastructure

-targetnode target_host_name

Target server to which the database is migrated

-latest

Returns the most recent job that matches the given criteria

-eval

Returns evaluation jobs only

-migrate

Returns migration jobs only

-status {SCHEDULED | EXECUTING | UNKNOWN | TERMINATED | FAILED | SUCCEEDED | PAUSED | ABORTED}

Returns jobs that match the specified job status

-phase

Returns the status of the given phase. If the phase supplied by the user is invalid, the query returns an error.

./zdmcli query job -jobid 33 -phase ZDM_PREUSERACTIONS_TGT -statusonly
# exmaple.com: Audit ID: 153
# Job ID: 33
# ZDM_PREUSERACTIONS_TGT:PENDING
-dbname unique_db_name

Specifies the database DB_UNIQUE_NAME value

-since timer_value

Date from which to get the jobs, in ISO-8601 format. For example: 2016-12-21T19:13:17+05

-upto timer_value

Upper limit time to which to get the jobs, in ISO-8601 format. For example: 2016-12-21T19:13:17+05

-brief

Returns job details summary only

-statusonly

Returns only the job status and current phase name

Usage Notes

To identify if the current run is a resumption of a PAUSED migration job, a restart of a FAILED migration job, or a fresh start for a migration job, use the following options:

  • zdmcli query job -latest gets the latest job without considering the job_type
  • zdmcli query job -latest -migrate gets the latest non-evaluation migration job
  • zdmcli query job -latest -eval get the latest evaluation migration job

query useraction

Displays the configuration of a user action.

Syntax

$ZDM_HOME/bin/zdmcli query useraction
    [-useraction user_action_name | -imagetype image_type
    [-optype MIGRATE_DATABASE]]

Options

Table F-8 ZDMCLI query useraction Options

Option Description

-useraction user_action_name

Name of the user action

-imagetype image_type

Specify the image type name

-optype MIGRATE_DATABASE

Operation for which the user action is configured

resume job

Resumes a specified job that was paused.

Syntax

$ZDM_HOME/bin/zdmcli resume job
  -jobid job_id
  [-pauseafter pause_phase | 
   -rsp zdm_logical_template_path]
 

Options

Table F-9 ZDMCLI resume job Options

Option Description
-jobid job_id

Unique job ID value (integer) for the scheduled job

The job ID is assigned when the migration job is scheduled.

-pauseafter pause_phase

Pauses the migration job after running the specified phase

-rsp zdm_logical_template_path

Specify the migration response file if you modified any parameters to be picked up by ZDM on resume.

This option can only be used with logical migration jobs.

Usage Notes

See Resume a Migration Job

suspend job

Suspends the specified job if running. Executing suspend job stops the ongoing job at the current work flow phase and allows jobs to be resumed later.

The command suspend job is only applicable to physical migration jobs.

Syntax

$ZDM_HOME/bin/zdmcli suspend job
  -jobid job_id

Options

Table F-10 ZDMCLI suspend job Options

Option Description
-jobid job_id

Unique job ID value (integer)

The job ID number is assigned when the migration job is scheduled.