Replicating the minimal set of columns

Normally, Replication Server sends all the columns in each row when applying updates and deletes, as well as inserts, in each replicate database. Replication Server normally sends maximum columns to the standby database—if replication definitions are not used for the table or the replication definitions are not used for the standby connection.

NoteYou must send all columns when replicating to SQL Remote databases. Do not send minimal columns or replication will fail.

To enhance replication system performance, specify replicate minimal columns in create replication definition. This clause lets you send only those columns that are required for delete and update operations to replicate databases.

When you set replicate minimal columns:

Notereplicate minimal columns does not apply to insert operations, for which all columns are copied.

A destination Replication Server uses the primary key columns in constructing the data server commands that it applies to the replicate or the standby database.

The following replication definition includes replicate minimal columns:

create replication definition publishers
with primary at TOKYO_DS.pubs2
(pub_id char(4), pub_name varchar(40),
city varchar(20), state char(2))
primary key (pub_id)
replicate minimal columns

Changing minimal columns setting

Use alter replication definition to change an existing replication definition to replicate only the minimal set of columns or to replicate all columns.


Minimal columns and rs_update and rs_delete function strings

If you specify replicate minimal columns and need to create non-default rs_update and rs_delete function strings, use the rs_default_fs function string variable to represent the default function string behavior. See “Using the default system variable” on page 53 in the Replication Server Administration Guide Volume 2 for details.


Minimal columns and autocorrection

If you specify replicate minimal columns, you cannot also specify autocorrection, which corrects discrepancies that may occur during materialization by converting each update or insert operation into a delete followed by an insert.

If you set autocorrection on before you specify minimal columns (for example, using alter replication definition), autocorrection is not performed. Replication Server logs informational messages for any update operations.

You must set autocorrection on when you create a subscription using nonatomic materialization. If minimal column replication is set for the replication definition and you create a new subscription that uses nonatomic materialization or the bulk materialization method that simulates nonatomic materialization, autocorrection cannot resolve inconsistencies.

See Chapter 11, “Managing Subscriptions” for details on materialization methods. See “Using autocorrection” for more information on this command.