Triggers on target tables of any replication deserve special consideration, and Dbvisit Replicate is no exception. The concern is whether triggers defined on the target tables should fire when data changes are applied to the table. This depends on the logic in the trigger and thus has to be decided by the user.
In general, triggers carried over from source database are not intended to fire, but triggers created on apply should fire. But other criteria can be considered as well, e.g. whether other tables referenced in the trigger are replicated or not.
Dbvisit Replicate support
For Oracle 10.2.0.5 and 11.2.0.2 and later:
- Dbvisit Replicate honors setting of dbms_ddl.set_trigger_firing_property According to Oracle documentation, the default is TRUE, i.e. fire only once. – use this procedure for each trigger to set whether it should fire when data change is done by replication.
On every Oracle target, you can check boolean variable DBRSAPPLY_PKG.is_dbreplicate_session to determine whether it's an apply session or not. Using this variable, the trigger can check whether to actually do something or not. This will require code changes in the triggers to enable this.
On every MySQL target, you can check variable @is_dbreplicate_session (valued 0/1) to find out whether it's an apply session or not.
On every MS SQL target, you can check context_info to find out whether it's an apply session (set to 1) or not.
Variable APPLY_SET_TRIGGER_FIRE_ONCE can be used to disable or further control this functionality.