Table of Contents

Search

  1. Preface
  2. Data Replication Overview
  3. Installing Data Replication
  4. Preparing Source and Target Systems
  5. Replication Basic Concepts
  6. InitialSync Processing
  7. Extractor and Applier Processing
  8. DDL Replication
  9. Recovery and Checkpoint Processing
  10. Configuring the Server Manager
  11. Creating Replication Configurations in the Data Replication Console
  12. Managing Replication Configurations
  13. Running Data Replications
  14. Configuring Selected Replication Types
  15. Monitoring Data Replication
  16. Maintaining the Replication Environment
  17. Troubleshooting
  18. Data Replication Files and Subdirectories
  19. Data Replication Runtime Parameters
  20. InitialSync, Extractor, and Applier Command Line Parameters
  21. Server Manager Command Line Parameters
  22. Updating Configurations in the Replication Configuration CLI
  23. DDL Statements for Manually Creating Recovery Tables
  24. Sample Scripts for Enabling or Disabling SQL Server Change Data Capture
  25. Glossary

Conflict Resolution for Replicated Data

Conflict Resolution for Replicated Data

Data Replication provides a conflict resolution mechanism to handle conflicts that might occur when you replicate change data to a database on which other change activity occurs.
If you use the bidirectional replication topology or a replication topology with multiple sources and a single target, you must configure conflict resolution for accurate replication of data. Data Replication supports conflict resolution only in SQL Apply mode.
In the Data Replication Console, define conflict resolution rules for target tables. The Applier uses these rules to resolve mismatches between source and target values.
Data Replication supports conflict resolution for the following target types:
  • DB2 for Linux, UNIX, and Windows
  • Microsoft SQL Server
  • Oracle
  • Sybase ASE
The following table describes the types of conflicts that Data Replication handles:
Conflict Type
Description
Delete
Occurs when a row that is referenced in a Delete statement does not exist in the target table.
Uniqueness
Occurs when the Applier applies change data that violates a uniqueness integrity constraint such as primary key or unique index.
Update
Occurs when the row referenced in an UPDATE statement has different values on the source and target. When you configure a replication job, you must select the columns for which Data Replication compares source and target values.
For these columns, the Data Replication Console enables supplemental logging so that the Applier can get the before and after values to compare the source and target rows.
Depending on the conflict type, you can select different conflict resolution strategies.
The following table describes the conflict resolution strategies that are available by conflict type:
Conflict Resolution Strategy
Conflict Types
Description
Custom
All
Calls a stored procedure that you previously defined to handle conflicts. You can define a stored procedure by using commands that the SQL Script Engine provides. When an SQL operation on the target table causes conflict, the Applier calls the stored procedure and passes operation metadata and the before and after values for all of the columns for which supplemental logging is enabled as procedure parameters.
These parameters are:
  • OP_XID.
    Transaction ID.
  • OP_CODE.
    A code for the operation type, which can be D for deletes, I for inserts, and U for updates.
  • OP_TIME.
    The date and time of the operation.
  • OP_CMT_SCN.
    The SCN value for the operation commit.
  • OP_CMT_TIME.
    The commit time for the operation.
  • OP_NUM_IN_TX.
    The sequence number of the operation in the transaction.
  • column_name
    _OLD,
    column_name
    _NEW.
    The before and after values for the column <
    column_name
    >. These parameters repeat for each column for which you enabled additional logging.
For more information about the SQL Script Engine commands, see the
Informatica Data Replication Scripting Guide
.
Discard
All
Discards the source values and retains the existing values in the target table.
Maximum, Minimum
Update
For these resolution strategies, you must select a resolution column. For conflicting rows, Data Replication compares source and target values in the resolution column.
  • For the Maximum strategy, if the target value is greater than the source value, Data Replication uses the Discard strategy. Otherwise, Data Replication uses the Overwrite strategy.
  • For the Minimum strategy, if the target value is less than the source value, Data Replication uses the Discard strategy. Otherwise, Data Replication uses the Overwrite strategy.
Overwrite
  • Update
  • Uniqueness
Overwrites records in the target table with the values from the source table.
  • If you configure a resolution strategy for Update conflicts and an Update occurs for the virtual index column on the source and target independently at the same time, Data Replication detects a conflict, even if the virtual index column is not in the set of columns for which Data Replication compares source and target values.
    For example, if you have a table with a primary key definition that Data Replication uses as a virtual index, Data Replication detects a conflict when an Update is written to the primary key column on the source and target simultaneously.
  • When an Update conflict occurs for the virtual index column, the Applier can only use the Custom resolution strategy to resolve the conflict. The Applier skips other resolution strategies because it cannot identify a row on the target for which to resolve the conflict.
    For example, if you have a table without a primary key definition and use a virtual index that includes all of the table columns, you can use only the Custom resolution strategy for Update conflicts.
  • If a database does not support additional logging for a column datatype, Data Replication cannot detect Update conflicts for the column. Data Replication also cannot use the before and after values as custom procedure parameters for the column.
  • Data Replication does not support conflict resolution for LOB columns. Do not use LOB columns to detect Update conflicts. Also, do not use LOBs as resolution columns when using the Minimum or Maximum resolution strategy.
  • The Applier does not lock a target row to apply a conflict resolution rule. You might get unexpected data on the target if changes for the row in conflict occur during the interval between Applier detection of the conflict and application of the conflict resolution rule.

0 COMMENTS

We’d like to hear from you!