0% found this document useful (0 votes)
13 views2 pages

Golden Gate

The document outlines conflict detection and resolution strategies for database replication using GoldenGate, detailing various conflict types such as UPDATEROWEXISTS and DELETEROWMISSING, along with their respective resolutions. It emphasizes the use of COMPARECOLS and GETBEFORECOLS for capturing before images of updates and deletes, and provides commands for setting up primary and data pump extracts. The document serves as a guide for configuring replication parameters and managing conflicts effectively.

Uploaded by

vignesh.dw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Golden Gate

The document outlines conflict detection and resolution strategies for database replication using GoldenGate, detailing various conflict types such as UPDATEROWEXISTS and DELETEROWMISSING, along with their respective resolutions. It emphasizes the use of COMPARECOLS and GETBEFORECOLS for capturing before images of updates and deletes, and provides commands for setting up primary and data pump extracts. The document serves as a guide for configuring replication parameters and managing conflicts effectively.

Uploaded by

vignesh.dw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

MAP fin.src, TARGET fin.

tgt, &
COMPARECOLS (ON UPDATE ALL, ON DELETE ALL), &
RESOLVECONFLICT (UPDATEROWEXISTS, (DEFAULT, USEMAX (last_mod_time)), & --->
compare database and trail record. If db higher ignore the record. If trail higher
update.
RESOLVECONFLICT (INSERTROWEXISTS, (DEFAULT, USEMAX (last_mod_time)), & --->
from Insert to Update
RESOLVECONFLICT (DELETEROWEXISTS, (DEFAULT, OVERWRITE)), & ---> apply
delete
RESOLVECONFLICT (UPDATEROWMISSING, (DEFAULT, OVERWRITE)), & ---> change
it to insert
RESOLVECONFLICT (DELETEROWMISSING, (DEFAULT, DISCARD)), & ---> discard
the trail record

STATS REPLICAT group, REPORTCDR

Per COMPARECOLS, use the before image of all columns in the trail record in the
Replicat WHERE clause for updates and deletes.

Per DEFAULT, use all columns as the column group for all conflict types; thus the
resolution applies to all columns.
--------------------------
For an INSERTROWEXISTS conflict, use the USEMAX resolution: If the row exists
during an insert, use the last_mod_time column as the resolution column for
deciding which is the greater value: the value in the trail or the one in the
database. If the value in the trail is greater, apply the record but change the
insert to an update. If the database value is higher, ignore the record.

For an UPDATEROWEXISTS conflict, use the USEMAX resolution: If the row exists
during an update, use the last_mod_time column as the resolution column: If the
value in the trail is greater, apply the update.

For a DELETEROWEXISTS conflict, use the OVERWRITE resolution: If the row exists
during a delete operation, apply the delete.

For an UPDATEROWMISSING conflict, use the OVERWRITE resolution: If the row does not
exist during an update, change the update to an insert and apply it.

For a DELETROWMISSING conflict use the DISCARD resolution: If the row does not
exist during a delete operation, discard the trail record.
--------------------------

USEMAX , OVERWRITE , discard are resolutions....

All columns are used in the WHERE clause because the COMPARECOLS statement is set
to ALL.

GETBEFORECOLS Use the GETBEFORECOLS option of the Extract TABLE parameter to


specify columns for which you want Extract to capture the before image of an update
or delete operation.
COMPARECOLS Use the COMPARECOLS option of the MAP parameter in the Replicat
parameter file to specify columns that are to be used with before values in the
Replicat WHERE clause. The before values are compared with the current values in
the target database to detect update and delete conflicts. (By default, Replicat
only uses the primary key in the WHERE clause; this may not be enough for conflict
detection). COMPARECOLS (ON UPDATE ALL, ON DELETE ALL) means compare all
columns . All columns are used in the WHERE clause because the COMPARECOLS
statement is set to ALL.

COMPARECOLS is in Replicat

GETBEFORECOLS is in extract

https://www.vitalsofttech.com/goldengate-active-active-database-replication-with-
conflict-detection-and-resolution/

a. Add Primary Extract


GGSCI> dblogin userid ggs@srcdb, password oracle
GGSCI> edit params extsrc
extract extsrc
userid ggs@srcdb, password oracle
exttrail /u01/app/ggs/dirdat/es
TRANLOGOPTIONS EXCLUDEUSER GGS
REPORTCOUNT EVERY 10 MINUTES, RATE
GETUPDATEBEFORES
GETTRUNCATES
-- TO GET THE BEFORE IMAGE OF ALL COLUMNS FOR CDR USING GETBEFORCOLS
TABLE SCOTT.ORDERS, GETBEFORECOLS (ON UPDATE ALL, ON DELETE ALL);

(Save and Exit the file)

GGSCI> add extract extsrc, tranlog, begin now


GGSCI> add exttrail /u01/app/ggs/dirdat/es, extract extsrc, megabytes 100
GGSCI> start extsrc
GGSCI> info all

b. Add Data Pump Extract


GGSCI> edit params psrc
extract psrc
PASSTHRU
RMTHOST 192.168.1.30, MGRPORT 7809
RMTTRAIL /u01/app/oracle/gg_euro/dirdat/es
REPORTCOUNT EVERY 10 MINUTES, RATE
TABLE SCOTT.*;

(Save and Exit the file)

GGSCI> add extract psrc, exttrailsource /u01/app/ggs/dirdat/es


GGSCI> add rmttrail /u01/app/ggs/dirdat/es, extract psrc, megabytes 100
GGSCI> start psrc
GGSCI> info all

You might also like