Note:

Set up Real-Time Data Replication using OCI GoldenGate from On-Premises Microsoft SQL Server to Oracle Autonomous Data Warehouse

Introduction

Oracle Cloud Infrastructure GoldenGate (OCI GoldenGate) is a fully managed service that helps data engineers move data in real-time, at scale, from one or more data management systems to OCI databases. Design, run, orchestrate, and monitor data replication tasks in a single interface without having to allocate or manage any compute environments. OCI GoldenGate supports several sources and targets including Microsoft SQL Server, MySQL, PostgreSQL and Oracle database service.

In this tutorial, we will guide you how to set up real-time data replication from on-premises Microsoft SQL Server database to Oracle Autonomous Data Warehouse (ADW) database using OCI GoldenGate.

Image showing Architecture

Limitations

Objectives

Prerequisites

Task 1: Prepare Microsoft SQL Server for OCI GoldenGate

The OCI GoldenGate Microsoft SQL Server deployment type includes support for the following databases:

Follow the steps:

  1. The source usually runs on the default port 1433 but SQL Server can be running in a different port, to check the port run the following command on SQL Server.

    USE master
    GO
    xp_readerrorlog 0, 1, N'Server is listening on'
    GO
    
  2. Create database user.

    CREATE login GGADMIN with password = '<<Password>>'
    Create user GGADMIN for login GGADMIN
    ALTER SERVER ROLE sysadmin ADD MEMBER GGADMIN
    
  3. Create database.

    Create database SRC_OCIGGLL
    
  4. Create schema.

    Create schema SRC_OCIGGLL
    
  5. Enable Change Data Capture (CDC).

    #SQL Server instance
    EXECUTE sys.sp_cdc_enable_db
    
  6. Purge CDC staging table.

    #SQL Server instance
    EXECUTE sys.sp_cdc_drop_job 'cleanup'
    

Task 2: Create OCI GoldenGate Deployment and Set up Source and Target Connections

  1. Log in to the OCI Console and click Create GoldenGate deployments.

  2. Click Create deployment and enter the required information as shown in the following images.

    Image showing how to create OCI GoldenGate deployment

    Image showing how to create OCI GoldenGate deployment

    Image showing how to create OCI GoldenGate deployment

    Image showing how to create OCI GoldenGate deployment

    Note: In the same way, create OCI GoldenGate deployment for Oracle.

  3. Add Source and Target connection details on the deployment page.

    Image showing how to create OCI GoldenGate connection for source

    Image showing how to create OCI GoldenGate connection for source

    Image showing how to create OCI GoldenGate connection for target

    Image showing how to create OCI GoldenGate connection for target

    Note: The following images show the reference to create OCI GoldenGate generic connections which allows communication between two different deployments.

    Image showing how to create OCI GoldenGate connection for source deployment

    Image showing how to create OCI GoldenGate connection for target deployment

  4. To assign the connections to the OCI GoldenGate deployment, click the connection name and assign deployment.

    Note: The following images shows how we have to assign generic OCI GoldenGate connection to other deployments and establish connection between them to trail file flow using distribution path.

    Image showing how to assign Target deployment to a source Generic connection

    Image showing how to assign Source deployment to a Target Generic connection

  5. In the OCI GoldenGate Console of source/target deployment under User Administration, we have to create a new OCI GoldenGate user to establish communication between the two deployments.

    Image showing new Goldengate user creation

Task 3: Create Extract and Replicat Processes

  1. In the OCI GoldenGate Console, add Trandata for the schemas.

    Image showing Initial Load Extract creation

  2. In the OCI GoldenGate Console, create Initial Load Extract and CDC Extract for Microsoft SQL Server 2016 database server.

    Image showing Initial Load Extract creation

    Image showing CDC Extract creation

    Image showing Extract

Task 4: Create Distribution Path to Move the Trail Files Between Deployments

  1. Create Target-Initiated Path from target OCI GoldenGate deployment and enter the required information as shown in the following image.

    Image showing Target initiated path creation

    Image showing Target initiated path creation

    Image showing Target initiated path creation

  2. Enter the default values or change as per your requirement.

    Image showing Target initiated path creation

  3. Click Create path and run.

    Target-initiated path for initial load extract is created and ready for pushing the trail files from Microsoft SQL Server deployment to Oracle deployment.

    Image showing Target initiated path creation

  4. Similarly, create a distribution path for CDC extract and push the trail files from Microsoft SQL Server deployment to Oracle deployment.

    Image showing Target initiated path creation

    Target ADW already has the GGADMIN user, we have to unlock the user and create the application schemas for replication.

    Note: Schema and Tables DDL/Metadata eligible for real time data replication between source and Target has to be manually created and made ready before starting the replicat process.

  5. In the target Oracle deployment create the initial load and CDC replicat with trail files pushed from Microsoft SQL Server deployment.

    Image showing Target initiated path creation

    Image showing Target initiated path creation

    Image showing Target initiated path creation

  6. Once initial load sync up is completed, we can start the CDC replicat and allow the real time data replication to flow between Microsoft SQL Server database and Oracle Autonomous Data Warehouse database.

    Image showing Target initiated path creation

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.