Wednesday 15 December 2021

GGSCI - Initial load from source to target database 19c

GGSCI - Initial load from source to target database 19c 


Source GG : srv6.example.com

Target GG Hostname : srv7.example.com

  • Add IP  address of source GG into target parameter GG  and restart or refresh mgr again 

GGSCI (srv7.example.com) 12> edit param mgr


GGSCI (srv7.example.com) 13> view param mgr


PORT 7810

ACCESSRULE, PROG *, IPADDR 192.168.1.129, ALLOW



GGSCI (srv7.example.com) 14> stop mgr

Manager process is required by other GGS processes.

Are you sure you want to stop it (y/n)?y


Sending STOP request to MANAGER ...

Request processed.

Manager stopped.



GGSCI (srv7.example.com) 15> start mgr

Manager started.



GGSCI (srv7.example.com) 16> info all


Program     Status      Group       Lag at Chkpt  Time Since Chkpt


MANAGER     RUNNING

REPLICAT    RUNNING     REPINT      00:00:00      00:00:04



GGSCI (srv7.example.com) 17>

  • Add initial load process load1 on source GG 


GGSCI (srv6.example.com) 37> ADD EXTRACT load1, SOURCEISTABLE
EXTRACT added.

GGSCI (srv6.example.com) 39> edit param load1


GGSCI (srv6.example.com) 40> view param load1

EXTRACT load1
USERID c##ggsource, PASSWORD ggsource   --connection to CDB$ROOT database
RMTHOST 192.168.1.197,MGRPORT 7810
RMTTASK replicat,GROUP load2
Table sgg1.hr.supplier;


  • Add replication for initial load on target gg parameter 

GGSCI (srv7.example.com) 18> ADD REPLICAT load2, SPECIALRUN
REPLICAT added.


GGSCI (srv7.example.com) 19>


GGSCI (srv7.example.com) 21>  EDIT PARAMS load2



GGSCI (srv7.example.com) 22> view param load2

EPLICAT load2
USERID c##ggtarget@TGG1,PASSWORD ggtarget
ASSUMETARGETDEFS
MAP sgg1.hr.supplier, TARGET tgg1.hr.supplier;
MAP sgg1.hr.supplier, TARGET tgg1.hr.supplier2;


GGSCI (srv7.example.com) 23>


  •  Check source tables before initial load 

SQL> sho pdbs

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

Session altered.

SQL> select count(*) from hr.supplier;

  COUNT(*)
----------
         8

SQL>

  • Target table check before initial load on target database 

SQL> select count(*) from hr.supplier;

  COUNT(*)
----------
         0

SQL> select count(*) from hr.supplier2;

  COUNT(*)
----------
         0

SQL>


  • start initial load process load1 on source database 

GGSCI (srv6.example.com) 45> START EXTRACT load1

Sending START request to MANAGER ...
EXTRACT LOAD1 starting


GGSCI (srv6.example.com) 46> info extract load1

EXTRACT    LOAD1     Initialized   2021-12-12 18:58   Status STARTING
Checkpoint Lag       Not Available
Process ID           32313
Log Read Checkpoint  Not Available
                     First Record         Record 0
Task                 SOURCEISTABLE


GGSCI (srv6.example.com) 47> info extract load1

EXTRACT    LOAD1     Last Started 2021-12-12 19:26   Status STOPPED
Checkpoint Lag       Not Available
Log Read Checkpoint  Table SGG1.HR.SUPPLIER
                     2021-12-12 19:26:39  Record 8
Task                 SOURCEISTABLE


GGSCI (srv6.example.com) 48>


  • Source golden gate ggserr.log details below:

2021-12-12T19:26:32.955+0530  INFO    OGG-25340  Oracle GoldenGate Capture for Oracle, load1.prm:
                              Database Version:
                              Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production.
2021-12-12T19:26:32.955+0530  INFO    OGG-25341  Oracle GoldenGate Capture for Oracle, load1.prm:
                              Database Language and Character Set:
                              NLS_LANGUAGE     = "AMERICAN"
                              NLS_TERRITORY    = "AMERICA"
                              NLS_CHARACTERSET = "AL32UTF8".
2021-12-12T19:26:32.982+0530  INFO    OGG-06509  Oracle GoldenGate Capture for Oracle, load1.prm:  Using the following key columns for source table SGG1.HR.SUPPLIER: SUPPLIER_ID.
2021-12-12T19:26:32.982+0530  INFO    OGG-00993  Oracle GoldenGate Capture for Oracle, load1.prm:  EXTRACT LOAD1 started.
2021-12-12T19:26:37.346+0530  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): info extract load1.
2021-12-12T19:26:38.982+0530  INFO    OGG-02911  Oracle GoldenGate Capture for Oracle, load1.prm:  Processing table SGG1.HR.SUPPLIER.
2021-12-12T19:26:47.593+0530  INFO    OGG-00991  Oracle GoldenGate Capture for Oracle, load1.prm:  EXTRACT LOAD1 stopped normally.
2021-12-12T19:27:05.027+0530  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): info extract load1.


  • Check the table on Target database  
SQL> select count(*) from hr.supplier;

  COUNT(*)
----------
         8

SQL> select count(*) from hr.supplier2;

  COUNT(*)
----------
         8


  • Target golden gate ggserr.log details below:


SQL>
2021-12-12T19:26:38.979+0530  INFO    OGG-00996  Oracle GoldenGate Delivery for Oracle:  REPLICAT load2 started.
2021-12-12T19:26:39.051+0530  WARNING OGG-02760  Oracle GoldenGate Delivery for Oracle:  ASSUMETARGETDEFS is ignored because trail file  contains table definitions.
2021-12-12T19:26:39.051+0530  INFO    OGG-06505  Oracle GoldenGate Delivery for Oracle:  MAP resolved (entry sgg1.hr.supplier): MAP "SGG1"."HR"."SUPPLIER", TARGET tgg1.hr.supplier.
2021-12-12T19:26:45.275+0530  INFO    OGG-02756  Oracle GoldenGate Delivery for Oracle:  The definition for table SGG1.HR.SUPPLIER is obtained from the trail file.
2021-12-12T19:26:45.275+0530  INFO    OGG-06511  Oracle GoldenGate Delivery for Oracle:  Using following columns in default map by name: SUPPLIER_ID, SUPPLIER_NAME, CONTACT_NAME.
2021-12-12T19:26:45.275+0530  INFO    OGG-06510  Oracle GoldenGate Delivery for Oracle:  Using the following key columns for target table TGG1.HR.SUPPLIER: SUPPLIER_ID.
2021-12-12T19:26:45.276+0530  INFO    OGG-06505  Oracle GoldenGate Delivery for Oracle:  MAP resolved (entry sgg1.hr.supplier): MAP "SGG1"."HR"."SUPPLIER", TARGET tgg1.hr.supplier2.
2021-12-12T19:26:47.524+0530  INFO    OGG-06511  Oracle GoldenGate Delivery for Oracle:  Using following columns in default map by name: SUPPLIER_ID, SUPPLIER_NAME, CONTACT_NAME.
2021-12-12T19:26:47.524+0530  INFO    OGG-06510  Oracle GoldenGate Delivery for Oracle:  Using the following key columns for target table TGG1.HR.SUPPLIER2: SUPPLIER_ID.
2021-12-12T19:26:52.583+0530  INFO    OGG-00994  Oracle GoldenGate Delivery for Oracle:  REPLICAT load2 stopped normally.


GGSCI (srv7.example.com) 31> start repint,aftercsn 3979215
REPLICAT REPINT is already running.


GGSCI (srv7.example.com) 32>

ggsci : collision delete handling example 19c

 ggsci  : Collision delete handling example  

source database : sourcegg1

Target database : targetgg1

Source GG Hostname : srv6.example.com

Target GG Hostname : srv7.example.com

Scenario : 

  •  In this scenario  we will delete value from object level and stop the  target replication . Again  insert the data on same object id  on same table.
  • Starting the  replication process at target database and we face erroras unable to map table .
  • Adding HANDLECOLLISIONS parameter on target replication process and start again to sort out error and sync again.

Error:

 ORA-00001: unique constraint (HR.SUPPLIER_PK) violated
                              ORA-00001: unique constraint (HR.SUPPLIER_PK) violated) while processing the record at SEQNO 4, RBA 2673 in Integrated mode. REPLICAT will retry in Direct mode.


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

         3 SGG1                           READ WRITE NO

SQL> select * from hr.supplier order by SUPPLIER_ID;


SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME

----------- -------------------------------------------------- --------------------------------------------------

          1 ABCD1                                              ABCD1

          2 ABCD2                                              ABCD2

          3 ABCD3                                              ABCD3

          4 ABCD4                                              ABCD4

          5 ABCD5                                              ABCD5

          6 ABCD6                                              ABCD6

          7 ABCD7                                              ABCD7

          8 ABCD8                                              ABCD8


8 rows selected.


SQL>

GGSCI (srv6.example.com) 42> view param extint

EXTRACT extint
USERID c##ggsource, PASSWORD ggsource   --connection to CDB$ROOT database
TRANLOGOPTIONS INTEGRATEDPARAMS (MAX_SGA_SIZE 100)
EXTTRAIL /u01/app/oracle/product/sourcegg1/dirdat/lt
--GETINSERTS
--GETUPDATES
--GETDELETES
--GETTRUNCATES
IGNOREDELETES
TABLE sgg1.hr.supplier;



GGSCI (srv6.example.com) 43>


GGSCI (srv6.example.com) 43> stop extint

Sending STOP request to EXTRACT EXTINT ...
Request processed.


GGSCI (srv6.example.com) 44> start extint
EXTRACT EXTINT is already running.


GGSCI (srv6.example.com) 45>


GGSCI (srv6.example.com) 45> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     DPINT       00:00:00      00:00:07
EXTRACT     STOPPED     EXTINT      00:00:00      00:00:26


GGSCI (srv6.example.com) 46> start extint

Sending START request to MANAGER ...
EXTRACT EXTINT starting


GGSCI (srv6.example.com) 47> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     DPINT       00:00:00      00:00:05
EXTRACT     RUNNING     EXTINT      00:00:00      00:00:07


GGSCI (srv6.example.com) 48>



SQL> select * from hr.supplier order by SUPPLIER_ID;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          1 ABCD1                                              ABCD1
          2 ABCD2                                              ABCD2
          3 ABCD3                                              ABCD3
          4 ABCD4                                              ABCD4
          5 ABCD5                                              ABCD5
          6 ABCD6                                              ABCD6
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

8 rows selected.

SQL> delete from hr.supplier where SUPPLIER_ID=1;

1 row deleted.

SQL> commit;

Commit complete.

SQL> select * from hr.supplier order by SUPPLIER_ID;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          2 ABCD2                                              ABCD2
          3 ABCD3                                              ABCD3
          4 ABCD4                                              ABCD4
          5 ABCD5                                              ABCD5
          6 ABCD6                                              ABCD6
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

7 rows selected.

SQL>


GGSCI (srv6.example.com) 49> stats extint

Sending STATS request to EXTRACT EXTINT ...

Start of Statistics at 2021-12-02 19:24:37.

Output to /u01/app/oracle/product/sourcegg1/dirdat/lt:

Extracting from SGG1.HR.SUPPLIER to SGG1.HR.SUPPLIER:

*** Total statistics since 2021-12-02 19:24:27 ***
        Total inserts                                      0.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total ignores                                      1.00
        Total operations                                   0.00

*** Daily statistics since 2021-12-02 19:24:27 ***
        Total inserts                                      0.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total ignores                                      1.00
        Total operations                                   0.00

*** Hourly statistics since 2021-12-02 19:24:27 ***
        Total inserts                                      0.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total ignores                                      1.00
        Total operations                                   0.00

*** Latest statistics since 2021-12-02 19:24:27 ***
        Total inserts                                      0.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total ignores                                      1.00
        Total operations                                   0.00

End of Statistics.


GGSCI (srv6.example.com) 50> 

TARGET database 


SQL> select * from hr.supplier order by SUPPLIER_ID;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          1 ABCD1                                              ABCD1
          2 ABCD2                                              ABCD2
          3 ABCD3                                              ABCD3
          4 ABCD4                                              ABCD4
          5 ABCD5                                              ABCD5
          6 ABCD6                                              ABCD6
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

8 rows selected.

SQL> select * from hr.supplier2 order by SUPPLIER_ID;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

SQL>


source database 

SQL> insert into hr.supplier values (1,'ABCD11','ABCD11');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from hr.supplier order by SUPPLIER_ID;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          1 ABCD11                                             ABCD11
          2 ABCD2                                              ABCD2
          3 ABCD3                                              ABCD3
          4 ABCD4                                              ABCD4
          5 ABCD5                                              ABCD5
          6 ABCD6                                              ABCD6
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

8 rows selected.

SQL>



GGSCI (srv6.example.com) 51> stats extint

Sending STATS request to EXTRACT EXTINT ...

Start of Statistics at 2021-12-02 19:32:05.

Output to /u01/app/oracle/product/sourcegg1/dirdat/lt:

Extracting from SGG1.HR.SUPPLIER to SGG1.HR.SUPPLIER:

*** Total statistics since 2021-12-02 19:24:27 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total ignores                                      1.00
        Total operations                                   1.00

*** Daily statistics since 2021-12-02 19:24:27 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total ignores                                      1.00
        Total operations                                   1.00

*** Hourly statistics since 2021-12-02 19:24:27 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total ignores                                      1.00
        Total operations                                   1.00

*** Latest statistics since 2021-12-02 19:24:27 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total ignores                                      1.00
        Total operations                                   1.00

End of Statistics.


GGSCI (srv6.example.com) 52>




target database 

SQL> select * from hr.supplier order by SUPPLIER_ID
  2  ;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          1 ABCD1                                              ABCD1
          2 ABCD2                                              ABCD2
          3 ABCD3                                              ABCD3
          4 ABCD4                                              ABCD4
          5 ABCD5                                              ABCD5
          6 ABCD6                                              ABCD6
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

8 rows selected.

SQL> select * from hr.supplier2 order by SUPPLIER_ID;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

SQL>

target ggsci

GGSCI (srv7.example.com) 20> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    ABENDED     REPINT      00:00:00      00:04:09


GGSCI (srv7.example.com) 21>

Target ggserr.log 

2021-12-02T19:17:27.835+0530  INFO    OGG-04048  Oracle GoldenGate Delivery for Oracle, repint.prm:  Processed graceful restart record at seq 4 rba 2,415.
2021-12-02T19:28:54.740+0530  INFO    OGG-06505  Oracle GoldenGate Delivery for Oracle, repint.prm:  MAP resolved (entry sgg1.hr.supplier): MAP "SGG1"."HR"."SUPPLIER", TARGET tgg1.hr.supplier.
2021-12-02T19:28:57.383+0530  INFO    OGG-02756  Oracle GoldenGate Delivery for Oracle, repint.prm:  The definition for table SGG1.HR.SUPPLIER is obtained from the trail file.
2021-12-02T19:28:57.383+0530  INFO    OGG-06511  Oracle GoldenGate Delivery for Oracle, repint.prm:  Using following columns in default map by name: SUPPLIER_ID, SUPPLIER_NAME, CONTACT_NAME.
2021-12-02T19:28:57.383+0530  INFO    OGG-06510  Oracle GoldenGate Delivery for Oracle, repint.prm:  Using the following key columns for target table TGG1.HR.SUPPLIER: SUPPLIER_ID.
2021-12-02T19:28:57.533+0530  INFO    OGG-06505  Oracle GoldenGate Delivery for Oracle, repint.prm:  MAP resolved (entry sgg1.hr.supplier): MAP "SGG1"."HR"."SUPPLIER", TARGET tgg1.hr.supplier2.
2021-12-02T19:28:58.833+0530  INFO    OGG-06511  Oracle GoldenGate Delivery for Oracle, repint.prm:  Using following columns in default map by name: SUPPLIER_ID, SUPPLIER_NAME, CONTACT_NAME.
2021-12-02T19:28:58.833+0530  INFO    OGG-06510  Oracle GoldenGate Delivery for Oracle, repint.prm:  Using the following key columns for target table TGG1.HR.SUPPLIER2: SUPPLIER_ID.
2021-12-02T19:29:01.261+0530  WARNING OGG-02544  Oracle GoldenGate Delivery for Oracle, repint.prm:  Unhandled error (ORA-26799: unique constraint HR.SUPPLIER_PK violated for table HR.SUPPLIER with column values ("SUPPLIER_ID") = (1)
                              ORA-00001: unique constraint (HR.SUPPLIER_PK) violated
                              ORA-00001: unique constraint (HR.SUPPLIER_PK) violated) while processing the record at SEQNO 4, RBA 2673 in Integrated mode. REPLICAT will retry in Direct mode.
2021-12-02T19:29:01.335+0530  WARNING OGG-01004  Oracle GoldenGate Delivery for Oracle, repint.prm:  Aborted grouped transaction on TGG1.HR.SUPPLIER, Database error 1 (OCI Error ORA-00001: unique constraint (HR.SUPPLIER_PK) violated (status = 1), SQL <INSERT INTO "HR"."SUPPLIER" ("SUPPLIER_ID","SUPPLIER_NAME","CONTACT_NAME") VALUES (:a0,:a1,:a2)>).
2021-12-02T19:29:01.335+0530  WARNING OGG-01003  Oracle GoldenGate Delivery for Oracle, repint.prm:  Repositioning to rba 2673 in seqno 4.
2021-12-02T19:29:01.335+0530  WARNING OGG-01154  Oracle GoldenGate Delivery for Oracle, repint.prm:  SQL error 1 mapping SGG1.HR.SUPPLIER to TGG1.HR.SUPPLIER OCI Error ORA-00001: unique constraint (HR.SUPPLIER_PK) violated (status = 1), SQL <INSERT INTO "HR"."SUPPLIER" ("SUPPLIER_ID","SUPPLIER_NAME","CONTACT_NAME") VALUES (:a0,:a1,:a2)>.
2021-12-02T19:29:01.335+0530  ERROR   OGG-01296  Oracle GoldenGate Delivery for Oracle, repint.prm:  Error mapping from SGG1.HR.SUPPLIER to TGG1.HR.SUPPLIER.
2021-12-02T19:29:06.597+0530  INFO    OGG-02333  Oracle GoldenGate Delivery for Oracle, repint.prm:  Reading /u01/app/oracle/product/targetgg1/dirdat/rt000000004, current RBA 2,673, 6 records, m_file_seqno = 4, m_file_rba = 2,835.
2021-12-02T19:29:06.649+0530  ERROR   OGG-01668  Oracle GoldenGate Delivery for Oracle, repint.prm:  PROCESS ABENDING.
2021-12-02T19:32:55.012+0530  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): info all.

GGSCI (srv7.example.com) 22> view report REPINT

2021-12-02 19:28:58  INFO    OGG-06510  Using the following key columns for target table TGG1.HR.SUPPLIER2: SUPPLIER_ID.


2021-12-02 19:29:01  WARNING OGG-02544  Unhandled error (ORA-26799: unique constraint HR.SUPPLIER_PK violated for table HR.SUPPLIER with column values ("SUPPLIER_ID") = (1)
ORA-00001: unique constraint (HR.SUPPLIER_PK) violated
ORA-00001: unique constraint (HR.SUPPLIER_PK) violated) while processing the record at SEQNO 4, RBA 2673 in Integrated mode. REPLICAT will retry in Direct mode.

2021-12-02 19:29:01  WARNING OGG-01004  Aborted grouped transaction on TGG1.HR.SUPPLIER, Database error 1 (OCI Error ORA-00001: unique constraint (HR.SUPPLIER_PK) violated (status = 1), SQL <INSERT INTO "HR"."SUPPLIER" ("SUPPLIER_ID","SU
PPLIER_NAME","CONTACT_NAME") VALUES (:a0,:a1,:a2)>).

GGSCI (srv7.example.com) 23> edit param REPINT

REPLICAT repint
USERID c##ggtarget@TGG1,PASSWORD ggtarget
DBOPTIONS INTEGRATEDPARAMS(parallelism 4)
ASSUMETARGETDEFS
HANDLECOLLISIONS
MAP sgg1.hr.supplier, TARGET tgg1.hr.supplier;
MAP sgg1.hr.supplier, TARGET tgg1.hr.supplier2;

:wq!


GGSCI (srv7.example.com) 25> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     REPINT      00:00:00      00:00:08


GGSCI (srv7.example.com) 26>


GGSCI (srv7.example.com) 26> view report repint


2021-12-02 19:39:20  INFO    OGG-06604  Database TGG1 CPU info: CPU Count 1, CPU Core Count 1, CPU Socket Count 1.

2021-12-02 19:39:20  WARNING OGG-05673  CSN-based duplicate suppression is disabled because there is no checkpoint table for this Replicat.

2021-12-02 19:39:21  INFO    OGG-02545  Parameter GROUPTRANSOPS is ignored by Integrated Replicat when parallelism is greater than 1.

2021-12-02 19:39:21  INFO    OGG-02527  Integrated Replicat does not populate a trace table.

2021-12-02 19:39:21  INFO    OGG-06627  Replicat sets the key columns for each table replicated by inbound server OGG$REPINT.

2021-12-02 19:39:22  INFO    OGG-02530  Integrated replicat successfully attached to inbound server OGG$REPINT.

Target database table  after update collisions parameter 

SQL> select * from hr.supplier order by SUPPLIER_ID;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          1 ABCD11                                             ABCD11
          2 ABCD2                                              ABCD2
          3 ABCD3                                              ABCD3
          4 ABCD4                                              ABCD4
          5 ABCD5                                              ABCD5
          6 ABCD6                                              ABCD6
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

8 rows selected.

SQL> select * from hr.supplier2 order by SUPPLIER_ID;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          1 ABCD11                                             ABCD11
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

SQL>



GGSCI (srv7.example.com) 27> stats repint

Sending STATS request to REPLICAT REPINT ...

Start of Statistics at 2021-12-02 19:43:14.


Integrated Replicat Statistics:

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

Replicating from SGG1.HR.SUPPLIER to TGG1.HR.SUPPLIER:

*** Total statistics since 2021-12-02 19:39:22 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total insert collisions                            1.00

*** Daily statistics since 2021-12-02 19:39:22 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total insert collisions                            1.00

*** Hourly statistics since 2021-12-02 19:39:22 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total insert collisions                            1.00

*** Latest statistics since 2021-12-02 19:39:22 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total insert collisions                            1.00

Replicating from SGG1.HR.SUPPLIER to TGG1.HR.SUPPLIER2:

*** Total statistics since 2021-12-02 19:39:22 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Daily statistics since 2021-12-02 19:39:22 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Hourly statistics since 2021-12-02 19:39:22 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Latest statistics since 2021-12-02 19:39:22 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

End of Statistics.


GGSCI (srv7.example.com) 28>






ggsci: handle update collision on target database 19c

ggsci:  handle update collision on target database  19c 

source database : sourcegg1

Target database : targetgg1

Source GG Hostname : srv6.example.com

Target GG Hostname : srv7.example.com


Scenario

  • We disable update collision from replication process and delete object id  from target database table
  • updating the same object id on source database table and we will find  error on target replicat as unable to map object id with target table.
  • Adding updating collision on target database and now it will insert and update object data on target table. 

Target Database  


SQL> alter session set container=TGG1;


Session altered.


SQL> sho pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

         3 TGG1                           READ WRITE NO



  • Delete object values on target database for example  so while updating values of same id we will get error.


SQL> delete from hr.supplier where SUPPLIER_ID=1;


1 row deleted.


SQL> delete from hr.supplier2 where SUPPLIER_ID=1;


1 row deleted.


SQL> commit;


Commit complete.

  • Stop Replication process from target GG and disable to handle collisions 

GGSCI (srv7.example.com) 28> stop repint

Sending STOP request to REPLICAT REPINT ...
Request processed.


GGSCI (srv7.example.com) 29> edit param repint



REPLICAT repint
USERID c##ggtarget@TGG1,PASSWORD ggtarget
DBOPTIONS INTEGRATEDPARAMS(parallelism 4)
ASSUMETARGETDEFS
--HANDLECOLLISIONS
MAP sgg1.hr.supplier, TARGET tgg1.hr.supplier;
MAP sgg1.hr.supplier, TARGET tgg1.hr.supplier2;


GGSCI (srv7.example.com) 30> start repint

Sending START request to MANAGER ...
REPLICAT REPINT starting




GGSCI (srv7.example.com) 32> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     REPINT      00:00:00      00:00:06


GGSCI (srv7.example.com) 33>


  • Update the value on source database  which was deleted by target database above steps 


SQL> sho pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 SGG1                           READ WRITE NO
SQL>


SQL> update hr.supplier set SUPPLIER_NAME='ABCD1111' where SUPPLIER_ID=1;

1 row updated.

SQL> commit;

Commit complete.


SQL> select * from hr.supplier order by SUPPLIER_ID;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          1 ABCD1111                                           ABCD11
          2 ABCD2                                              ABCD2
          3 ABCD3                                              ABCD3
          4 ABCD4                                              ABCD4
          5 ABCD5                                              ABCD5
          6 ABCD6                                              ABCD6
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

8 rows selected.

SQL>

  • View Target GG  replication process, repint is replication process name.
GGSCI (srv7.example.com) 33> view report repint

2021-12-02 19:56:43  INFO    OGG-06604  Database TGG1 CPU info: CPU Count 1, CPU Core Count 1, CPU Socket Count 1.

2021-12-02 19:56:43  WARNING OGG-05673  CSN-based duplicate suppression is disabled because there is no checkpoint table for this Replicat.

2021-12-02 19:56:44  INFO    OGG-02545  Parameter GROUPTRANSOPS is ignored by Integrated Replicat when parallelism is greater than 1.

2021-12-02 19:56:44  INFO    OGG-02527  Integrated Replicat does not populate a trace table.

2021-12-02 19:56:44  INFO    OGG-06627  Replicat sets the key columns for each table replicated by inbound server OGG$REPINT.

2021-12-02 19:56:45  INFO    OGG-02530  Integrated replicat successfully attached to inbound server OGG$REPINT.


2021-12-02 19:58:48  WARNING OGG-02544  Unhandled error (ORA-26787: The row with key ("SUPPLIER_ID") = (1) does not exist in table HR.SUPPLIER
ORA-01403: no data found) while processing the record at SEQNO 4, RBA 2835 in Integrated mode. REPLICAT will retry in Direct mode.

2021-12-02 19:58:48  WARNING OGG-01004  Aborted grouped transaction on TGG1.HR.SUPPLIER, Database error 1403 (No data found).

2021-12-02 19:58:48  WARNING OGG-01003  Repositioning to rba 2835 in seqno 4.

2021-12-02 19:58:48  WARNING OGG-01154  SQL error 1403 mapping SGG1.HR.SUPPLIER to TGG1.HR.SUPPLIER No data found.


  • We can view there is No Change in target database object as it will throuh error on taget GG log above as well.

SQL> select * from hr.supplier order by SUPPLIER_ID;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          2 ABCD2                                              ABCD2
          3 ABCD3                                              ABCD3
          4 ABCD4                                              ABCD4
          5 ABCD5                                              ABCD5
          6 ABCD6                                              ABCD6
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

7 rows selected.

SQL> select * from hr.supplier2 order by SUPPLIER_ID;

SUPPLIER_ID SUPPLIER_NAME                                      CONTACT_NAME
----------- -------------------------------------------------- --------------------------------------------------
          7 ABCD7                                              ABCD7
          8 ABCD8                                              ABCD8

SQL>



GGSCI (srv7.example.com) 35> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    ABENDED     REPINT      00:00:00      00:07:32


  • Add HANDLECOLLISIONS  process on repint process of target GG 

GGSCI (srv7.example.com) 36> edit param repint



GGSCI (srv7.example.com) 37> view param repint

REPLICAT repint
USERID c##ggtarget@TGG1,PASSWORD ggtarget
DBOPTIONS INTEGRATEDPARAMS(parallelism 4)
ASSUMETARGETDEFS
HANDLECOLLISIONS
MAP sgg1.hr.supplier, TARGET tgg1.hr.supplier;
MAP sgg1.hr.supplier, TARGET tgg1.hr.supplier2;



GGSCI (srv7.example.com) 38>



GGSCI (srv7.example.com) 38> start repint

Sending START request to MANAGER ...
REPLICAT REPINT starting


GGSCI (srv7.example.com) 39> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     REPINT      07:26:04      00:00:02


GGSCI (srv7.example.com) 40> stats repint

Sending STATS request to REPLICAT REPINT ...

Start of Statistics at 2021-12-02 20:08:13.


Integrated Replicat Statistics:

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

Replicating from SGG1.HR.SUPPLIER to TGG1.HR.SUPPLIER:

*** Total statistics since 2021-12-02 20:07:26 ***
        Total inserts                                      0.00
        Total updates                                      1.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total update collisions                            1.00

*** Daily statistics since 2021-12-02 20:07:26 ***
        Total inserts                                      0.00
        Total updates                                      1.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total update collisions                            1.00

*** Hourly statistics since 2021-12-02 20:07:26 ***
        Total inserts                                      0.00
        Total updates                                      1.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total update collisions                            1.00

*** Latest statistics since 2021-12-02 20:07:26 ***
        Total inserts                                      0.00
        Total updates                                      1.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total update collisions                            1.00

Replicating from SGG1.HR.SUPPLIER to TGG1.HR.SUPPLIER2:

*** Total statistics since 2021-12-02 20:07:26 ***
        Total inserts                                      0.00
        Total updates                                      1.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total update collisions                            1.00

*** Daily statistics since 2021-12-02 20:07:26 ***
        Total inserts                                      0.00
        Total updates                                      1.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total update collisions                            1.00

*** Hourly statistics since 2021-12-02 20:07:26 ***
        Total inserts                                      0.00
        Total updates                                      1.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total update collisions                            1.00

*** Latest statistics since 2021-12-02 20:07:26 ***
        Total inserts                                      0.00
        Total updates                                      1.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00
        Total update collisions                            1.00

End of Statistics.


GGSCI (srv7.example.com) 41>