Latest Timestamp Conflict Detection and Resolution

When you run the ADD_AUTO_CDR procedure in the DBMS_GOLDENGATE_ADM package to configure a table for automatic Oracle GoldenGate conflict detection and resolution, a hidden timestamp column is added to the table. This hidden timestamp column records the time of a row change, and this information is used to detect and resolve conflicts.

When a row LCR is applied, a conflict can occur for an INSERT, UPDATE, or DELETE operation. The following table describes each type of conflict and how it is resolved.

Operation Conflict Detection Conflict Resolution

INSERT

A conflict is detected when the table has the same value for a key column as the new value in the row LCR.

If the timestamp of the row LCR is later than the timestamp in the table row, then the values in the row LCR replace the values in the table.

If the timestamp of the row LCR is earlier than the timestamp in the table row, then the row LCR is discarded, and the table values are retained.

UPDATE

A conflict is detected in each of the following cases:

  • There is a mismatch between the timestamp value in the row LCR and the timestamp value of the corresponding row in the table.

  • There is a mismatch between an old value in a column group in the row LCR does not match the column value in the corresponding table row. A column group is a logical grouping of one or more columns in a replicated table.

  • The table row does not exist. If the row is in the tombstone table, then this is referred to as an update-delete conflict.

If there is a value mismatch and the timestamp of the row LCR is later than the timestamp in the table row, then the values in the row LCR replace the values in the table.

If there is a value mismatch and the timestamp of the row LCR is earlier than the timestamp in the table row, then the row LCR is discarded, and the table values are retained.

If the table row does not exist and the timestamp of the row LCR is later than the timestamp in the tombstone table row, then the row LCR is converted from an UPDATE operation to an INSERT operation and inserted into the table.

If the table row does not exist and the timestamp of the row LCR is earlier than the timestamp in the tombstone table row, then the row LCR is discarded.

If the table row does not exist and there is no corresponding row in the tombstone table, then the row LCR is converted from an UPDATE operation to an INSERT operation and inserted into the table.

DELETE

A conflict is detected in each of the following cases:

  • There is a mismatch between the timestamp value in the row LCR and the timestamp value of the corresponding row in the table.

  • The table row does not exist.

If the timestamp of the row LCR is later than the timestamp in the table, then delete the row from the table.

If the timestamp of the row LCR is earlier than the timestamp in the table, then the row LCR is discarded, and the table values are retained.

If the delete is successful, then log the row LCR by inserting it into the tombstone table.

If the table row does not exist, then log the row LCR by inserting it into the tombstone table.