Migrating to Oracle Database@Azure with Zero Downtime Migration (ZDM): Physical Online Migration Step by Step
Oracle Zero Downtime Migration (ZDM) automates the moves that DBAs used to script by hand: it instantiates the target from the source, keeps it in sync, and switches the application over in a short window. Its physical online method builds a Data Guard standby in the target cloud and finishes with a switchover, so the outage is only the switchover itself, typically a few minutes.
This post walks through a physical online migration from an on-premises Oracle Database 19c to Exadata Database Service on Oracle Database@Azure. We check the source and target, prepare the ZDM host, write the response file, run an evaluation, start the migration paused after Data Guard is configured, and switch over when the business is ready.
The Use Case
An ERP database runs on premises on Linux. The application servers are moving to Azure, and the database must move to Oracle Database@Azure in the same Azure region so that the network round trip stays short. The business accepts a planned outage of about 15 minutes for the cut-over, and the on-premises database must remain available as a fallback.
Environment used in this runbook
Source: Oracle Database 19c (19.24), CDB ERPCDB with one PDB, ERPPDB, on Oracle Linux 8, on premises
Target: Exadata Database Service on Oracle Database@Azure, two-node VM cluster, 19c (19.24) database home
ZDM host: a Linux VM in Azure running ZDM 21.5, with SSH access to both database hosts
Connectivity: ExpressRoute from the data centre to the Azure virtual network that holds the Exadata delegated subnet
Method: MIGRATION_METHOD=ONLINE_PHYSICAL with DATA_TRANSFER_MEDIUM=DIRECT (RMAN restore from service)
How the Physical Online Method Works
ZDM is a separate host. It connects to the source and target database hosts over SSH and drives RMAN, Data Guard and the cloud tooling from there. Nothing is installed permanently on the database servers.
The target starts as a placeholder. You create a database on the Exadata VM cluster with the same DB_NAME as the source and a different DB_UNIQUE_NAME. ZDM replaces its data files with a copy of the source.
The copy is a standby. With DIRECT transfer, the target restores the source's data files over Oracle Net (restore from service), then ZDM configures Data Guard so redo keeps the target current while the source stays open.
The cut-over is a switchover. When you resume the job, ZDM switches roles, runs datapatch if needed and finishes the post-migration steps. The old source becomes the standby, which is your fallback.
ZDM itself has no licence cost. Data Guard is included with Enterprise Edition; anything you open on the standby while it is applying redo needs Active Data Guard.
Step 1: Check the Source Database
ZDM's prechecks catch most problems, but finding them yourself first saves an evaluation cycle. The source must be in ARCHIVELOG mode, should use FORCE LOGGING, and needs a TDE keystore, because databases in Oracle's cloud services are encrypted.
SQL |
sqlplus / as sysdba
SELECT name, db_unique_name, log_mode, force_logging, cdb FROM v$database;
SELECT con_id, wrl_type, status, wallet_type FROM v$encryption_wallet ORDER BY con_id;
SELECT version_full FROM v$instance; |
Expected output |
NAME DB_UNIQUE_NAME LOG_MODE FORCE_LOGGING CDB
--------- ---------------- ------------ --------------------------------------- ---
ERPCDB ERPCDB_ONPREM ARCHIVELOG YES YES
CON_ID WRL_TYPE STATUS WALLET_TYPE
---------- -------- ------ -----------
1 FILE OPEN AUTOLOGIN
2 FILE OPEN AUTOLOGIN
3 FILE OPEN AUTOLOGIN
VERSION_FULL
-----------------
19.24.0.0.0What to expect: ARCHIVELOG, FORCE_LOGGING YES and an open TDE keystore. If FORCE_LOGGING is NO, enable it with ALTER DATABASE FORCE LOGGING, otherwise NOLOGGING operations leave unrecoverable blocks on the target. If there is no keystore, create one before migrating (see the TDE post on this blog); the tablespaces do not have to be encrypted yet. Note the exact Release Update: the target home must be at the same level or newer.
Step 2: Create the Placeholder Database on the Target
In the OCI console reached from the Azure portal (Oracle Database@Azure > Exadata VM cluster > Go to OCI), create a database in a 19c home on the VM cluster. Use the same DB_NAME as the source, ERPCDB, and give it its own DB_UNIQUE_NAME. Then check it from one of the cluster nodes.
SQL |
-- On the target VM cluster node, as oracle sqlplus / as sysdba
SELECT name, db_unique_name, database_role, open_mode FROM v$database;
SELECT name, value FROM v$parameter WHERE name IN ('db_create_file_dest', 'db_recovery_file_dest', 'compatible'); |
Expected output |
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE
--------- ---------------- ---------------- --------------------
ERPCDB ERPCDB_AZ PRIMARY READ WRITE
NAME VALUE
------------------------------ ------------------------------
compatible 19.0.0
db_create_file_dest +DATAC1
db_recovery_file_dest +RECOC1What to expect: A primary database named ERPCDB with DB_UNIQUE_NAME ERPCDB_AZ. Its contents do not matter: ZDM replaces them. The disk groups (+DATAC1, +RECOC1) go into the response file in Step 5. COMPATIBLE must match the source; if the source has a higher COMPATIBLE value, the restore fails.
Step 3: Prepare the ZDM Host and SSH Access
Install ZDM on a dedicated Linux host as a non-root user, for example zdmuser, following the installation guide for your version. The ZDM host needs SSH to both database hosts with a key, and the account it uses must be able to run commands as root through sudo.
Shell |
# On the ZDM host, as zdmuser export ZDM_HOME=/u01/app/zdmhome $ZDM_HOME/bin/zdmservice status $ZDM_HOME/bin/zdmcli -build
# SSH from the ZDM host to both database hosts with the key ZDM will use ssh -i ~/.ssh/zdm_key oracle@erp-onprem-db1 'hostname; sudo -n true && echo sudo-ok' ssh -i ~/.ssh/zdm_key opc@erpaz-node1 'hostname; sudo -n true && echo sudo-ok' |
Expected output |
---------------------------------------
Service Status
---------------------------------------
Running: true
Tranferport:
Conn String: jdbc:mysql://localhost:8897/
RMI port: 8895
HTTP port: 8896
Wallet path: /u01/app/zdmbase/crsdata/zdmhost/security
version: 21.0.0.0.0
full version: 21.5.0.0.0
patch version: N/A
label date: 240802.31
ZDM kit build date: Aug 02 2024 08:41:53 UTC
CPAT build version: 24.6.0
erp-onprem-db1
sudo-ok
erpaz-node1
sudo-okWhat to expect: The ZDM service is running, zdmcli -build prints the installed release, and both SSH tests print the host name and sudo-ok without a password prompt. If sudo asks for a password, ZDM will fail in its first phase; fix the sudoers entry first. Upgrade ZDM to the latest release before a real migration: each release adds fixes for cloud targets.
Step 4: Check Network Reachability Between the Databases
Restore from service and Data Guard redo transport both use Oracle Net between the two database hosts, in both directions: the target pulls the backup from the source, and after the switchover the new primary in Azure ships redo back to the on-premises standby.
Shell |
# From the target node to the source listener ssh -i ~/.ssh/zdm_key opc@erpaz-node1 \ "timeout 5 bash -c '</dev/tcp/erp-onprem-scan.corp.example/1521' && echo source-1521-open"
# From the source host to the target SCAN listener ssh -i ~/.ssh/zdm_key oracle@erp-onprem-db1 \ "timeout 5 bash -c '</dev/tcp/erpaz-scan.azure.example.internal/1521' && echo target-1521-open" |
Expected output |
source-1521-open
target-1521-openWhat this does: It opens a TCP connection to port 1521 in each direction, using bash's built-in /dev/tcp, so it works on hosts without extra tools. Both names must resolve on both sides: add the on-premises names to Azure private DNS and the Azure SCAN name to the corporate DNS, or use /etc/hosts entries for the migration. Check the network security group on the Exadata delegated subnet and the on-premises firewall if a direction fails.
Step 5: Write the Response File
The response file tells ZDM what kind of migration to run and where things go on the target. Keep it short: set only the parameters your migration needs, and check each one against the response file reference for your ZDM release.
Shell |
cat > /home/zdmuser/erp_physical_online.rsp <<'EOF' MIGRATION_METHOD=ONLINE_PHYSICAL DATA_TRANSFER_MEDIUM=DIRECT ZDM_RMAN_DIRECT_METHOD=RESTORE_FROM_SERVICE ZDM_SRC_DB_RESTORE_SERVICE_NAME=erpcdb_onprem.corp.example PLATFORM_TYPE=EXACS TGT_DB_UNIQUE_NAME=ERPCDB_AZ TGT_DATADG=+DATAC1 TGT_REDODG=+DATAC1 TGT_RECODG=+RECOC1 ZDM_USE_DG_BROKER=TRUE EOF |
What this does: ONLINE_PHYSICAL builds a standby and switches over. DIRECT with RESTORE_FROM_SERVICE restores the data files straight from the source over Oracle Net, so no backup location is needed; the service name must be one the source listener offers for the CDB. PLATFORM_TYPE=EXACS describes an Exadata Database Service target, which is what runs under Oracle Database@Azure. TGT_DB_UNIQUE_NAME is the placeholder from Step 2, and ZDM_USE_DG_BROKER makes ZDM create a Data Guard broker configuration, which is easier to monitor.
Tip: For a very large database or a slow link, a backup-based transfer (DATA_TRANSFER_MEDIUM=OSS with an Object Storage bucket, or NFS) can be faster and gentler on the source than restore from service. The rest of this runbook stays the same.
Step 6: Run an Evaluation
The -eval option runs all of ZDM's validation phases without changing anything on the source or target. Run it until it completes cleanly; it is cheap, and it finds most configuration problems.
Shell |
$ZDM_HOME/bin/zdmcli migrate database \ -sourcedb ERPCDB_ONPREM \ -sourcenode erp-onprem-db1 \ -srcauth zdmauth \ -srcarg1 user:oracle \ -srcarg2 identity_file:/home/zdmuser/.ssh/zdm_key \ -srcarg3 sudo_location:/usr/bin/sudo \ -targetnode erpaz-node1 \ -tgtauth zdmauth \ -tgtarg1 user:opc \ -tgtarg2 identity_file:/home/zdmuser/.ssh/zdm_key \ -tgtarg3 sudo_location:/usr/bin/sudo \ -rsp /home/zdmuser/erp_physical_online.rsp \ -eval
$ZDM_HOME/bin/zdmcli query job -jobid 11 |
Expected output |
Enter source database ERPCDB_ONPREM SYS password:
Enter source database ERPCDB_ONPREM TDE keystore password:
zdmhost: 2026-10-23T09:12:40.118Z : Processing response file ...
Operation "zdmcli migrate database" scheduled with the job ID "11".
Job ID: 11
Job Type: "EVAL"
Current status: SUCCEEDED
ZDM_GET_SRC_INFO ........... PRECHECK_PASSED
ZDM_GET_TGT_INFO ........... PRECHECK_PASSED
ZDM_PRECHECKS_SRC .......... PRECHECK_PASSED
ZDM_PRECHECKS_TGT .......... PRECHECK_PASSED
ZDM_SETUP_SRC .............. PRECHECK_PASSED
ZDM_SETUP_TGT .............. PRECHECK_PASSED
ZDM_VALIDATE_SRC ........... PRECHECK_PASSED
ZDM_VALIDATE_TGT ........... PRECHECK_PASSEDWhat to expect: ZDM asks for the source SYS and TDE keystore passwords interactively (never put them on the command line), schedules a job and returns its ID. query job shows each phase; an evaluation that SUCCEEDED with every phase at PRECHECK_PASSED is ready for the real run. If a phase fails, the job's log file (its path is in the full query job output) names the check and the reason.
Step 7: Start the Migration and Pause After Data Guard Is Configured
Run the same command without -eval and with -pauseafter ZDM_CONFIGURE_DG_SRC. ZDM restores the target, configures Data Guard and stops there, with the target in Azure running as a standby that receives redo from the source. The application keeps running on premises for as long as you like.
Shell |
$ZDM_HOME/bin/zdmcli migrate database \ -sourcedb ERPCDB_ONPREM -sourcenode erp-onprem-db1 \ -srcauth zdmauth -srcarg1 user:oracle \ -srcarg2 identity_file:/home/zdmuser/.ssh/zdm_key -srcarg3 sudo_location:/usr/bin/sudo \ -targetnode erpaz-node1 -tgtauth zdmauth -tgtarg1 user:opc \ -tgtarg2 identity_file:/home/zdmuser/.ssh/zdm_key -tgtarg3 sudo_location:/usr/bin/sudo \ -rsp /home/zdmuser/erp_physical_online.rsp \ -pauseafter ZDM_CONFIGURE_DG_SRC
$ZDM_HOME/bin/zdmcli query job -jobid 12 |
Expected output |
Job ID: 12
Job Type: "MIGRATE"
Current status: PAUSED
Current Phase: "ZDM_CONFIGURE_DG_SRC"
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_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_DATAPATCH_TGT .......... PENDING
ZDM_POST_MIGRATE_TGT ....... PENDING
ZDM_CLEANUP_SRC ............ PENDING
ZDM_CLEANUP_TGT ............ PENDINGWhat to expect: Status PAUSED after ZDM_CONFIGURE_DG_SRC, with every earlier phase COMPLETED and the switchover phases PENDING. The restore phase takes as long as copying the database over ExpressRoute: roughly 3 to 4 hours per TB on a 1 Gbit/s link. The exact phase list depends on your ZDM release and options; zdmcli migrate database ... -listphases prints it for your configuration.
Step 8: Check the Standby in Azure While the Job Is Paused
With the job paused, the target is a normal physical standby. Check from the broker and from the standby that redo is arriving and being applied, and keep checking until the cut-over. The Data Guard lag diagnosis post on this blog covers what to do if the numbers grow.
Shell |
# On the target node, as oracle dgmgrl / "show configuration" |
Expected output |
Configuration - ZDM_erpcdb_onprem
Protection Mode: MaxPerformance
Members:
ERPCDB_ONPREM - Primary database
ERPCDB_AZ - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 41 seconds ago)SQL |
SELECT name, value, time_computed FROM v$dataguard_stats WHERE name IN ('transport lag', 'apply lag'); |
Expected output |
NAME VALUE TIME_COMPUTED
-------------------- -------------------- ------------------------------
transport lag +00 00:00:00 10/24/2026 16:02:11
apply lag +00 00:00:02 10/24/2026 16:02:11What to expect: Configuration Status SUCCESS, and transport and apply lag of a few seconds at most. Low lag just before the window is what keeps the switchover short. Do not change the broker configuration by hand while the ZDM job owns it.
Step 9: Switch Over in the Window
At the start of the window, stop the application on premises (or put it into maintenance mode), check the lag one last time, and resume the job. ZDM switches the roles, opens the database in Azure as primary, runs datapatch if the target home is newer, and completes the remaining phases.
Shell |
$ZDM_HOME/bin/zdmcli resume job -jobid 12
# Follow progress until the job finishes $ZDM_HOME/bin/zdmcli query job -jobid 12 | grep -E 'Current status|SWITCHOVER|POST_|CLEANUP' |
Expected output |
Current status: SUCCEEDED
ZDM_SWITCHOVER_SRC ......... COMPLETED
ZDM_SWITCHOVER_TGT ......... COMPLETED
ZDM_POST_DATABASE_OPEN_TGT . COMPLETED
ZDM_POST_MIGRATE_TGT ....... COMPLETED
ZDM_CLEANUP_SRC ............ COMPLETED
ZDM_CLEANUP_TGT ............ COMPLETEDWhat to expect: The job ends SUCCEEDED. The two switchover phases are the actual outage, usually a few minutes. Point the application's connection strings to the new SCAN name in Azure (or switch a DNS alias you prepared earlier) and start the application against the new primary.
Step 10: Verify the New Primary and the Fallback
Confirm the roles, that the PDB is open, and that the on-premises database is now a standby receiving redo from Azure. That standby is your fallback: if a serious problem appears in the first days, a switchover back to premises is a broker command, not a new migration.
SQL |
-- On the target, now the primary SELECT db_unique_name, database_role, open_mode FROM v$database;
SELECT name, open_mode FROM v$pdbs WHERE name = 'ERPPDB';
SELECT dest_id, status, db_unique_name, error FROM v$archive_dest WHERE target = 'STANDBY'; |
Expected output |
DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE
---------------- ---------------- --------------------
ERPCDB_AZ PRIMARY READ WRITE
NAME OPEN_MODE
---------- ----------
ERPPDB READ WRITE
DEST_ID STATUS DB_UNIQUE_NAME ERROR
---------- --------- ---------------- --------------------
2 VALID ERPCDB_ONPREMWhat to expect: ERPCDB_AZ is the PRIMARY in READ WRITE, the application PDB is open, and destination 2 ships redo to ERPCDB_ONPREM without errors. Then complete the cloud-side tasks ZDM does not do for you: enable automatic backups for the database in the OCI console, check the database in the Azure portal, and register the new service names with the application team.
Tip: Decide in advance how long the fallback stays. Once the business signs off, remove the on-premises standby from the broker configuration and, if you want a disaster recovery copy, build a standby in a second Azure region instead.
Summary
ZDM's physical online method turns a cross-site migration into a Data Guard switchover. Check the source for ARCHIVELOG, FORCE LOGGING and a TDE keystore, create a placeholder database with the same name on the Exadata VM cluster in Oracle Database@Azure, give the ZDM host key-based SSH with sudo to both sides, and confirm port 1521 in both directions. Write a short response file, run -eval until it passes, then migrate with -pauseafter ZDM_CONFIGURE_DG_SRC and watch the lag for as long as you need. In the window, resume the job, repoint the application, and keep the old source as a standby until sign-off.
Comments