Lesson 5: Comparing ZDM vs GoldenGate vs RMAN

Ashish Agnihotri

Data Analyst at Exaguru 

Introduction

While Oracle Zero Downtime Migration (ZDM) provides a powerful CLI-driven framework to automate database migrations, enterprises often require end-to-end Infrastructure as Code (IaC) automation.
  • Terraform is used to provision OCI infrastructure consistently.
  • Ansible is used to configure and orchestrate ZDM tasks (installation, connectivity, job execution).
When combined, Terraform + Ansible + ZDM deliver a repeatable, consistent, and enterprise-grade migration pipeline for Oracle Databases to OCI or ExaCC.

Technical Architecture

1️⃣ Terraform Layer (OCI Infrastructure Provisioning)
  • Creates required target DB systems (VM/BM/ExaCC).
  • Provisions networking components (VCN, subnets, gateways).
  • Deploys Compute node for ZDM Service Host.
2️⃣ Ansible Layer (Configuration & Orchestration)
  • Installs and configures ZDM software on the service host.
  • Sets up SSH keys & wallets for secure connectivity.
  • Automates ZDM CLI commands for pre-check, migration, and monitoring.
3️⃣ ZDM Engine (Migration Workflow)
  • Executes the actual RMAN, GoldenGate, or Data Guard-based migration.
  • Logs, retries, and orchestrates cutover.

Workflow Overview

  
Terraform  --->  OCI Resources (Target DB + ZDM Host) 
Ansible    --->  ZDM Configuration & Execution 
ZDM        --->  Migration Orchestration (RMAN / OGG / DG) 

🔹 Step 1: Provision OCI Target with Terraform


Terraform Example: Create Target DB System
 resource "oci_database_db_system" "target_db" {
     availability_domain   = var.ad
     compartment_id       = var.compartment_ocid
     database_edition      = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE"
     shape                       = "VM.Standard2.8"
     subnet_id                 = oci_core_subnet.db_subnet.id
     display_name           = "Target-19c-DB"
     node_count             = 2 
}  
👉 This provisions the OCI DB system where the 19c target will reside.

🔹 Step 2: Configure ZDM with Ansible


Ansible Playbook: Install ZDM on Service Host
 - name: Install ZDMhosts: zdm_hostbecome: yestasks:- name: Download ZDM softwareget_url:url: https://oracle.com/zdm/latest.zipdest: /tmp/zdm.zip- name: Extract ZDMunarchive:src: /tmp/zdm.zipdest: /u01/app/oracle/zdmremote_src: yes- name: Run ZDM setupshell: |         
/u01/app/oracle/zdm/zdm_installer.sh -silent 
👉 This ensures the ZDM service host setup is fully automated.

🔹 Step 3: Run Migration with Ansible Automation

Ansible Task to Trigger ZDM CLI

 - name: Run ZDM Pre-checkshell: |     
zdmcli migrate database \       
-sourcedb my11gDB \       
-targetdb my19cDB \       
-mode rman \       
-precheck   
register: precheck_out- debug: var=precheck_out.stdout_lines 
Cutover Phase Command (Automated):
 - name: Execute ZDM Migrationshell: |     
zdmcli migrate database \       
-sourcedb my11gDB \       
-targetdb my19cDB \       
-mode rman      

🔹 Benefits of Ansible + Terraform + ZDM

✔️ Infrastructure as Code → Standardized & repeatable environments.
✔️ End-to-End Automation → No manual DB migration steps.
✔️ CI/CD Ready → Integrates with pipelines (GitHub Actions, Jenkins, OCI DevOps).
✔️ Scalable → Supports multiple migrations across regions/tenants.
✔️ Compliance & Auditability → IaC ensures traceability of infra & migration changes.

🔹 Best Practices

  • Use Terraform modules for reusability across OCI regions.
  • Encrypt ZDM wallet & SSH keys using OCI Vault.
  • Integrate Ansible runs with OCI Logging/Monitoring.
  • Always test pre-check & upgrade scripts in lower environments.
  • Use GoldenGate mode for mission-critical 24x7 systems.

🔹 Closing Thoughts

By combining ZDM’s robust migration engine with Terraform’s provisioning power and Ansible’s orchestration flexibility, enterprises achieve:
Zero downtime migrations at scale
Standardized, repeatable automation pipelines
Faster cloud adoption with reduced risk
This is not just migration—it’s cloud modernization done right.
 Lesson 4: Troubleshooting ZDM – Common Errors & Fixes

Copyright@Exaguru

Contact Us: +91-6394049607