Oracle Goldengate Extract and Replicat within same DB from one schema to another plus some issues and fixes
This is a quick guide for GoldenGate replication within the same database from one schema to another.
Dblogin and add checkpoint table
GGSCI > dblogin userid ggs_owner, password ggs_owner GGSCI > add checkpointtable ggg.chk
extract parameter file: es1.prm
GGSCI > edit param es1
vi mode
EXTRACT es1
SETENV (ORACLE_SID=orcl)
SETENV (ORACLE_HOME="/a01/app/oracle/product/11.2.0/dbhome_1")
userid ggg, password ggg
EXTTRAIL /gg_01/app/goldengate/product/12.1.0/dirdat/ea
WILDCARDRESOLVE DYNAMIC
EOFDELAY 5
TABLE S1.T1;
TABLE S2.T2;
replicat parameter file: rs1.prm
GGSCI > edit param rs1
vi mode
REPLICAT rs1
ASSUMETARGETDEFS
SETENV (ORACLE_SID=orcl)
SETENV (ORACLE_HOME="/a01/app/oracle/product/11.2.0/dbhome_1")
REPERROR (-1, IGNORE)
REPERROR (1403, IGNORE)
userid ggg, password ggg
dboptions nosuppresstriggers
HANDLECOLLISIONS
MAP S1.T1, TARGET S2.T1;
MAP S1.T2, TARGET S2.T2;
Configure extract process:
GGSCI > ADD EXTRACT ES1, TRANLOG, BEGIN NOW
GGSCI > ADD EXTTRAIL /gg_01/app/goldengate/product/12.1.0/dirdat/ea, extract eS1
GGSCI > START ES1
Configure replicate process:
GGSCI > ADD REPLICAT RS1, EXTTRAIL /gg_01/app/goldengate/product/12.1.0/dirdat/ea, CHECKPOINTTABLE ggg.chk GGSCI > START REPLICAT
Done! (ok this is how it supposed to be done and when everything works with no issue.)
There was an issue which caused my replicat process to fail, it took me a little while as I didn't expect this to happen.
In the midst of configuring the Golden Gate replication process, one of our developers changed the definition of the source table, the initial error indicated some sort of bad record, so I alter the replicat process to skip bad records, which continued to fail.
I finally tried using log dump to find more information, until I see an error with column mapping, which finally ran a bell for me to check for the source and target table definitions. Once I dropped and recreated the target table, everything was good from there.
Comments
Post a Comment