The question I get most often from customers considering OCI is not “how do we run Oracle in the cloud” — they understand that part. The question is: “how do we get there from here?” Moving a production Oracle database to OCI without a well-planned migration approach is one of the fastest ways to have a very bad week. This post covers the migration options available on OCI, when each one makes sense, and the gotchas that trip up even experienced DBAs.
The Four Migration Paths — Choose Based on Your Constraints
There is no single “right” migration approach. The right approach depends on your acceptable downtime window, database size, source platform, and what you want the target architecture to look like.
Option 1: RMAN Backup/Restore
The most straightforward. Take an RMAN backup of your source database, transfer the backup to OCI Object Storage, restore it on an OCI DB System.
bash
# On source: backup to local then transfer to OCIRMAN> BACKUP DATABASE PLUS ARCHIVELOG FORMAT '/backup/full_%U.bkp';# Transfer to OCI Object Storage using OCI CLIoci os object bulk-upload \ --bucket-name migration-bucket \ --src-dir /backup \ --include "*.bkp"# On OCI DB System: restoreRMAN> RESTORE DATABASE FROM TAG 'migration_backup';RMAN> RECOVER DATABASE;RMAN> ALTER DATABASE OPEN RESETLOGS;
Downtime: the duration of the final incremental backup + restore + recovery. For large databases (multi-TB), this can be hours. Plan carefully.
Best for: databases under 500GB, acceptable downtime of several hours, straightforward Oracle-to-Oracle same-version migrations.
Option 2: Data Guard Migration (Near-Zero Downtime)
Set up a temporary Data Guard standby on OCI. Let it synchronize with the primary. When ready, perform a switchover — typically under 30 seconds of application downtime.
This is my preferred approach for production databases where downtime must be minimal. The setup takes longer (Data Guard configuration, network connectivity between on-prem and OCI), but the actual cutover is fast and clean.
sql
-- On OCI standby (after initial sync):-- Verify standby is currentSELECT name, open_mode, db_unique_name FROM v$database;SELECT * FROM v$dataguard_stats WHERE name = 'apply lag';-- When ready to cut over:DGMGRL> SWITCHOVER TO 'oci_standby_name';
After switchover, the old on-prem database becomes the standby. Keep it running for a few days as a fallback before decommissioning.
Option 3: Oracle Zero Downtime Migration (ZDM)
ZDM is Oracle’s purpose-built migration tool for moving databases to OCI with minimal downtime. It automates the Data Guard-based migration approach with a workflow engine, pre-checks, and monitoring.
bash
# ZDM physical migration (uses Data Guard under the hood)zdmcli migrate database \ -sourcesid MYDB \ -sourcenode source_host \ -srcauth zdmauth \ -srcarg1 user:oracle \ -targethostid ocid1.dbsystem.oc1... \ -tgtauth zdmauth \ -tgtarg1 user:opc \ -rsp /home/zdmuser/migration.rsp
ZDM handles the complexity of Data Guard setup, log shipping, and switchover orchestration. For organizations migrating multiple databases to OCI, ZDM dramatically reduces the per-database migration effort.
Option 4: Data Pump (Logical Migration)
Export schema(s) from source using Data Pump, import into OCI. Useful when you’re changing database architecture (non-CDB to CDB, character set conversion, schema consolidation) as part of the migration.
Downtime: the export/import duration, which scales with data volume. For large databases, this can be very long. Not suitable for multi-TB databases without creative approaches (parallel export, tablespace-level export).
Best for: schema-level migrations, platform changes (different OS/CPU architecture), character set migrations, consolidation projects.
The Network — Your Migration’s Biggest Variable
Every migration approach requires moving data from on-prem to OCI. The speed of that transfer determines your migration timeline more than any other factor.
Your options for connectivity:
Internet: Free, available everywhere, unpredictable bandwidth. For databases over a few hundred GB, this is rarely viable for the initial data transfer.
OCI FastConnect: Dedicated private connection from your data center to OCI. Consistent bandwidth (1Gbps, 10Gbps options), low latency. If you’re doing a significant migration project, the cost of FastConnect for the migration period is usually justified.
VPN: Encrypted tunnel over internet. More predictable than raw internet but still limited by your internet bandwidth.
OCI Data Transfer Service: For very large databases (multi-TB), Oracle can ship you a physical storage appliance. You load your backup onto the appliance, ship it to Oracle, and they load it into OCI Object Storage. For databases in the multi-TB range with limited network bandwidth, this is sometimes the only practical approach.
Pre-Migration Checklist — Do This Before You Start
sql
-- 1. Capture current database configurationSELECT * FROM v$version;SELECT name, value FROM v$parameter WHERE isdefault = 'FALSE' ORDER BY name;-- 2. Check for unsupported features or deprecated parameters-- Run AutoUpgrade in analyze mode if changing versionsjava -jar autoupgrade.jar -config upgrade.cfg -mode analyze-- 3. Check database sizeSELECT SUM(bytes)/1024/1024/1024 size_gbFROM dba_segments;-- 4. Check for invalid objectsSELECT count(*) FROM dba_objects WHERE status = 'INVALID';-- 5. Check timezone version (must match on source and target)SELECT * FROM v$timezone_file;-- 6. Check character setSELECT value FROM nls_database_parameters WHERE parameter = 'NLS_CHARACTERSET';
Character set mismatches between source and target are one of the most common migration problems — and one of the hardest to fix after the fact. Verify this before you start.
Post-Migration Validation
Migration isn’t done when the database opens. It’s done when you’ve validated:
sql
-- Row counts for critical tablesSELECT table_name, num_rows FROM dba_tablesWHERE owner = 'YOUR_SCHEMA'ORDER BY num_rows DESC;-- Invalid objects (should be zero after utlrp.sql)SELECT count(*) FROM dba_objects WHERE status = 'INVALID';-- Verify all indexes are validSELECT count(*) FROM dba_indexes WHERE status != 'VALID';-- Check for missing statisticsSELECT count(*) FROM dba_tab_statisticsWHERE last_analyzed IS NULL AND owner = 'YOUR_SCHEMA';
Run your application’s test suite against the migrated database before switching production traffic. If you don’t have a formal test suite, run a representative sample of your most critical reports and transactions manually.

Yorum bırakın