Steps to configure Goldengate Replication

Hello Friend's

In This post we will discuss the Goldengate configration with integrated method on 12c multitenant architecture

So lets get started with the configration

Unzip the software on both source and target :

e.g :


[gguser@dm01gg01 oracle]$ unzip --q V975837-01.zip -d /Golden/soft/
Archive:  V975837-01.zip
   creating: /Golden/soft/fbo_ggs_Linux_x64_shiphome/
   creating: /Golden/soft/fbo_ggs_Linux_x64_shiphome/Disk1/
   creating: /Golden/soft/fbo_ggs_Linux_x64_shiphome/Disk1/install/
  inflating: /Golden/soft/fbo_ggs_Linux_x64_shiphome/Disk1/install/.oui
  inflating: /Golden/soft/fbo_ggs_Linux_x64_shiphome/Disk1/install/attachHome.sh
  inflating: /Golden/soft/fbo_ggs_Linux_x64_shiphome/Disk1/install/clusterparam.ini
  inflating: /Golden/soft/fbo_ggs_Linux_x64_shiphome/Disk1/install/detachHome.sh
   creating: /Golden/soft/fbo_ggs_Linux_x64_shiphome/Disk1/install/images/
  inflating: /Golden/soft/fbo_ggs_Linux_x64_shiphome/Disk1/install/images/billboards.gif

Once unzip is done take a new putty session using Xming with it for graphical terminal :

now move to software location used to unzip :


/Golden/soft/fbo_ggs_Linux_x64_shiphome/Disk1
[gguser@dm01gg01 Disk1]$ ls -ltr
total 12
drwxr-xr-x.  4 gguser oinstall 4096 Apr 16  2018 install
drwxr-xr-x. 11 gguser oinstall 4096 Apr 16  2018 stage
-rwxr-xr-x.  1 gguser oinstall  918 Apr 16  2018 runInstaller
drwxrwxr-x.  2 gguser oinstall   25 Apr 16  2018 response

[gguser@dm01gg01 Disk1]$ ./runInstaller 
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 8092 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 7235 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-07-16_03-16-33PM. Please wait ...

NOTE : HAS TO BE DONE ON BOTH SOURCE AND TARGET

E.G of software installation goes as below :










[gguser@dm01gg01 ~]$ g

Oracle GoldenGate Command Interpreter for Oracle
Version 12.3.0.1.4 OGGCORE_12.3.0.1.0_PLATFORMS_180415.0359_FBO
Linux, x64, 64bit (optimized), Oracle 12c on Apr 16 2018 00:53:30
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2018, Oracle and/or its affiliates. All rights reserved.



GGSCI (dm01gg01.database.com) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING


GGSCI (dm01gg01.database.com) 2>

Now start with the configration steps :

Configure Schema

create user and provide grants :

On Source :


ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER DATABASE FORCE LOGGING;
alter system set enable_goldengate_replication=true;


SQL> SELECT supplemental_log_data_min, force_logging FROM v$database;

SUPPLEME FORCE_LOGGING
-------- ---------------------------------------
YES      YES


create user c##ggadmin identified by ora123 default tablespace users temporary tablespace temp;
grant dba TO c##ggadmin CONTAINER=all;
exec dbms_goldengate_auth.grant_admin_privilege('c##ggadmin',container=>'all');
grant connect, resource to c##ggadmin;
grant select any dictionary, select any table to c##ggadmin;
grant create table to c##ggadmin; grant flashback any table to c##ggadmin; grant execute on dbms_flashback to c##ggadmin; grant execute on utl_file to c##ggadmin; grant create any table to c##ggadmin; grant insert any table to c##ggadmin; grant update any table to c##ggadmin; grant delete any table to c##ggadmin; grant drop any table to c##ggadmin; Change Parameter as per requirement UNDO_MANAGEMENT=AUTO UNDO_RETENTION=86400

On Target :


create user ggadm identified by  ggadm;
grant connect, resource to ggadm;
grant select any dictionary, select any table to ggadm;
grant create table to ggadm;
grant flashback any table to ggadm;
grant execute on dbms_flashback to ggadm;
grant execute on utl_file to ggadm;
grant create any table to ggadm;
grant insert any table to ggadm;
grant update any table to ggadm;
grant delete any table to ggadm;
grant drop any table to ggadm;
grant dba TO ggadm;
exec dbms_goldengate_auth.grant_admin_privilege('ggadm');

Create Wallet on source :


[oracle@dm01gg01 ~]$ su - gguser
Password:
Last login: Thu Jul 16 14:58:18 IST 2020 on pts/2
[gguser@dm01gg01 ~]$
[gguser@dm01gg01 ~]$
[gguser@dm01gg01 ~]$ id
uid=504(gguser) gid=501(oinstall) groups=501(oinstall),502(dba),503(oper),506(asmdba),507(asmoper) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[gguser@dm01gg01 ~]$
[gguser@dm01gg01 ~]$ g

Oracle GoldenGate Command Interpreter for Oracle
Version 12.3.0.1.4 OGGCORE_12.3.0.1.0_PLATFORMS_180415.0359_FBO
Linux, x64, 64bit (optimized), Oracle 12c on Apr 16 2018 00:53:30
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2018, Oracle and/or its affiliates. All rights reserved.



GGSCI (dm01gg01.database.com) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING


GGSCI (dm01gg01.database.com) 2>

GGSCI (dm01gg01.database.com) 2> Create Wallet

Created wallet.

Opened wallet.

GGSCI (dm01gg01.database.com) 3> Add CredentialStore

Credential store created.

GGSCI (dm01gg01.database.com) 4> alter credentialstore add user c##ggadmin@pdbsource Password ora123 alias ggadm

Credential store altered.

GGSCI (dm01gg01.database.com) 5> Alter CredentialStore Add USER "sys@asmpr as sysasm", PASSWORD Password1  Alias ggasm

Credential store altered.

GGSCI (dm01gg01.database.com) 6> alter credentialstore add user c##ggadmin@CDBSOURCE Password ora123 alias ggadmin

Credential store altered.

GGSCI (dm01gg01.database.com) 7> info credentialstore

Reading from credential store:

Default domain: OracleGoldenGate

  Alias: ggasm
  Userid: "sys@asmpr as sysasm"

  Alias: ggadm
  Userid: c##ggadmin@pdbsource

  Alias: ggadmin
  Userid: c##ggadmin@CDBSOURCE

Create wallet on target :


GGSCI (dm01gg02.database.com) 2> Create Wallet

Created wallet.

Opened wallet.


GGSCI (dm01gg02.database.com) 4> Add CredentialStore

Credential store created.

GGSCI (dm01gg02.database.com) 5> alter credentialstore add user ggadm@pdbtarget Password ggadm alias ggadm

Credential store altered.

GGSCI (dm01gg02.database.com) 6> Alter CredentialStore Add USER "sys@asmpr as sysasm", PASSWORD Password1 Alias ggasm

Credential store altered.

GGSCI (dm01gg02.database.com) 7> info CREDENTIALSTORE

Reading from credential store:

Default domain: OracleGoldenGate

  Alias: ggadm
  Userid: ggadm@pdbtarget

  Alias: ggasm
  Userid: "sys@asmpr as sysasm"

Create tables for replication source :


SQL>
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBSOURCE                      READ WRITE NO
SQL>
SQL>
SQL> alter session set container=PDBSOURCE;

Session altered.

SQL> create tablespace bigtab datafile '+DATA' size 2G autoextend on next 500M maxsize 5G;

Tablespace created.

SQL> create user bigone identified by bigone quota unlimited on bigtab;

User created.

SQL> alter user bigone default tablespace bigtab;

User altered.

SQL> grant connect,resource to bigone;

Grant succeeded.

SQL> CREATE TABLE bigone.bigtab (
  id            NUMBER(10),
  created_date  DATE,
  lookup_id     NUMBER(10),
  data          VARCHAR2(50)
);  2    3    4    5    6

Table created.

SQL> alter table BIGONE.BIGTAB
  add constraint PK_TAB primary key (ID);  2

Table altered.

SQL> create table BIGONE.COUNTRIES (
  COUNTRY_ID   VARCHAR2(7),
  COUNTRY_NAME VARCHAR2(40),
  constraint COUNTRY_C_ID_PK primary key (COUNTRY_ID)
);  2    3    4    5

Table created.

SQL> alter table BIGONE.COUNTRIES add constraint countries_name_uq unique (country_name);

Table altered.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

Create tables for replication Target on both source and target :


SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBTARGET                      READ WRITE NO
SQL>
SQL> alter session set container=PDBTARGET;

Session altered.

SQL> create tablespace bigtab datafile '+DATA' size 2G autoextend on next 500M maxsize 5G;

Tablespace created.

SQL> create user bigone identified by bigone quota unlimited on bigtab;

User created.

SQL> alter user bigone default tablespace bigtab;

User altered.

SQL> grant connect,resource to bigone;

Grant succeeded.

SQL> CREATE TABLE bigone.bigtab (
  id            NUMBER(10),
  created_date  DATE,
  lookup_id     NUMBER(10),
  data          VARCHAR2(50)
);  2    3    4    5    6

Table created.

SQL> alter table BIGONE.BIGTAB
  add constraint PK_TAB primary key (ID);  2

Table altered.

SQL> create table BIGONE.COUNTRIES (
  COUNTRY_ID   VARCHAR2(7),
  COUNTRY_NAME VARCHAR2(40),
  constraint COUNTRY_C_ID_PK primary key (COUNTRY_ID)
);  2    3    4    5

Table created.

SQL> alter table BIGONE.COUNTRIES add constraint countries_name_uq unique (country_name);

Table altered.

On Source : Add checkpoint table and add supplemental logging for replication tables.


GGSCI (dm01gg01.database.com) 1> info mgr

Manager is running (IP port dm01gg01.database.com.7809, Process ID 13931).


GGSCI (dm01gg01.database.com) 3> dblogin useridalias ggadmin
Successfully logged into database CDB$ROOT.

GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 3> add checkpointtable PDBSOURCE.c##ggadmin.chkpoint
Logon catalog name PDBSOURCE will be used for table specification PDBSOURCE.c##ggadmin.chkpoint.

GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 10> add trandata PDBSOURCE.BIGONE.BIGTAB

2020-07-16 20:31:38  INFO    OGG-15131  Logging of supplemental redo log data is already enabled for table PDBSOURCE.BIGONE.BIGTAB.

2020-07-16 20:31:38  INFO    OGG-15135  TRANDATA for instantiation CSN has been added on table PDBSOURCE.BIGONE.BIGTAB.

2020-07-16 20:31:39  INFO    OGG-10471  ***** Oracle Goldengate support information on table BIGONE.BIGTAB *****
Oracle Goldengate support native capture on table BIGONE.BIGTAB.
Oracle Goldengate marked following column as key columns on table BIGONE.BIGTAB: ID.

GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 11>

GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 11> add trandata PDBFINDB.BIGONE.COUNTRIES
ERROR: OCI Error ORA (status = 65011-ORA-65011: Pluggable database PDBFINDB does not exist.
).

GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 12> add trandata PDBSOURCE.BIGONE.COUNTRIES

2020-07-16 20:32:39  INFO    OGG-15131  Logging of supplemental redo log data is already enabled for table PDBSOURCE.BIGONE.COUNTRIES.

2020-07-16 20:32:39  INFO    OGG-15135  TRANDATA for instantiation CSN has been added on table PDBSOURCE.BIGONE.COUNTRIES.

2020-07-16 20:32:40  INFO    OGG-10471  ***** Oracle Goldengate support information on table BIGONE.COUNTRIES *****
Oracle Goldengate support native capture on table BIGONE.COUNTRIES.
Oracle Goldengate marked following column as key columns on table BIGONE.COUNTRIES: COUNTRY_ID.

GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 13>

On Target : Add checkpoint table


GGSCI (dm01gg02.database.com) 2> info mgr

Manager is running (IP port dm01gg02.database.com.7809, Process ID 9788).


GGSCI (dm01gg02.database.com) 3>

GGSCI (dm01gg02.database.com) 3> dblogin useridalias ggadm
Successfully logged into database PDBTARGET.

GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 4> add checkpointtable PDBTARGET.ggadm.chkpoint

Successfully created checkpoint table PDBTARGET.ggadm.chkpoint.

GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 5>

GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 5> edit param GLOBALS



GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 6> view param GLOBALS

PDBTARGET.ggadm.chkpoint

ON Source : Add parameter files


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 13> view param EF_SRC1

EXTRACT EF_SRC1
SETENV (ORACLE_HOME = "/oracle/app/orawork/product/12.2.0.1/db_1")
SETENV (ORACLE_SID = "CDBSOURCE")
useridalias ggadmin
EXTTRAIL /Golden/GGSRC/dirdat/sd
DISCARDFILE /Golden/GGSRC/dirrpt/disc_EF_SRC.dsc, PURGE
--TRANLOGOPTIONS ASMUSERALIAS ggasm
TranlogOptions IntegratedParams (max_sga_size 256)
DDL INCLUDE MAPPED
TABLE PDBSOURCE.BIGONE.BIGTAB;
TABLE PDBSOURCE.BIGONE.COUNTRIES;


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 14> view param PM_SRC1

Extract  PM_SRC1
SETENV (ORACLE_HOME = "/oracle/app/orawork/product/12.2.0.1/db_1")
SETENV (ORACLE_SID = "CDBSOURCE")
useridalias ggadmin
rmthost dm01gg02.database.com, mgrport 7809
rmttrail /Golden/GGTRT/dirdat/ds
TABLE PDBSOURCE.BIGONE.BIGTAB;
TABLE PDBSOURCE.BIGONE.COUNTRIES;


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 15>


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 16> register extract EF_SRC1 database container(PDBSOURCE)

2020-07-16 21:15:15  INFO    OGG-02003  Extract EF_SRC1 successfully registered with database at SCN 1580886.


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 17> add extract EF_SRC1, integrated tranlog, begin now , DESCRIPTION "Tables BIGTAB and COUNTRIES"
EXTRACT (Integrated) added.


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 18> ADD EXTTRAIL /Golden/GGSRC/dirdat/sd, EXTRACT EC_CAL_B, MEGABYTES 100
EXTRACT group does not exist.

GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 19> ADD EXTTRAIL /Golden/GGSRC/dirdat/sd, EXTRACT EF_SRC1, MEGABYTES 100
EXTTRAIL added.

GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 20> ADD EXTRACT PM_SRC1, EXTTRAILSOURCE /Golden/GGSRC/dirdat/sd, description "PUMP for BIGTAB and COUNTRIES"
EXTRACT added.


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 21> ADD RMTTRAIL /Golden/GGTRT/dirdat/ds, EXTRACT PM_SRC1, megabytes 100
RMTTRAIL added.

GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 22>

GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 22> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     STOPPED     EF_SRC1     00:00:00      00:05:57
Description "Tables BIGTAB and COUNTRIES"
EXTRACT     STOPPED     PM_SRC1     00:00:00      00:03:04
Description "PUMP for BIGTAB and COUNTRIES"


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 31> start EF_SRC1

Sending START request to MANAGER ...
EXTRACT EF_SRC1 starting


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 32> start PM_SRC1

Sending START request to MANAGER ...
EXTRACT PM_SRC1 starting

GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 44> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EF_SRC1     00:12:10      00:05:33
Description "Tables BIGTAB and COUNTRIES"
EXTRACT     RUNNING     PM_SRC1     00:00:00      00:00:09
Description "PUMP for BIGTAB and COUNTRIES"

Now our extract and pump are working fine ,we will now move to target server for the replicat configration .

we will create a replicat parameter file and add a replicat that will apply the changes to target side

On Target server :


GGSCI (dm01gg02.database.com) 3> dblogin useridalias ggadm
Successfully logged into database PDBTARGET.

GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 4> add checkpointtable PDBTARGET.ggadm.chkpoint

Successfully created checkpoint table PDBTARGET.ggadm.chkpoint.

GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 5>

GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 7> edit param REP_TRT1



GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 8> view param REP_TRT1

REPLICAT REP_TRT1
SETENV (ORACLE_HOME = "/oracle/app/orawork/product/12.2.0.1/db_1")
SETENV (ORACLE_SID = "CDBTARGET")
ASSUMETARGETDEFS
useridalias ggadm
DBOPTIONS INTEGRATEDPARAMS(parallelism 6)
REPERROR (1403,DISCARD)
REPERROR(2291,DISCARD)
HANDLECOLLISIONS
DISCARDFILE /Golden/GGTRT/dirrpt/disc_TRT.dsc, PURGE
DDL INCLUDE MAPPED
APPLYNOOPUPDATES
DDLERROR DEFAULT IGNORE RETRYOP
MAP PDBSOURCE.BIGONE.BIGTAB,     target  PDBTARGET.BIGONE.BIGTAB;
MAP PDBSOURCE.BIGONE.COUNTRIES,  target  PDBTARGET.BIGONE.COUNTRIES;

GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 9> Add Replicat REP_TRT1 Integrated  exttrail /Golden/GGTRT/dirdat/ds, description "Tables BIGTAB and COUNTRIES"

GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 11> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    STOPPED     REP_TRT1    00:00:00      00:00:02
Description "Tables BIGTAB and COUNTRIES"


GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 12> start REP_TRT1

Sending START request to MANAGER ...
REPLICAT REP_TRT1 starting


GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 13> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     REP_TRT1    00:00:00      00:02:01
Description "Tables BIGTAB and COUNTRIES"


GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 14>

Now all our process are running , we will now start with populating the source tables and lets see how the replication goes on

let's start populating the sour tables BIGTAB & COUNTRIES

Will start with insert proc for first table with 200000 rows to insert


[oracle@dm01gg01 trace]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Thu Jul 16 21:52:20 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>
SQL> set pages 9999 lines 300
col OPEN_MODE for a10
col HOST_NAME for a30
select name DB_NAME,HOST_NAME,DATABASE_ROLE,OPEN_MODE,log_mode,version DB_VERSION,LOGINS,to_char(STARTUP_TIME,'DD-MON-YYYY HH24:MI:SS') "DB UP TIME" from v$database,v$instance;
SQL> SQL> SQL>
DB_NAME   HOST_NAME                      DATABASE_ROLE    OPEN_MODE  LOG_MODE     DB_VERSION        LOGINS     DB UP TIME
--------- ------------------------------ ---------------- ---------- ------------ ----------------- ---------- -----------------------------
CDBSOURC  dm01gg01.database.com          PRIMARY          READ WRITE ARCHIVELOG   12.2.0.1.0        ALLOWED    16-JUL-2020 12:45:22

SQL>
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBSOURCE                      READ WRITE NO
SQL>
SQL> alter session set container=PDBSOURCE;

Session altered.

SQL> DECLARE
  l_lookup_id    NUMBER(10);
  l_create_date  DATE;
BEGIN
  FOR i IN 1 .. 200000 LOOP
    IF MOD(i, 3) = 0 THEN
      l_create_date := ADD_MONTHS(SYSDATE, -24);
      l_lookup_id   := 2;
    ELSIF MOD(i, 2) = 0 THEN
      l_create_date := ADD_MONTHS(SYSDATE, -12);
      l_lookup_id   := 1;
    ELSE
      l_create_date := SYSDATE;
      l_lookup_id   := 3;
    END IF;

    INSERT INTO bigone.bigtab (id, created_date, lookup_id, data)
    VALUES (i, l_create_date, l_lookup_id, 'This is some data for ' || i);
  2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19    END LOOP;
  COMMIT;
END;
/ 20   21   22

PL/SQL procedure successfully completed.

Our insert completed let's see the Goldengate replication .


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 48> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EF_SRC1     00:00:00      00:00:01
Description "Tables BIGTAB and COUNTRIES"
EXTRACT     RUNNING     PM_SRC1     00:00:17      00:00:10
Description "PUMP for BIGTAB and COUNTRIES"

There is no lag in the replication , Let's see the stats for the process

Extract :


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 54> stats EF_SRC1

Sending STATS request to EXTRACT EF_SRC1 ...

Start of Statistics at 2020-07-16 22:03:22.

DDL replication statistics (for all trails):

*** Total statistics since extract started     ***
        Operations                                         0.00
        Mapped operations                                  0.00
        Unmapped operations                                0.00
        Other operations                                   0.00
        Excluded operations                                0.00

Output to /Golden/GGSRC/dirdat/sd:

Extracting from PDBSOURCE.BIGONE.BIGTAB to PDBSOURCE.BIGONE.BIGTAB:

*** Total statistics since 2020-07-16 21:57:06 ***
        Total inserts                                 200000.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                              200000.00

*** Daily statistics since 2020-07-16 21:57:06 ***
        Total inserts                                 200000.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                              200000.00

*** Hourly statistics since 2020-07-16 21:57:06 ***
        Total inserts                                 200000.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                              200000.00

*** Latest statistics since 2020-07-16 21:57:06 ***
        Total inserts                                 200000.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                              200000.00

End of Statistics.

PUMP :


GGSCI (dm01gg01.database.com as c##ggadmin@CDBSOURCE/CDB$ROOT) 55>  stats PM_SRC1

Sending STATS request to EXTRACT PM_SRC1 ...

Start of Statistics at 2020-07-16 22:04:03.

Output to /Golden/GGTRT/dirdat/ds:

Extracting from PDBSOURCE.BIGONE.BIGTAB to PDBSOURCE.BIGONE.BIGTAB:

*** Total statistics since 2020-07-16 21:57:11 ***
        Total inserts                                 200000.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                              200000.00

*** Daily statistics since 2020-07-16 21:57:11 ***
        Total inserts                                 200000.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                              200000.00

*** Hourly statistics since 2020-07-16 21:57:11 ***
        Total inserts                                 200000.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                              200000.00

*** Latest statistics since 2020-07-16 21:57:11 ***
        Total inserts                                 200000.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                              200000.00

End of Statistics.

Now with the replicat :

We have got our data replicated :


GGSCI (dm01gg02.database.com as ggadm@CDBTARGET/PDBTARGET) 14> stats REP_TRT1

Sending STATS request to REPLICAT REP_TRT1 ...

Start of Statistics at 2020-07-16 18:05:07.


Integrated Replicat Statistics:

        Total transactions                                 1.00
        Redirected                                         0.00
        Replicated procedures                              0.00
        DDL operations                                     0.00
        Stored procedures                                  0.00
        Datatype functionality                             0.00
        Event actions                                      0.00
        Direct transactions ratio                          0.00%

DDL replication statistics:

*** Total statistics since replicat started     ***
        Operations                                         0.00
        Mapped operations                                  0.00
        Unmapped operations                                0.00
        Other operations                                   0.00
        Excluded operations                                0.00
        Errors                                             0.00
        Retried errors                                     0.00
        Discarded errors                                   0.00
        Ignored errors                                     0.00

Replicating from PDBSOURCE.BIGONE.BIGTAB to PDBTARGET.BIGONE.BIGTAB:

*** Total statistics since 2020-07-16 17:57:16 ***
        Total inserts                                 200000.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                              200000.00

*** Daily statistics since 2020-07-16 17:57:16 ***
        Total inserts                                 200000.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                              200000.00

*** Hourly statistics since 2020-07-16 18:00:00 ***

        No database operations have been performed.

*** Latest statistics since 2020-07-16 17:57:16 ***
        Total inserts                                 200000.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                              200000.00

End of Statistics.

On Target :


[oracle@dm01gg02 trace]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Thu Jul 16 18:07:52 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>
SQL> set pages 9999 lines 300
col OPEN_MODE for a10
col HOST_NAME for a30
select name DB_NAME,HOST_NAME,DATABASE_ROLE,OPEN_MODE,log_mode,version DB_VERSION,LOGINS,to_char(STARTUP_TIME,'DD-MON-YYYY HH24:MI:SS') "DB UP TIME" from v$database,v$instance;
SQL> SQL> SQL>
DB_NAME   HOST_NAME                      DATABASE_ROLE    OPEN_MODE  LOG_MODE     DB_VERSION        LOGINS     DB UP TIME
--------- ------------------------------ ---------------- ---------- ------------ ----------------- ---------- -----------------------------
CDBTARGE  dm01gg02.database.com          PRIMARY          READ WRITE ARCHIVELOG   12.2.0.1.0        ALLOWED    16-JUL-2020 08:46:07

SQL>
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBTARGET                      READ WRITE NO
SQL>
SQL>
SQL> alter session set container=PDBTARGET;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
PDBTARGET
SQL>
SQL>
SQL> select count(*) from BIGONE.BIGTAB;

  COUNT(*)
----------
    200000

With this we completed our goldengate replication . Hope this will help

Regards

Sultan Khan

Previous
Next Post »

1 comments:

Click here for comments
kumud gupta
admin
January 12, 2021 at 11:22 PM ×

Good steps for replication

Congrats bro kumud gupta you got PERTAMAX...! hehehehe...
Reply
avatar