This is a quick setup of a goldenGate HUB in Docker with an Extract from a 12.2 Oracle database and a Replicat to a 19.1 Oracle Database. The assumption is that you already have 1 or 2 databases that you can use for source and target and you have a GoldenGate HUB installed and configured. I have another post here that explains how to create a quick Docker image for GoldenGate.

The first step is to set up the source database and user credentials in the source and target database. The expectation is that you have sysdba privileges in both databases and basic DBA skills to create the users and make the database changes. If not, ask for your DBA to help.

--## WEST DATABASE SETUP
--# AS CDB LEVEL 
set echo on
set feedback on
alter system set enable_goldengate_replication=TRUE scope=both;
alter database force logging;
alter database add supplemental log data;
alter system set streams_pool_size=2G scope=spfile;
archive log list;
create tablespace GG_DATA  datafile '+DATA' size 100m autoextend on next 100m;
alter session set container=WEST;
create tablespace GG_DATA  datafile '+DATA' size 100m autoextend on next 100m;
alter session set container=cdb$root;

--# CDB Extract USER
create user c##ggadmin identified by VtzfBJ5xkum5dS2 container=all default tablespace GG_DATA temporary tablespace temp;
grant create session to c##ggadmin container=all;
grant alter any table to c##ggadmin container=all;
grant resource to c##ggadmin container=all;
grant connect to c##ggadmin container=all;
grant alter system to c##ggadmin container=all;
grant dba to c##ggadmin container=all;
grant dv_goldengate_admin, dv_goldengate_redo_access to c##ggadmin container=all;
exec dbms_goldengate_auth.grant_admin_privilege('c##ggadmin',container=>'all');


--## EAST DATABASE SETUP 
--# AS CDB LEVEL 
-- 
set echo on
set feedback on
alter system set enable_goldengate_replication=TRUE scope=both;
alter database force logging;
alter database add supplemental log data;
alter system set streams_pool_size=2G scope=spfile;
archive log list;
create tablespace GG_DATA  datafile '+DATA' size 100m autoextend on next 100m;
alter session set container=EAST;
create tablespace GG_DATA  datafile '+DATA' size 100m autoextend on next 100m;
alter session set container=cdb$root;

-- PDB Replicat USER
alter session set container=EAST;
create user ggadmin identified by nnzXG48uK9AxfgW container=current default tablespace GG_DATA temporary tablespace temp;
grant create session to ggadmin container=current;
grant alter any table to ggadmin container=current;
grant resource to ggadmin container=current;
grant connect to ggadmin container=current;
grant alter system to ggadmin container=current;
grant dba to ggadmin container=current;
grant dv_goldengate_admin, dv_goldengate_redo_access to ggadmin container=current;
exec dbms_goldengate_auth.grant_admin_privilege('ggadmin');

Next, you will login and go through the screens as the examples below:

Welcome to Service Manager Main Page

Let’s take a look where do we store the tnsnames.ora file and where we can find that information in the WebUI portal. After you selected the Deployment in the Main Page you will land in the Details Page.

TNS_ADMIN variable will point where the tnsnames.ora file need to be created. This variable can be modified.

Back in the Maine Page at Service Manager, let’s start configuring the replication.

Another login is required in the Admin Service

Main Page in the Admin Service, let’s create the connection to both source and target databases.

Add the following example Entry names to the tnsnames.ora file in the location displayed above. Adjust for your Host and Service Name

Now, let’s create the OGG credentials to the database. Source database first.

You can also use EZconnect here:

Credential Alias: srccdb122

User ID: c##ggadmin@<hostname>:1521/<cdb_service>

Make sure you are connecting to the CDB

Next is the Target database connection

You can also use EZconnect here:

Credential Alias: trgpdb193

User ID: ggadmin@<hostname>:1521/<pdb_service>

Make sure you are connecting to the PDB

Let’s add schematrandata to the source. This is the process we ask the Oracle Database to log everything we will need to capture the transaction for replication.

Now let’s create the checkpoint table in the target database. Checkpoint is the process GoldenGate uses to keep track which transaction has been applied to the target database.

With all the database, users and minimum requirements completed, we can now create the first replication. First step is to create an ‘Extract”. Extracts are the capture process that listen to transactions in the DB and writes to the proprietary trail files.

Extract is created, now let’s create the replicat. Replicat is the delivery process that reads from the extract trail file created in the step above and applies to the target database.

Quick check in the extract statistics to see if it captured the DML test.

Replication is now in place. Since this is a HUB configuration you can see both the Extract and Replicat in the Admin Service page.

That’s it. Hope this was fun and you can now explore all other features in GoldenGate. If you run into any issue or found something i need to fix, please reach out.

17 responses to “Quick GoldenGate WebUI HUB Replication Configuration”

  1. Tri Tuc Do Avatar
    Tri Tuc Do

    Hi Alex,

    Could you please share about sequence replication in multitenant environment ?

    I’ve read Doc ID 1321558.1, but I have some confusion about users, such as OGG User for DDL, ggsciUser (user used to login to GGSCI), replicateUser. Please help me to clarify them.

    Regards,
    TT

    Like

    1. Alex Lima Avatar

      Basically you just need to enable sequence replication and add the sequences to the parameter file. Sequence PDB.schema.name;

      Like

  2. Oracle Golden Gate Exract ve Replicat Ekleme - VERITABANI.ORG Avatar

    […] Referanslar: Quick GoldenGate WebUI HUB Replication Configuration […]

    Like

    1. Alex Lima Avatar

      Thank you. looking good.

      Like

  3. Olufemi Temowo Avatar
    Olufemi Temowo

    Thank you Alex

    Like

  4. Olufemi Temowo Avatar
    Olufemi Temowo

    Hello Alex,

    Is the DBA privilege required for an active-active replication for the “gguser”?

    Like

    1. Alex Lima Avatar

      Not really required, but i would say make things easier.

      Like

      1. Olufemi Temowo Avatar
        Olufemi Temowo

        We hit an error OGG-02544 while gguser was trying to insert into this table OXXXXX.DT$_OXXX_TLT_POSTCODE. DBA privilege was advised on the SR, but with push back from security; how do we make a case for this elevated privilege.

        Should this be a case of DBA privilege is a “must have” or a “nice to have” to go through security constraint?

        Like

      2. Alex Lima Avatar

        DBA privs is not required, but if you don’t have it, you need to make sure you have all privileges granted to individual objects. Also, always follow the documentation and support recommendations. This blog is intended to share experiences and knowledge for education purposes. This is not Oracle’s official position, if you need an official Oracle recommendation make sure to follow with the SR.

        Like

  5. olufemitemowo Avatar

    Not sure the first comment was posted
    Hello Alex,
    Thanks for providing guidance where needed. I have a situation at hand where bi-directional replication has been set up as documented …
    Pre-reqs
    a. All privileges in place at both source and Target
    b. GG Hub (OCI) 21.12 version
    1. Enable ACDR at Source DB (On Prem) Oracle 19c
    2. Enable ACDR at Target in OCI (Exadata) 19c
    3. The timestamp on CDRTS$ROW column on both source and target are different for obvious reasons
    4. The DBA_APPPLY_ERROR_MESSAGES table get populated with ORA-26786 and reports conflicting columns “CDRTS$ROW” msg.
    Work Around proposed ….to which is not documented by Oracle
    1. Enable ACDR at source DB
    2. Copy appended table with new invisible columns to Target
    3. Enable ACDR at target DB (with the expectations that latest_timestamp column on both source and target tables will be the same)
    4. Then DBA_APPLY_ERROR_MESSAGES flooding with ORA-26786 will cease to cause an issue.
    Second steps is documented by Oracle but the first step is causing us a lof of issues.

    Like

    1. olufemitemowo Avatar

      e\rrata — Second step not documented by Oracle

      Like

    2. Alex Lima Avatar

      You are most likely having a conflict because of the timestamp if they are not in sync correctly.

      Like

  6. Rodrigo Avatar
    Rodrigo

    Very good post. congratulations!!

    Talking about golden gate hub, is it possible with classical architecture?

    Like

    1. Alex Lima Avatar

      Yes you can do that too.

      Like

    2. Alex Lima Avatar

      Yes, it is. You can create a HUB in Classic. But keep in mind Classic will no longer be supported in 23c.

      Like

  7. Raymond Munene Avatar
    Raymond Munene

    Hi Alex, thanks for the note. I’ve set up extract & replicat but replication is not happening.

    Oracle GoldenGate Delivery for Oracle, REPO.prm: Replication of PARTIAL XML containing NCHAR/NVARCHAR/NCLOB data may cause divergence.

    Oracle GoldenGate Capture for Oracle, EXTG.prm: Replication of OID column in object tables may diverge.

    Liked by 1 person

    1. Alex Lima Avatar

      Hi Raymond, The best thing to do is to open an SR and have support troubleshoot with you.

      Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.