Replication and uniqueness in tables

Replication uses a primary key, unique constraint, or unique index at the target to enforce the uniqueness of each row when it applies the row to target tables.

If replication finds uniqueness in the source table, the Select Objects page of the Add Replication Set window displays a Y (yes) in the Viable Key For Apply field. If no primary key, unique constraint, or unique index is found, the console displays an N (no) in this field.

A unique constraint is strongly advised for replication performance and to guarantee correctness. Replication conflicts cannot be detected if data values are not unique for the replication key.

Column-organized tables must have a unique constraint that uniquely identifies each row. You can also add a hidden identity column to provide uniqueness. Because values are uniquely generated by Db2® for each row, you are guaranteed uniqueness.

If you select one or more tables without unique constraints and click Proceed, a warning message displays. You can use the console to add a primary key, unique constraint, or unique index to the table by clicking Cancel in the warning message and then clicking Console > Administer > Tables > Alter. After you are finished, you can resume creating the replication set.

If you click Proceed, replication creates its own key that includes all columns in the table except for XML, LOB, and LONG columns. However, this type of key can slow replication performance.