Note:
- This tutorial requires access to Oracle Cloud. To sign up for a free account, see Get started with Oracle Cloud Infrastructure Free Tier.
- It uses example values for Oracle Cloud Infrastructure credentials, tenancy, and compartments. When completing your lab, substitute these values with ones specific to your cloud environment.
Migrate Oracle Databases using Oracle Cloud Infrastructure Database Migration with Online Migration
Introduction
Oracle Cloud Infrastructure Database Migration provides a high-performance, self-service experience for seamless database migrations. Key features include:
- Homogeneous migrations from MySQL or Oracle databases to Oracle Cloud Infrastructure (OCI).
- Enterprise-grade logical online and offline migrations with minimal downtime, leveraging GoldenGate’s data replication technology.
Behind the scenes, OCI Database Migration utilizes Oracle Zero Downtime Migration tool, eliminating the need for infrastructure configuration.
Migration Modes:
-
Offline Migration: A point-in-time snapshot of the source database is copied to the target database, requiring applications to remain offline during migration.
-
Online Migration: An initial snapshot is copied, followed by real-time replication of changes, allowing applications to stay online and operational during migration.
Supported Migrations:
-
Oracle source databases can reside on-premises, in third-party clouds, or on OCI.
-
Supported target databases include Oracle Autonomous Database, Oracle Base Database Service, and Oracle Exadata Database Service.
OCI Database Migration Architecture
OCI Database Migration operates as a managed cloud service, separate from your tenancy and resources, utilizing private endpoints for secure communication. It can migrate Oracle databases from various sources, including on-premises, third-party clouds, or OCI. The service supports migration to multiple Oracle targets, such as:
- Oracle Autonomous Database (shared or dedicated).
- Oracle Base Database Service.
- Oracle Exadata Database Service on Dedicated Infrastructure.
OCI Database Migration operates as a fully managed cloud service, independent of the user’s tenancy and resources. It functions as a multi-tenant service within a dedicated OCI Database Migration tenancy, utilizing private endpoints to communicate with user resources. These private endpoints are managed by OCI Database Migration, providing a seamless experience for users.
-
DMS Control Plane: Enables users to manage migration and database connection objects through the OCI Database Migration console and REST API, providing a centralized interface for seamless migration management.
-
DMS Data Plane: The OCI Database Migration Data Plane, managed by the OCI Database Migration Control Plane, operates transparently to the user. It oversees ongoing migration jobs, communicating with user databases and OCI GoldenGate instances through private endpoints. Notably, the OCI Database Migration Data Plane does not store customer data, as it flows directly through OCI GoldenGate and Oracle Data Pump within the user’s tenancy.
-
Migration: A Migration in OCI Database Migration is a centralized object that holds metadata for migrating a single database. It encompasses details about the source, target, and migration methods. Users can create a migration, validate the environment’s correctness, and then run the migration to transfer database data and schema metadata from the source to the target.
-
Migration Job: A Migration Job in OCI Database Migration represents the execution state of a migration, whether for validation or actual migration. The job progresses through sequential phases, allowing users to pause after a phase and resume manually when ready to proceed to the next phase.
-
Database Connection: A Database Connection in OCI Database Migration stores details about a source or target database, including connection and authentication credentials, securely leveraging the OCI Vault for credential storage. This connection can be reused across multiple migrations, streamlining the process.
Objectives
- Migrate Oracle databases using OCI Database Migration with online migration.
Prerequisites
The following resources have been set up to facilitate the demo (with names):
- Vault (
DMSVAULT
) and encryption key (DMSKEY
). - Virtual Cloud Network (VCN) (
VCN01
) with port1521
,1522
and443
added on default security list table as ingress rules. - OCI Object Storage Bucket (
DMSBUCKET
). - Oracle Database 19c Multitenant database (
DMSOURCE
). - Oracle Autonomous Database target database (
DMSTARGETAUTONOMUS
).
Task 1: Prepare Source Database
To prepare the source database for online migration using OCI GoldenGate, follow these steps:
Create the common user C##GGADMIN
in the container and a local user GGADMIN
in the pluggable database. These users will be used to create a source database connection in the OCI Database Migration console.
Automate the Preparation
-
Download the
dms-db-prep-v2.sh
script from MOS Note 2953866.1.s. -
Run the script to generate the
dms_prep_db.sql
file. -
Run the generated SQL file at the
CDB$ROOT
level.Running the
dms_prep_db.sql
file at the container level generates theDMS_Configuration.sql
file. This file requires review and potential modification before being executed at the container level.
Task 2: Create Sample User in Source Pluggable Database (PDB) and Load Data In the Same
To test the OCI Database Migration functionality, we need to create a sample user TESTUSER
, a table EMPL
and populate it with some data to test the migration. Once this is done, we are good to proceed with the next task.
Task 3: Prepare Target Database
Set the password for ggadmin
user in target Oracle Autonomous Transaction Processing (ATP) and unlock it.
Task 4: Create Connection for Source Container Database (CDB), Source PDB and Target Database (ATP) in OCI Database Migration Console
-
Create connection for source CDB.
-
Go to the OCI Console, navigate to Migration and Disaster Recovery, Database Migrations, Database Connections and click Create connections.
-
Enter the following information.
- Name: Enter
SRCCDB
. - Compartment: Select your own compartment where you have the necessary privilege.
- Type: Select Oracle Database.
- Vault: Select
DMSVAULT
created in Prerequisite. - Encryption Key: Select
DMSKEY
.
Connection Details:
- Initial load database username should be the user who has
DATAPUMP_EXP_FULL_DATABASE
role. - Database wallet is optional.
- Create Private Endpoint: If your database is launched in private subnet, click the same and enter the private subnet name from the drop-down menu. If not, no need to select Create private Endpoint.
- Click Advanced settings.
- SSH database server hostname: Public IP of source database.
- SSH private key: Private key in RSA format which we downloaded during source database creation.
- SSH username: Enter
opc
. - Click Create.
- Once the connection is created, test the connection which should be successful.
- Name: Enter
-
-
Create connection for source PDB.
Enter name (
SRCPDB
) and rest everything will be same as theSRCCDB
connection details except the replication database username which will beGGADMIN
in case of PDB. -
Create connection for target PDB (ATP).
-
Enter the following information.
- Name: Enter
TRGATP
. - Compartment: Enter your own compartment where you have the necessary privilege.
- Type: Select Oracle Autonomous Database.
- Vault: Enter
DMSVAULT
created in Prerequisite. - Encryption Key: Select
DMSKEY
.
Connection Details:
- Database: Enter
DMSTARGETARGETAUTONOMOUS
. - Initial Load database username: Enter
Admin
. - Select Use Different credentials for Replication.
- Replication database username: Enter
ggadmin
. - Replication Database password: Enter the same password as Task 3.
- Create Private Endpoint: If your database is launched in private subnet, click the same and enter private subnet name from the drop-down menu. If not, no need to select Create private Endpoint.
- Name: Enter
-
Click Create, once the creation is done, click Test Connection. It should be successful.
-
Now we are done creating connections to our source CDB, source PDB and the target ATP database.
Task 5: Create Migration
-
Click Migrations, Create Migration and enter the following information.
- Name: Enter
POCMIGRATION
. - Database connection: Select SRCPDB as source database.
- Select Database is pluggable database (PDB).
- Container database connection: Select SRCCDB.
- Name: Enter
-
Enter target database information.
- Target Database: Select TRGATP.
- Transfer medium for Initial load: Select Data pump via Object Storage.
- In Source database:
- Export Directory object name: Enter dumpdir created in source database.
- Export Directory object path: Enter
/u01/app/oracle/dumpdir
created in source database.
- Object storage bucket: Select DMSBUCKET.
-
Click Show advanced options and under Validation, select Run premigration advisor during validation.
In the Advanced Options section, review the various tabs to customize your migration settings. Notably, the Replication tab also allows you to utilize an OCI GoldenGate marketplace instance if you have previously provisioned in your tenancy from marketplace.
Task 6: Validate Migration Task
Click Create. Once it is created let us validate the migration. You can test the connections for the source PDB, source CDB, and target ATP once again before proceeding to validation. We will go with default options.
After starting the validation job, click View Details to monitor the progress and review specifics.
In case of any failures of OCI Database Migration validation job, you can download the OCI Database Migration log as shown in the following images.
Task 7: Start Migration Task
-
Click Start. You will be prompted to choose a stage to pause the migration. The default option is Monitor replication lag where changes made to the source schemas are tracked, captured, and synced with the target database in real-time.
The migration process involves multiple phases. By default, the job pauses at Monitor replication lag where it tracks and synchronizes changes between the source and target databases.
On the cutover date, you need to stop the application and resume the migration job. We need to ensure that no new transactions occur on the source database after this phase and till the cutover completes. The job would then finalize the switchover to the target database and perform cleanup.
-
To complete the switchover, select the switchover phase in the Resume Job window and click Resume. This phase will stop replication and redirect the target application to start transactions on the target database.
-
After the job resumes and completes the switchover phase, click Resume again. Then, select the final phase, clean-up, and click Resume to complete the migration process.
Related Links
Acknowledgments
- Author - Kaushik Mukherjee (Senior Principal Consultant, Oracle India - Bangalore)
More Learning Resources
Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.
For product documentation, visit Oracle Help Center.
Migrate Oracle Databases using Oracle Cloud Infrastructure Database Migration with Online Migration
G33765-01
Copyright ©2025, Oracle and/or its affiliates.