Replicate data from MongoDB to OCI GoldenGate

Learn to replicate data from MongoDB to Autonomous AI JSON Database using OCI GoldenGate.

Autonomous AI JSON Database is a cloud document database service that makes it simple to develop JSON-centric applications. It features NoSQL-style document APIs (Oracle SODA and Oracle AI Database API for MongoDB), serverless scaling, high performance ACID transactions, comprehensive security, and low pay-per-use pricing. Learn more about Autonomous AI JSON Database.

The OCI GoldenGate Big Data deployment type supports no down-time migrations from MongoDB to Autonomous AI JSON Database. OCI GoldenGate supports both Initial Load Extract and Change Data Capture (CDC) extract from MongoDB.

This quickstart details the process to configure OCI GoldenGate for no down-time migrations from MongoDB to Autonomous AI JSON Database.

Before you begin

To successfully complete this quickstart, you must have the following:

To learn more, see Using Oracle GoldenGate Capture for MongoDB.

Task 1: Create the OCI GoldenGate resources

This quickstart example requires deployments and connections for both the source and target.

  1. Create an Oracle Autonomous AI JSON Database.

  2. Create a Big Data deployment.

  3. Create a MongoDB connection.

  4. Create connection for target Create an Autonomous AI JSON Database connection.

  5. Create a connection to GoldenGate, and then assign this connection to the Big Data deployment.

  6. Assign MongoDB and Autonomous AI JSON Database to the Big Data deployment.

Task 2: Create and run the Integrated Extract for MongoDB

  1. In the OCI GoldenGate deployment console, ensure that you're on the Extracts page, and then select Add Extract (plus icon).

  2. Add an Extract with the following values:

    1. On the Extract Information page, under Extract type, select Integrated Extract, enter MCDC as a Process Name, and then select Next.

    2. On the Parameter File page, ensure the source mapping includes TABLE source.*;.

  3. Select Create and Run.

Task 3: Create and run the Initial Load Extract for MongoDB

  1. In the OCI GoldenGate deployment console, ensure that you're on the Extracts page, and then select Add Extract (plus icon).

  2. Add an Extract with the following values:

    1. On the Extract Information page:

      • For Extract Type, select Initial Load Extract.

      • For for Process Name, enter MIL.

    2. On the Parameter File page, make the following changes:

      • Locate the EXTTRAIL line and replace $extfilePath with your trail name. For example:

        EXTFILE I1
      • Define the source mapping as TABLE source.*;.

      Note: This is the source database/collection mapping. `TABLE *. results in extracting from all the databases/collections.

    3. Select Create and Run.

      When MongoDB Initial Load Extract runs successfully, you will see the statistics in the extract report file.

Task 4: Create and run the Initial Load Replicat

  1. In the OCI GoldenGate deployment console, ensure that you're on the Replicats page, and then select Add Replicat (plus icon).

  2. Add the Initial Load Replicat with the following values:

    1. On the Add Replicat page, under Replicat type, select Classic, enter a Process Name, and then select Next.

    2. On the Replication Options page:

      • For Name, enter the name of the Trail from Task 3 (I1).

      • For Domain, select a domain.

      • For Alias, select the Autonomous AI JSON Database connection connection created in Task 1.

      • For Checkpoint Table, select the checkpoint table you created for the target deployment.

    3. On the Managed Options page, leave the fields as they are, and select Next.

    4. On the Replicat Parameters page, you can specify parameters to further configure your Replicat:

      MAP *.*, TARGET *.*;
  3. Select Create and Run:

You return to the Overview page, where you can review the Replicat details. When Replicat starts successfully, you’ll see it in a running state with a green check. You can review the Replicat details and statistics to confirm the replication.

Task 5: Create and run the Classic Replicat

  1. In the OCI GoldenGate deployment console, ensure that you're on the Replicats page, and then select Add Replicat (plus icon).

  2. Add a Replicat with the following values:

    1. On the Replicat Information page, under Replicat type, select Classic Replicat, enter MCDC as a Process Name, and then select Next.

    2. On the Parameter File page, you specify parameters to further configure your Replicat, and then select Create and Run:

      HANDLECOLLISIONS
      MAP *.*, TARGET *.*;

      Note: Add HANDLECOLLISIONS to resolve the issues with duplicate or missing records while applying the replicat. HANDLECOLLISIONS parameter has a negative impact on the performance and that’s why it is recommended to use as needed. When your source & target is synced, you can stop the CDC replicat, remove HANDLECOLLISIONS and re-start the replicat.

You return to the Overview page, where you can review the Replicat details. When Replicat starts successfully, you’ll see it in a running state with a green check. You can check the Replicat details and statistics confirm the replication.