Disabling Triggers and Cascade Constraints on the Target
In an environment where SQL Server is the target, consider triggers and cascade constraints that may repeat an operation that occurred on the source. For example, if the source has an insert trigger on TableA that inserts a record into TableB, and Oracle GoldenGate is configured to capture and deliver both TableA and TableB, the insert trigger on the target table, TableA, must be disabled. Otherwise, Replicat inserts into TableA, and the trigger fires and insert into TableB. Replicat will then try to insert into TableB, and then terminate abnormally.
-
You use the
DBOPTIONS USEREPLICATIONUSER
parameter in Replicat. -
You use OLE DB connection for Replicat. The use of the OLE DB connection is the default configuration. Note that the trigger, constraint, or
IDENTITY
property must haveNOT FOR REPLICATION
enabled.
In the following scenario, disable the triggers and constraints on the target:
-
Uni-directional replication where all tables on the source are replicated.
In the following scenarios, enable the triggers and constraints on the target:
-
Uni-directional replication where tables affected by a trigger or cascade operation are not replicated, and the only application that loads these tables is using a trigger or cascade operation.
-
Uni-directional or -bi-directional replication where all tables on the source are replicated. In this scenario, set the target table cascade constraints and triggers to enable
NOT FOR REPLICATION
, and use theDBOPTIONS USEREPLICATIONUSER
parameter in Replicat.