Note:

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:

Behind the scenes, OCI Database Migration utilizes Oracle Zero Downtime Migration tool, eliminating the need for infrastructure configuration.

Migration Modes:

Supported Migrations:

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:

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.

Image showing DMS architecture

Objectives

Prerequisites

The following resources have been set up to facilitate the demo (with names):

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

  1. Download the dms-db-prep-v2.sh script from MOS Note 2953866.1.s.

  2. Run the script to generate the dms_prep_db.sql file.

  3. Run the generated SQL file at the CDB$ROOT level.

    Image showing o/p of dms-db-prep-v2.sh

    Running the dms_prep_db.sql file at the container level generates the DMS_Configuration.sql file. This file requires review and potential modification before being executed at the container level.

    Image showing o/p of dms_prep_db.sql

    Image showing o/p of dms_prep_db.sql

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.

Image showing ggadmin user password set in Target ATP

Task 4: Create Connection for Source Container Database (CDB), Source PDB and Target Database (ATP) in OCI Database Migration Console

  1. Create connection for source CDB.

    1. Go to the OCI Console, navigate to Migration and Disaster Recovery, Database Migrations, Database Connections and click Create connections.

      Image showing create connection page

    2. 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:

      Image showing create connection page

      Image showing create connection page

      • 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.

      Image showing create connection page

      Image showing create connection page

  2. Create connection for source PDB.

    Enter name (SRCPDB) and rest everything will be same as the SRCCDB connection details except the replication database username which will be GGADMIN in case of PDB.

    Image showing create connection page

  3. Create connection for target PDB (ATP).

    1. 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:

      Image showing create connection page

      Image showing create connection page

      • 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.
    2. 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

  1. 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.

    Image showing create Migration page

    Image showing create Migration page

  2. 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.

    Image showing create Migration page

  3. Click Show advanced options and under Validation, select Run premigration advisor during validation.

    Image showing premigration advisor option page

    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.

    Image showing create Migration page

    Image showing create Migration page

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.

Image showing Validate  Migration page

After starting the validation job, click View Details to monitor the progress and review specifics.

Image showing Validate  Migration page

Image showing Validate  Migration page

Image showing Validate  Migration page

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.

Image showing Validate  Migration page

Task 7: Start Migration Task

  1. 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.

    Image showing start  Migration page

    Image showing start  Migration page

    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.

    Image showing Resume  Migration page

  2. 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.

  3. 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.

    Image showing Migration completed page

    Image showing Migration completed page

Acknowledgments

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.