Replicating Indexes and Constraints

If the source data has indexes or constraints (primary key or reference constraints), you can choose whether to replicate those to the destination.

SQDR Plus optionFor a subscription that performs incremental updates there must be a field that uniquely identifies change data. This can be indexes or primary keys and, if the host database is Db2 for i or Oracle, a Relative Record Number (RRN) index that SQDR Plus adds to the staging tables. The indexes are created only when the baseline replication occurs. If the indexes change at the source the baseline must be re-synchronized. If the subscription is for a Db2 for i or Oracle source table you can replicate the RRN or ROWID to help ensure there is a unique field that identifies change data. Using the RRN can help overcome problems caused when a unique field on the source is no longer unique on the target due to differences in how different database systems support data types, such as timestamp.

The Indexes tab of the subscription properties lists any primary or foreign keys or constraints that are placed on the source data. Click Refresh if you need to re-display all the constraints and indexes that exist for the source object. If you are creating or editing a subscription that performs snapshot replication, click the checkbox in the Replicate column next to the constraints or indexes you want to replicate to the destination. If you are creating or editing a subscription that performs incremental replication you must replicate at least one column that uniquely identifies the change data.

Important Information

If the subscription replicates constraints, be sure that the column(s) that serve as the key columns for primary key(s) or unique indexes are included in the Columns properties. If you remove a key column from the destination image but choose to replicate a primary key that uses the column, running the subscription will generate an error when it attempts to create the primary key.

If the indexes or constraints for the source data change, click the Refresh button on the Indexes tab of the subscription properties to refresh the list of indexes and constraints and modify the subscription accordingly. For example, if you change the source table for a subscription, refresh the indexes and constraints and rebuild the columns list to ensure the subscription replicates the correct data.

Note that changing the group property options Replicate All Indexes or Replicate All Constraints also changes the selections on the subscription's Indexes tab. Whichever selections are made last to the indexes properties are the choices that will be in effect when baseline replication of the subscription is run, individually or as a member of a group. You cannot disable the option for replicating constraints for a group of incremental subscriptions.