Enabling Bi-Directional Loop Detection
Loop detection is a requirement for bi-directional implementations of Oracle GoldenGate, so that an Extract for one source database does not recapture transactions sent by a Replicat from another source database.
With the CDC Extract capture method, by default, any transaction committed by a Replicat into a database where an Extract is configured, will recapture that transaction from the Replicat as long as supplemental logging is enabled for those tables that the Replicat is delivering to.
In order to ignore recapturing transactions that are applied by a Replicat, you must
use the TRANLOGOPTIONS FILTERTABLE parameter for the CDC Extract. The
table used as the filtering table will be the Oracle GoldenGate checkpoint table that
you must create for the Replicat.
To create a Filter Table and enable Supplemental Logging:
The steps below require a database user who is a member of the SQL Server System Administrators (sysadmin) role.
-
On the source system, run
GGSCI -
Issue the following command to log into the database.
DBLOGIN SOURCEDB DSN [,{USERID user, PASSWORD password | USERIDALIAS alias}]In the preceding example, the
SOURCEDB DSNis the name of the SQL Server data source. TheUSERIDuser is the database login andPASSWORDpassword is the password that is required if the data source connects through SQL Server authentication. Alternatively,USERIDALIASalias is the alias for the credentials if they are stored in a credentials store. If usingDBLOGINwith a DSN that is using Integrated Windows authentication, the connection to the database for the GGSCI session is that of the user running GGSCI. In order to issueADD TRANDATAorDELETE TRANDATA, this user must be a member of the SQL Serversysadminserver role. -
Create the Oracle GoldenGate checkpoint table that is used by the Replicat to deliver data to the source database.
Example:
ADD CHECKPOINTTABLE ogg.ggchkptIt is recommended that you use the same schema name as used in the
GGSCHEMAparameter of theGLOBALSfile. -
Enable supplemental logging for the newly created checkpoint table.
Example:
ADD TRANDATA ogg.ggchkpt -
Add the Replicat with the checkpoint table information.
Example:
ADD REPLICAT reptgt1, EXTTRAIL ./dirdat/e2,checkpointtable ogg.ggchkpt -
Configure the Extract with the
IGNOREREPLICATES(on by default) andFILTERTABLEparameters, using the Replicat’s checkpoint table for the filtering table.TRANLOGOPTIONS IGNOREREPLICATESTRANLOGOPTIONS FILTERTABLE ogg.ggchkpt