Table of Contents

Search

  1. Preface
  2. Data Replication Overview
  3. Understanding Data Replication
  4. Sources - Preparation and Replication Considerations
  5. Targets - Preparation and Replication Considerations
  6. Starting the Server Manager
  7. Getting Started with the Data Replication Console
  8. Defining and Managing Server Manager Main Servers and Subservers
  9. Creating and Managing User Accounts
  10. Creating and Managing Connections
  11. Creating Replication Configurations
  12. Materializing Targets with InitialSync
  13. Scheduling and Running Replication Tasks
  14. Implementing Advanced Replication Topologies
  15. Monitoring Data Replication
  16. Managing Replication Configurations
  17. Handling Replication Environment Changes and Failures
  18. Troubleshooting
  19. Data Replication Files and Subdirectories
  20. Data Replication Runtime Parameters
  21. Command Line Parameters for Data Replication Components
  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
The following table describes the types of conflicts that Data Replication handles:
Conflict Type
Description
Delete
Occurs when a row that is referenced in an SQL Delete operation 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 that is referenced in an SQL Update operation 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-image and after-image 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 an Update conflict resolution rule and independent Update operations occur on a virtual index column on the source and target at the same time, Data Replication detects the conflict, even if the virtual index column is not specified in the conflict resolution rule.
    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 a virtual index column, the Applier can use only 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!