Global Oracle Fleet Migration: Building a Control Plane Above Zero Downtime Migration
Evacuating 500 Oracle databases across regions turns zdmcli from a single-database migration tool into an uncoordinated bandwidth and DNS hazard unless a Temporal control plane governs concurrency, infrastructure state, and proxy cutover above it.
TL;DR
- Problem: Oracle Zero Downtime Migration (ZDM) orchestrates individual Physical (RMAN + Data Guard) and Logical (Data Pump + GoldenGate) moves reliably, but has no awareness of aggregate FastConnect bandwidth, KMS/DNS/OEM dependencies, or fleet-wide abort.
- Answer: Wrap
$ZDM_HOME/bin/zdmcliin a Temporal control plane that gates RMAN waves onoci_fastconnectutilization (<70%), verifies OCI Vault TDE key access beforehand, and swaps traffic atomically through Envoy xDS without application config changes.- Watch out: Application JDBC pools without a bounded
maxLifetimehold open TCP connections to the demoted primary after cutover and fail withORA-16000until those connections drain.
Situation
Oracle Zero Downtime Migration (ZDM) is Oracle’s Maximum Availability Architecture (MAA) tool for moving databases to OCI, Exadata, Oracle Database@Azure/AWS/Google Cloud, or between on-premises hosts. It operates in two distinct modes: Physical migration (using RMAN backup/restore or active duplication plus Data Guard switchover for same-OS, same-endianness targets) and Logical migration (using Data Pump for initial load plus Oracle GoldenGate Microservices for continuous replication across different OS/endianness platforms or into Oracle Autonomous Database).
For a DBA migrating 5 or 10 databases per quarter via $ZDM_HOME/bin/zdmcli, ZDM’s per-job lifecycle (migrate database, query job -jobid, abort job, resume job) is sufficient. When an enterprise must evacuate 500 databases—from 200 GB OLTP systems to 12 TB warehouses—out of a retiring region, ZDM’s scope ends at the database boundary. It does not coordinate aggregate cross-region network bandwidth, cross-region TDE KMS key replication, OEM target updates, or application routing cutovers.
The Problem
Running hundreds of ZDM jobs concurrently without a fleet control plane fails under four explicit constraints.
1. Cross-region FastConnect bandwidth math. Consider a 40 Gbps cross-region FastConnect link (5.0 GB/s theoretical ceiling, or roughly 3.5 GB/s safe usable capacity once you reserve headroom for live production Data Guard redo transport and application traffic). If 100 concurrent Physical ZDM jobs each open 4 RMAN channels pulling 150 MB/s per channel, aggregate demand reaches 100 * 4 * 150 = 60,000 MB/s (60 GB/s)—more than 17x the safe link budget. Under congestion, TCP retransmits stall RMAN duplication and starve Data Guard redo transport for unrelated production databases sharing that interconnect.
2. Physical vs. Logical mode selection. Physical ZDM minimizes cutover downtime via Data Guard switchover, but requires identical OS and endian format and cannot target Autonomous Database Serverless. Logical ZDM (Data Pump + GoldenGate) handles cross-platform moves and Autonomous Database targets, but introduces GoldenGate Microservices extract/replicat lag monitoring and object-level exclusions. Choosing the wrong mode late in a wave forces a full re-instantiation.
3. Ancillary infrastructure drift. ZDM moves the database, not the surrounding platform. If the target region lacks access to the OCI Vault master encryption key protecting the TDE wallet, RMAN restore fails or tablespaces refuse to open with ORA-28374. Similarly, if DNS or proxy endpoints update before OEM monitoring targets and RMAN backup catalogs are re-pointed, the newly promoted primary runs blind without alerts or backups.
4. No fleet-level abort or coordinated rollback. Each zdmcli job is independent. If an optimizer regression or storage defect appears after 50 cutovers while 450 jobs are in flight, ZDM provides no single command to halt remaining RMAN waves, cancel active jobs, and reverse completed Data Guard switchovers.
How do you evacuate 500 Oracle databases across regions using Physical and Logical ZDM while capping aggregate FastConnect load, co-orchestrating KMS/OEM/proxy cutovers, and preserving a single fleet-wide abort path?
Options Considered
| Approach | Max Safe Concurrency | Durable State | Bandwidth Governance | Why Chosen or Rejected |
|---|---|---|---|---|
Manual zdmcli on jump host | 10–15 jobs | Local ZDM service DB only | Manual channel tuning | Rejected — saturates DBA capacity and FastConnect links |
Ansible + zdmcli wrappers | 50–100 jobs | Weak across multi-week sync | Static inventory batches | Rejected — loses 30-day soak state on controller restart |
| Custom parallel SSH scripts | Unbounded (fragile) | Flat logs on NFS/S3 | None | Rejected — no retry idempotency or coordinated rollback |
| Temporal Control Plane + ZDM | Rate-limited by policy | Durable workflow history | Live oci_fastconnect gate | Chosen — enforces link caps, KMS checks, and xDS cutover |
ZDM Physical and ZDM Logical are both retained inside the chosen design because no single replication engine fits every target: Physical handles same-endian Exadata/VM moves at block speed, while Logical handles cross-platform and Autonomous Database targets. Above both modes, Temporal replaces Ansible and SSH scripts because regional evacuations span weeks between initial RMAN/Data Pump load and final cutover; durable workflow state survives control-plane restarts without losing which databases are in sync, soaked, or rolled back.
The Migration Control Plane Architecture
The control plane keeps $ZDM_HOME/bin/zdmcli on an Active-Passive HA ZDM Service Host pair as the database replication engine, while Temporal orchestrates everything outside ZDM: FastConnect admission control, OCI Vault key verification, Envoy xDS endpoint cutover, and OEM/RMAN reconfiguration.
flowchart TD
A[Fleet Catalog — 500 DBs classified Physical or Logical] --> B[Temporal Control Plane — durable orchestrator]
B --> C[Bandwidth Gate — oci_fastconnect BitsReceived below 70pct]
C --> D[Phase 1 — Verify OCI Vault KMS key and target infra]
D --> E[Phase 2 — zdmcli migrate database RMAN or Data Pump]
E --> F[Phase 3 — Poll zdmcli query job and lag metrics]
F --> G[Phase 4 — Pre-cutover app pool TTL check]
G --> H[Phase 5 — ZDM switchover and Envoy xDS endpoint swap]
H --> I[Phase 6 — 72h soak on V$DATAGUARD_STATS]
I --> J[Phase 7 — Retire source backups and instance]
B --> K[Global Abort Signal] --> L[zdmcli abort job and reverse switchover]
FastConnect bandwidth-aware admission gate. Before Temporal starts a heavy RMAN active duplication or Data Pump network transfer, an activity queries OCI Monitoring’s oci_fastconnect namespace (BitsReceived metric) and counts active bulk-copy workflows. New Phase 2 transfers start only when measured link utilization is below 70% and active bulk-copy jobs are below 30:
from datetime import datetime, timedelta, timezone
import oci
async def get_fastconnect_utilization_pct(
compartment_id: str, link_capacity_bps: int = 40_000_000_000
) -> float:
signer = oci.auth.signers.InstancePrincipalsSecurityTokenSigner()
client = oci.monitoring.MonitoringClient({}, signer=signer)
now = datetime.now(timezone.utc)
resp = client.summarize_metrics_data(
compartment_id=compartment_id,
summarize_metrics_data_details=oci.monitoring.models.SummarizeMetricsDataDetails(
namespace="oci_fastconnect",
query="BitsReceived[5m].rate().percentile(0.9)",
start_time=now - timedelta(minutes=10),
end_time=now,
),
)
if not resp.data or not resp.data[0].aggregated_datapoints:
return 0.0
bps = resp.data[0].aggregated_datapoints[-1].value
return (bps / link_capacity_bps) * 100.0
Programmatic zdmcli wrapper with Physical and Logical response files. Because ZDM executes through $ZDM_HOME/bin/zdmcli (using .oci/config API keys for OCI HTTPS endpoints), a lightweight host wrapper on the ZDM Service Host exposes idempotent operations to Temporal—checking for an existing active job before calling zdmcli migrate database and polling zdmcli query job -jobid:
import re
import subprocess
ZDMCLI = "/u01/app/zdm/bin/zdmcli"
def start_zdm_job(rsp_file: str, source_db: str, eval_only: bool = False) -> str:
cmd = [ZDMCLI, "migrate", "database", "-rsp", rsp_file, "-sourcedb", source_db]
if eval_only:
cmd.append("-eval")
proc = subprocess.run(cmd, capture_output=True, text=True, check=True, timeout=300)
match = re.search(r"job ID \"(\d+)\"", proc.stdout)
if not match:
raise RuntimeError(f"Could not parse ZDM job ID: {proc.stdout[:300]}")
return match.group(1)
def query_zdm_job(job_id: str) -> str:
proc = subprocess.run(
[ZDMCLI, "query", "job", "-jobid", job_id],
capture_output=True, text=True, check=True, timeout=60,
)
return proc.stdout
Envoy xDS proxy cutover and post-switchover Data Guard check. Instead of asking 80 application teams to edit JDBC TNS strings during a cutover window, applications connect through an Envoy TCP proxy cluster. Once zdmcli completes switchover (Physical) or GoldenGate drain (Logical), Temporal updates the Envoy Endpoint Discovery Service (ClusterLoadAssignment) to point at the target region’s SCAN VIP and closes idle upstream connections so new transactions land on the new primary immediately. During the 72-hour soak, the agent verifies reverse Data Guard sync using SOURCE_DB_UNIQUE_NAME on V$DATAGUARD_STATS:
SELECT source_db_unique_name,
name,
value AS lag_value,
unit
FROM v$dataguard_stats
WHERE name IN ('transport lag', 'apply lag');
Physical vs. Logical response files and ZDM Service Host HA. The Temporal catalog classifies each database before Phase 1 so the host wrapper generates the right ZDM response file. For Physical migrations (same OS and endianness), the response file sets MIGRATION_METHOD=ONLINE_PHYSICAL with DATA_TRANSFER_MEDIUM=DIRECT (or OSS for OCI Object Storage staging when direct SQL*Net connectivity between source and target is restricted). For Logical migrations (cross-platform or targeting Oracle Autonomous Database), the response file sets MIGRATION_METHOD=ONLINE_LOGICAL and points to a pre-configured Oracle GoldenGate Microservices Hub (GOLDEN_GATE_HUB_URL), using Data Pump over Object Storage for the initial load before GoldenGate catches up on ongoing transactions. Because the ZDM Service Host stores job state in its local repository, deploying ZDM in an Active-Passive HA configuration with shared /u01/app/zdm metadata and querying zdmcli query job by source database name before submitting a new job prevents Temporal activity retries from spawning duplicate migrations after a ZDM host failover. In addition, passing -pauseafter ZDM_CONFIGURE_DG_SRC (for Physical) or -pauseafter ZDM_VALIDATE_TGT lets Temporal hold the migration in a synchronized standby state indefinitely—separating the multi-day RMAN/Data Pump copy phase from the 5-minute maintenance window where Envoy xDS and zdmcli resume job execute cutover.
How It Rolls Out
Regional evacuations run through four gated stages so every database proves infrastructure readiness, sync stability, and rollback safety before the source is retired.
Phase 1: Infrastructure, KMS, and -eval Pre-flight. Temporal provisions target DB systems, verifies target-region OCI Vault key access (oci kms management key get), confirms application JDBC pools enforce maxLifetimeMs <= 1800000 (30 minutes), and runs zdmcli migrate database ... -eval. Gate: -eval passes with zero errors and KMS key is readable from the target subnet. Rollback: tear down empty target infrastructure with zero impact on production.
Phase 2: Bandwidth-Gated Copy and Replication Sync. Temporal admits databases into zdmcli migrate database only when oci_fastconnect utilization is <70% and active bulk transfers are <30. Physical jobs instantiate a Data Guard standby via RMAN; Logical jobs run Data Pump initial load and start GoldenGate Microservices replication. Gate: V$DATAGUARD_STATS transport/apply lag (or GoldenGate extract/replicat lag) stays within RPO for 24 hours. Rollback: run zdmcli abort job -jobid <id> and drop the target standby.
Phase 3: Switchover, Envoy xDS Swap, and Monitoring Cutover. During the approved application window, Temporal pauses writes briefly (for Logical) or triggers ZDM Physical Data Guard switchover, pushes the new SCAN IP via Envoy xDS, and updates OEM agent targets and RMAN catalog entries via API. Gate: application health checks pass against the new primary and OEM reports target up. Rollback: for Physical migrations, execute Data Guard switchover back to the original primary and revert Envoy xDS; for Logical migrations, reverse GoldenGate replication before retiring the source.
Phase 4: 72-Hour Soak and Source Decommission. Keep the former primary running as a synchronized standby for 72 hours while monitoring V$DATAGUARD_STATS and application latency. Keeping reverse replication active for 72 hours preserves a fast switchover rollback without re-copying terabytes of data over FastConnect, while letting teams verify nightly batch jobs, reporting queries, and RMAN backups on the target region. Gate: zero sev-1/sev-2 regressions over 72 hours. Rollback: instant Data Guard switchover back to the original region until the soak expires; afterward, disable scheduled RMAN backups, deregister the catalog entry, and terminate the source instance.
In Practice
- ZDM Physical vs. Logical engine boundaries (Pattern A): Per Oracle ZDM documentation, Physical migration uses RMAN and Data Guard switchover for same-OS, same-endianness targets, whereas Logical migration uses Data Pump and GoldenGate Microservices for cross-platform moves and Oracle Autonomous Database targets.
- ZDM CLI and OCI integration (Pattern A): Per Oracle ZDM Administration Guide,
$ZDM_HOME/bin/zdmcli(migrate database,query job,abort job,resume job) is the primary ZDM interface, communicating with OCI endpoints over HTTPS (port 443) using.oci/configAPI keys. - FastConnect telemetry lag (Pattern B): OCI Monitoring’s
oci_fastconnectBitsReceivedmetric aggregates over 5-minute windows, so an admission gate that relies solely on current utilization can over-admit jobs during a burst; pairing the<70%metric gate with a hard cap of30concurrent bulk-copy jobs prevents oversubscribing a 40 Gbps link. - Sticky JDBC connection pools (Pattern B): Updating Envoy xDS or DNS does not sever already-established TCP sockets held by application connection pools; without a bounded
maxLifetime(or explicit Envoy upstream socket drain on cutover), writes continue hitting the demoted standby and fail withORA-16000: database or pluggable database open for read-only access.
Where It Breaks
| Failure Mode | Breaks How | Detect | Mitigate |
|---|---|---|---|
Sticky pool writes (ORA-16000) | App JDBC pool lacks maxLifetime; writes hit demoted standby | App error spike with ORA-16000 immediately after cutover | Require maxLifetimeMs <= 1800000 in Phase 1; drain Envoy connections |
TDE key inaccessible (ORA-28374) | Target region lacks OCI Vault master key replication/policy | RMAN restore or DB open fails with ORA-28374 | Run oci kms management key get from target subnet in Phase 1 |
| FastConnect metric lag saturation | 5-min BitsReceived lag admits too many RMAN streams at once | Production Data Guard transport lag spikes on unrelated DBs | Pair <70% utilization gate with max_concurrent=30 and 4 channels/job |
| Single-node ZDM host outage | Jump host reboot or patching kills zdmcli service mid-wave | zdmcli query job connection errors in Temporal activity | Run ZDM Service Host in Active-Passive HA; check existing jobs before submit |
| Orphaned ZDM job on fleet abort | Temporal cancels workflows while zdmcli keeps running locally | Fleet Catalog says ROLLED_BACK while target keeps syncing | Global abort handler runs zdmcli abort job -jobid before reverting |
| OEM & backup blindness post-cutover | OEM target and RMAN catalog still point to retired source host | OEM target unreachable or missed nightly RMAN backup | Make OEM REST API update and Level 1 test backup mandatory in Phase 3 |
Key Takeaways
- Choose ZDM Physical or Logical by platform boundary, not preference: Physical (RMAN + Data Guard) gives the fastest block-level cutover for same-OS/same-endianness targets; Logical (Data Pump + GoldenGate) is required for cross-platform shifts and Autonomous Database.
- Govern aggregate FastConnect bandwidth above ZDM: ZDM tunes RMAN channels per job, not across 500 jobs; pair OCI
oci_fastconnectBitsReceivedchecks (<70%) with a hard concurrent-copy cap (30jobs) to protect unrelated Data Guard redo transport. - Automate KMS, Envoy xDS, and OEM in the same workflow: Database replication is only half the migration; TDE key access (
ORA-28374), connection draining (ORA-16000), and OEM target updates must be gated inside the control plane. - Make ZDM job submission idempotent: Query existing ZDM jobs before invoking
zdmcli migrate databaseso Temporal activity retries after ZDM host restarts never spawn duplicate migrations. - Hold a 72-hour reverse-sync soak before deleting sources: Keep the original primary synchronized as a standby for 72 hours so any post-cutover regression can reverse via Data Guard switchover instead of a multi-terabyte restore.
What to Do Next
- Problem: Running
zdmclidirectly across hundreds of Oracle databases saturates cross-region FastConnect links, misses KMS/DNS/OEM dependencies, and lacks a coordinated fleet abort path. - Solution: Place a Temporal control plane above an HA ZDM Service Host pair to enforce
oci_fastconnectbandwidth gates, verify OCI Vault keys, drivezdmcli, and swap traffic through Envoy xDS. - Proof: Confirm
zdmcli migrate database ... -evalpasses cleanly on a pilot database, verifyoci kms management key getsucceeds from the target subnet, and testV$DATAGUARD_STATS(SOURCE_DB_UNIQUE_NAME) lag polling. - Action: Inventory the non-database dependencies (OCI Vault KMS key policies, JDBC
maxLifetimeMs, Envoy/DNS routing, OEM targets, and RMAN catalog entries) for your top five critical databases before scheduling Wave 1.
Sources
- Oracle Zero Downtime Migration Documentation — Introduction (Physical and Logical Migration): https://docs.oracle.com/en/database/oracle/zero-downtime-migration/21.4/zdmug/introduction-oracle-zero-downtime-migration.html
- Oracle Zero Downtime Migration —
zdmcliCommand Reference: https://docs.oracle.com/en/database/oracle/zero-downtime-migration/21.4/zdmug/zero-downtime-migration-command-reference.html - Oracle Data Guard Concepts and Administration — Switchover and Failover: https://docs.oracle.com/en/database/oracle/oracle-database/19/dgbkr/oracle-data-guard-switchover-and-failover-procedures.html
- Oracle Database Reference —
V$DATAGUARD_STATS: https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/V-DATAGUARD_STATS.html - OCI Monitoring Service —
oci_fastconnectMetrics Reference (BitsReceived): https://docs.oracle.com/en-us/iaas/Content/Monitoring/Reference/metics-reference.htm - Temporal Documentation — Activity Heartbeats and Durable Execution: https://docs.temporal.io/activities#activity-heartbeats
- Envoy Proxy Documentation — Endpoint Discovery Service (EDS / xDS v3): https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/endpoint/v3/eds.proto
Interactive tools for this topic