4 Migrating Your Database with Zero Downtime Migration
Evaluate the database migration job, run the job, and perform other operations during and after a database migration.
See the Zero Downtime Migration Release Notes for the latest information about known issues, My Oracle Support notes, and runbooks.
- Migrate the Database
Perform the database migration with Zero Downtime Migration using the following procedure. - Query Migration Job Status
You can query the migration job status while the job is running. - List Migration Job Phases
You can list the operation phases involved in the migration job. - Pause and Resume a Migration Job
You can pause a migration job at any point after the ZDM_SETUP_TGT phase, and resume the job at any time. - Rerun a Migration Job
If there are any unexpected errors in the migration workflow, you can correct them and rerun the migration job. - Terminiate a Running Migration Job
If you want to resubmit a database migration job for a specified database, you must first terminiate the running migration job. - Post-Migration Tasks
The following topics describe tasks that you do after you complete the database migration job.
Migrate the Database
Perform the database migration with Zero Downtime Migration using the following procedure.
Parent topic: Migrating Your Database with Zero Downtime Migration
Query Migration Job Status
You can query the migration job status while the job is running.
Query the status of a database migration job using the ZDMCLI query job
command, specifying the job ID. The job ID is shown in the command output when the database migration job is submitted.
zdmuser> ./zdmcli query job -jobid job-id
You can find the console output of the migration job in the file indicated in the query job
command output. You can see migration progress messages in the specified file.
Parent topic: Migrating Your Database with Zero Downtime Migration
List Migration Job Phases
You can list the operation phases involved in the migration job.
To list the operation phases involved in the migration job, add the -listphases
option in the ZDMCLI migrate
command. This option will list the phases involved in the operation.
For example,
zdmuser> ./zdmcli migrate database -sourcedb zdmsdb -sourcenode ocic31 -srcauth zdmauth
-srcarg1 user:opc -srcarg2 identity_file:/home/oracle/.ssh/zdm_service_node.ppk -srcarg3 sudo_location:/usr/bin/sudo -targetnode rptest
-targethome /u01/app/oracle/product/12.2.0.1/dbhome_1
-backupuser backup_user@example.com -rsp /u01/zdm_template_zdmsdb.rsp
-tgtauth zdmauth -tgtarg1 user:opc
-tgtarg2 identity_file:/home/oracle/.ssh/zdm_service_node.ppk
-tgtarg3 sudo_location:/usr/bin/sudo -listphases
Parent topic: Migrating Your Database with Zero Downtime Migration
Pause and Resume a Migration Job
You can pause a migration job at any point after the ZDM_SETUP_TGT phase, and resume the job at any time.
To pause a migration job, specify the –pauseafter
option in the ZDMCLI migrate
command with a valid phase to be paused after. Choose a valid phase that is listed in the -listphases
command output.
Pausing phases after ZDM_SETUP_TGT is recommended.
For example, if you specify -pauseafter ZDM_SWITCHOVER_SRC
, the migration job will pause after completing the ZDM_SWITCHOVER_SRC phase.
zdmuser> ./zdmcli migrate database -sourcedb zdmsdb -sourcenode ocic31
-srcauth zdmauth -srcarg1 user:opc
-srcarg2 identity_file:/home/oracle/.ssh/zdm_service_node.ppk
-srcarg3 sudo_location:/usr/bin/sudo -targetnode rptest
-targethome /u01/app/oracle/product/12.2.0.1/dbhome_1
-backupuser backup_user@example.com -rsp /u01/zdm_template_zdmsdb.rsp
-tgtauth zdmauth -tgtarg1 user:opc
-tgtarg2 identity_file:/home/oracle/.ssh/zdm_service_node.ppk
-tgtarg3 sudo_location:/usr/bin/sudo -pauseafter ZDM_SWITCHOVER_SRC
A paused job can be resumed anytime by running the ZDMCLI resume job
command, specifying the respective job ID. To schedule another pause, specify the –pauseafter
option in the resume
command with a valid phase to be paused after. Choose a valid phase later than phase currently paused at, that is listed in the -listphases
command output.
zdmuser> ./zdmcli resume job -jobid Job_ID [-pauseafter valid-phase]
Note that -pauseafter
allows only one phase to be specified.
Also, note that if you use -pauseafter
in a migration job at phase
ZDM_CONFIGURE_DG_SRC
, at the end of the execution of the phase, a
standby is created at the target database and synchronization occurs between source and
target databases.
Parent topic: Migrating Your Database with Zero Downtime Migration
Rerun a Migration Job
If there are any unexpected errors in the migration workflow, you can correct them and rerun the migration job.
The errors are recorded in the job output, which can be queried using the ZDMCLI query job
command. Upon resolving the error, the failed job can be continued from the point of failure.
Rerun the migration job by running the ZDMCLI resume job
command, specifying the job ID of the job to be rerun, as shown here.
zdmuser> ./zdmcli resume job -jobid Job_ID
Parent topic: Migrating Your Database with Zero Downtime Migration
Terminiate a Running Migration Job
If you want to resubmit a database migration job for a specified database, you must first terminiate the running migration job.
Zero Downtime Migration blocks attempts to rerun the MIGRATE
DATABASE
command for a specified database if that database is already
part of an ongoing migration job.
If you want to resubmit a database migration job for a specified
database, you must first terminiate the running migration job in either
EXECUTING
or PAUSED
state using the
ZDMCLI ABORT JOB
command.
zdmuser> ./zdmcli abort job -jobid job-id
Parent topic: Migrating Your Database with Zero Downtime Migration
Post-Migration Tasks
The following topics describe tasks that you do after you complete the database migration job.
- Run Datapatch on the Target Database
If the target database environment is at a higher patch level than the source database, you must run the datapatch utility on the target database.
Parent topic: Migrating Your Database with Zero Downtime Migration
Run Datapatch on the Target Database
If the target database environment is at a higher patch level than the source database, you must run the datapatch utility on the target database.
For example, if your source database is at Oct 2018 PSU/BP and the target is at Jan 2019 PSU/BP), you must run the datapatch utility. Before running datapatch on the target, ensure you apply the target patch level to the binaries at the source (standby) database.
Parent topic: Post-Migration Tasks