I have been sharing my experience migrating On-Premises database to ExaCC using ZDM Physical Online, see my previous blog : https://www.dbi-services.com/blog/zdm-physical-online-migration-a-success-story/
In this blog I will share how you can make a Dry Run migration on your own without impacting the source On-Premises database, so without having any downtime during the migration steps. In this blog, I will just mention the steps that you need to adapt from a normal migration. All others steps will remain the same, and if not already done, a previous short downtime on the source database is to plan to configure TDE encryption, knowing a database restart is needed after changing the instance parameters. We will keep the same naming convention from previous blog, that’s to say:
- ONPR: On-Premises database to migrate
- ONPRZ_APP_001T: Final PDB Name
- ExaCC-cl01n1: ExaCC cluster node 1
- vmonpr: Host On-Premises server
- zdmhost: VM running ZDM software
Checking Data Guard status
Once the migration with pause after ZDM_CONFIGURE_DG_SRC phase has been completed successfully, we have our ONPR On-Premises database as primary, and the ZDM temporary database on the ExaCC with db_unique_name the final PDB Name, onprz_app_001t, as standby. Both in sync.
ZDM job status is in paused status after Data Guard has been configured:
[zdmuser@zdmhost ~]$ /u01/app/oracle/product/zdm/bin/zdmcli query job -jobid 280 zdmhost.domain.com: Audit ID: 3494 Job ID: 280 User: zdmuser Client: zdmhost Job Type: "MIGRATE" Scheduled job command: "zdmcli migrate database -sourcesid ONPR -rsp /home/zdmuser/migration/zdm_ONPR_physical_online.rsp -sourcenode vmonpr -srcauth zdmauth -srcarg1 user:oracle -srcarg2 identity_file:/home/zdmuser/.ssh/id_rsa -srcarg3 sudo_location:/usr/bin/sudo -targetnode ExaCC-cl01n1 -tgtauth zdmauth -tgtarg1 user:opc -tgtarg2 identity_file:/home/zdmuser/.ssh/id_rsa -tgtarg3 sudo_location:/usr/bin/sudo -tdekeystorepasswd -tgttdekeystorepasswd -pauseafter ZDM_CONFIGURE_DG_SRC" Scheduled job execution start time: 2024-07-29T16:01:23+02. Equivalent local time: 2024-07-29 16:01:23 Current status: PAUSED Current Phase: "ZDM_CONFIGURE_DG_SRC" Result file path: "/u01/app/oracle/chkbase/scheduled/job-280-2024-07-29-16:01:46.log" Metrics file path: "/u01/app/oracle/chkbase/scheduled/job-280-2024-07-29-16:01:46.json" Job execution start time: 2024-07-29 16:01:46 Job execution end time: 2024-07-29 16:19:54 Job execution elapsed time: 14 minutes 56 seconds ZDM_GET_SRC_INFO ................ COMPLETED ZDM_GET_TGT_INFO ................ COMPLETED ZDM_PRECHECKS_SRC ............... COMPLETED ZDM_PRECHECKS_TGT ............... COMPLETED ZDM_SETUP_SRC ................... COMPLETED ZDM_SETUP_TGT ................... COMPLETED ZDM_PREUSERACTIONS .............. COMPLETED ZDM_PREUSERACTIONS_TGT .......... COMPLETED ZDM_VALIDATE_SRC ................ COMPLETED ZDM_VALIDATE_TGT ................ COMPLETED ZDM_DISCOVER_SRC ................ COMPLETED ZDM_COPYFILES ................... COMPLETED ZDM_PREPARE_TGT ................. COMPLETED ZDM_SETUP_TDE_TGT ............... COMPLETED ZDM_RESTORE_TGT ................. COMPLETED ZDM_RECOVER_TGT ................. COMPLETED ZDM_FINALIZE_TGT ................ COMPLETED ZDM_CONFIGURE_DG_SRC ............ COMPLETED ZDM_SWITCHOVER_SRC .............. PENDING ZDM_SWITCHOVER_TGT .............. PENDING ZDM_POST_DATABASE_OPEN_TGT ...... PENDING ZDM_NONCDBTOPDB_PRECHECK ........ PENDING ZDM_NONCDBTOPDB_CONVERSION ...... PENDING ZDM_POST_MIGRATE_TGT ............ PENDING TIMEZONE_UPGRADE_PREPARE_TGT .... PENDING TIMEZONE_UPGRADE_TGT ............ PENDING ZDM_POSTUSERACTIONS ............. PENDING ZDM_POSTUSERACTIONS_TGT ......... PENDING ZDM_CLEANUP_SRC ................. PENDING ZDM_CLEANUP_TGT ................. PENDING Pause After Phase: "ZDM_CONFIGURE_DG_SRC"
And we can check Data Guard is in sync:
oracle@vmonpr:/ONPR/u00/admin/etc/ [ONPR] dgmgrl / DGMGRL for Linux: Release 19.0.0.0.0 - Production on Mon Jul 29 16:21:32 2024 Version 19.22.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Connected to "ONPR" Connected as SYSDG. DGMGRL> show configuration lag Configuration - ZDM_onpr Protection Mode: MaxPerformance Members: onpr - Primary database onprz_app_001t - Physical standby database Transport Lag: 0 seconds (computed 0 seconds ago) Apply Lag: 0 seconds (computed 0 seconds ago) Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 52 seconds ago)
Manual Failover to ExaCC
Now for the migration step with pause after ZDM_SWITCHOVER_TGT phase (switchover), we will not use ZDM to do the switchover but run manually a failover. We will end in a split-brain situation having 2 primary databases, which we usually do not like, but it will not be a problem here, knowing the business application does not know anything about the ExaCC database, thus will not connect to it.
oracle@ExaCC-cl01n1:~/ [ONPR1 (CDB$ROOT)] ps -ef | grep [p]mon | grep -i onprz oracle 34780 1 0 16:18 ? 00:00:00 ora_pmon_ONPRZ_APP_001T1 oracle@ExaCC-cl01n1:~/ [ONPR1 (CDB$ROOT)] export ORACLE_SID=ONPRZ_APP_001T1 oracle@ExaCC-cl01n1:~/ [ONPRZ_APP_001T1 (CDB$ROOT)] dgh DGMGRL for Linux: Release 19.0.0.0.0 - Production on Mon Jul 29 16:22:59 2024 Version 19.22.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. DGMGRL> connect sys@'ExaCC-cl01-scan:1521/ONPRZ_APP_001T.domain.com' Password: Connected to "ONPRZ_APP_001T" Connected as SYSDBA. DGMGRL> show configuration lag Configuration - ZDM_onpr Protection Mode: MaxPerformance Members: onpr - Primary database onprz_app_001t - Physical standby database Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 36 seconds ago) DGMGRL> failover to onprz_app_001t; Performing failover NOW, please wait... Failover succeeded, new primary is "onprz_app_001t" DGMGRL> show configuration lag Configuration - ZDM_onpr Protection Mode: MaxPerformance Members: onprz_app_001t - Primary database onpr - Physical standby database (disabled) ORA-16661: the standby database needs to be reinstated Transport Lag: (unknown) Apply Lag: (unknown) Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 1 second ago)
Check ExaCC database status
If we check our ExaCC ZDM temporary database, we can see that it is opened READ/WRITE with primary role.
oracle@ExaCC-cl01n1:~/ [ONPRZ_APP_001T1 (CDB$ROOT)] sqh SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jul 29 16:24:55 2024 Version 19.22.0.0.0 Copyright (c) 1982, 2023, Oracle. All rights reserved. Connected to: Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production Version 19.22.0.0.0 SQL> select instance_name from v$instance; INSTANCE_NAME ---------------- ONPRZ_APP_001T1 SQL> select name, db_unique_name, open_mode, database_role from v$database; NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE --------- ------------------------------ -------------------- ---------------- ONPR ONPRZ_APP_001T READ WRITE PRIMARY
Perform last steps migration
Now we can resume the job with no other pause to perform all last migration steps. The only difference here is that we will have to use the option -skip SWITCHOVER
, as we performed it manually.
[zdmuser@zdmhost ~]$ /u01/app/oracle/product/zdm/bin/zdmcli resume job -jobid 280 -skip SWITCHOVER zdmhost.domain.com: Audit ID: 3496
We can check the jobs to be successfull.
[zdmuser@zdmhost ~]$ /u01/app/oracle/product/zdm/bin/zdmcli query job -jobid 280 zdmhost.domain.com: Audit ID: 3508 Job ID: 280 User: zdmuser Client: zdmhost Job Type: "MIGRATE" Scheduled job command: "zdmcli migrate database -sourcesid ONPR -rsp /home/zdmuser/migration/zdm_ONPR_physical_online.rsp -sourcenode vmonpr -srcauth zdmauth -srcarg1 user:oracle -srcarg2 identity_file:/home/zdmuser/.ssh/id_rsa -srcarg3 sudo_location:/usr/bin/sudo -targetnode ExaCC-cl01n1 -tgtauth zdmauth -tgtarg1 user:opc -tgtarg2 identity_file:/home/zdmuser/.ssh/id_rsa -tgtarg3 sudo_location:/usr/bin/sudo -tdekeystorepasswd -tgttdekeystorepasswd -pauseafter ZDM_CONFIGURE_DG_SRC" Scheduled job execution start time: 2024-07-29T16:01:23+02. Equivalent local time: 2024-07-29 16:01:23 Current status: SUCCEEDED Result file path: "/u01/app/oracle/chkbase/scheduled/job-280-2024-07-29-16:01:46.log" Metrics file path: "/u01/app/oracle/chkbase/scheduled/job-280-2024-07-29-16:01:46.json" Job execution start time: 2024-07-29 16:01:46 Job execution end time: 2024-07-29 16:41:06 Job execution elapsed time: 23 minutes 47 seconds ZDM_GET_SRC_INFO ................ COMPLETED ZDM_GET_TGT_INFO ................ COMPLETED ZDM_PRECHECKS_SRC ............... COMPLETED ZDM_PRECHECKS_TGT ............... COMPLETED ZDM_SETUP_SRC ................... COMPLETED ZDM_SETUP_TGT ................... COMPLETED ZDM_PREUSERACTIONS .............. COMPLETED ZDM_PREUSERACTIONS_TGT .......... COMPLETED ZDM_VALIDATE_SRC ................ COMPLETED ZDM_VALIDATE_TGT ................ COMPLETED ZDM_DISCOVER_SRC ................ COMPLETED ZDM_COPYFILES ................... COMPLETED ZDM_PREPARE_TGT ................. COMPLETED ZDM_SETUP_TDE_TGT ............... COMPLETED ZDM_RESTORE_TGT ................. COMPLETED ZDM_RECOVER_TGT ................. COMPLETED ZDM_FINALIZE_TGT ................ COMPLETED ZDM_CONFIGURE_DG_SRC ............ COMPLETED ZDM_SWITCHOVER_SRC .............. COMPLETED ZDM_SWITCHOVER_TGT .............. COMPLETED ZDM_POST_DATABASE_OPEN_TGT ...... COMPLETED ZDM_NONCDBTOPDB_PRECHECK ........ COMPLETED ZDM_NONCDBTOPDB_CONVERSION ...... COMPLETED ZDM_POST_MIGRATE_TGT ............ COMPLETED TIMEZONE_UPGRADE_PREPARE_TGT .... COMPLETED TIMEZONE_UPGRADE_TGT ............ COMPLETED ZDM_POSTUSERACTIONS ............. COMPLETED ZDM_POSTUSERACTIONS_TGT ......... COMPLETED ZDM_CLEANUP_SRC ................. COMPLETED ZDM_CLEANUP_TGT ................. COMPLETED
And our On-Premises database has been converted and migrated into the PDB in the target database on the ExaCC.
oracle@ExaCC-cl01n1:~/ [ONPR1 (CDB$ROOT)] sqh SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jul 29 16:45:17 2024 Version 19.22.0.0.0 Copyright (c) 1982, 2023, Oracle. All rights reserved. Connected to: Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production Version 19.22.0.0.0 SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 ONPRZ_APP_001T READ WRITE NO SQL> alter session set container=ONPRZ_APP_001T; Session altered. SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 3 ONPRZ_APP_001T READ WRITE NO SQL> select status, message from pdb_plug_in_violations; STATUS MESSAGE ---------- ------------------------------------------------------------------------------------------------------------------------ RESOLVED PDB needs to import keys from source. RESOLVED Database option RAC mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. RESOLVED PDB plugged in is a non-CDB, requires noncdb_to_pdb.sql be run. PENDING Database option APS mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING Database option CATJAVA mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING Database option CONTEXT mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING Database option DV mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING Database option JAVAVM mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING Database option OLS mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING Database option ORDIM mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING Database option SDO mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING Database option XML mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING Database option XOQ mismatch: PDB installed version NULL. CDB installed version 19.0.0.0.0. PENDING Tablespace SYSTEM is not encrypted. Oracle Cloud mandates all tablespaces should be encrypted. PENDING Tablespace SYSAUX is not encrypted. Oracle Cloud mandates all tablespaces should be encrypted. 15 rows selected.
Remove Data Guard on source database
We will now just have to remove the Data Guard configuration on the source On-Premises Database.
Connecting to it with the broker, we will just have to run : DGMGRL> remove configuration;
To wrap up
With ZDM we even have the possibility to fully perform the migration as a Dry Run test without impacting the source database.