Use command conversion to alter the replication of certain commands either for all or
for selected replicated tables.
Use command conversion to:
- Eliminate the replication of certain commands. Although you can specify that a
certain command is not to be replicated, the rest of the commands in the
transaction continue to replicate.
- Allow Replication Server to perform autocorrection without specifying
tables
- Avoid duplicate key errors while allowing autosynchronization of databases
during replication.
Use dsi_command_convert to specify how to convert a replicate
command.
A combination of these operations specifies the type of conversion:
-
d – delete
-
i – insert
-
u – update
-
t – truncate
-
none – no operation
The combinations of operations for
dsi_command_convert are:
- d2none – do not
replicate the delete command. With this option, you need not
customize the rs_delete function string if you do not want to
replicate delete operations.
- i2none – do not replicate the insert
command
- u2none – do not replicate the update
command
- i2di,u2di – convert both
insert and update to
delete followed by insert, which is
equivalent to an autocorrection. If you disable row count validation by setting
dsi_row_count _validation off, set
dsi_command_convert to i2di,u2di to
avoid duplicate key errors and allow autosynchronization of databases during
replication.
- t2none – do not
replicate truncate table command.
The operation before conversion precedes the "2" and the operations after
conversion are after the "2."
Remember: You must type the number 2.
Use
dsi_command_convert with
alter connection to
specify command conversion for a database connection . For example:
alter connection to SYDNEY_DS.pubs2
set dsi_command_convert to ‘i2di,u2di’
go
The default is
none which means there is no command conversion. Set
dsi_command_convert to
none to remove the
current
dsi_command_convert setting for a connection or a table.
For example, to remove the setting for a database
connection:
alter connection to SYDNEY_DS.pubs2
set dsi_command_convert to ‘none’
go
Use
dsi_command_convert
with
alter connection and the
for replicate table
named clause to specify command conversion for a table. For example, to
prevent the replication of
delete commands for the
authors
table:
alter connection to SYDNEY_DS.pubs2
for replicate table named authors
set dsi_command_convert to ‘d2none’
go
Note: The
setting at the table level overrides the setting at the database level except when
you specify none at the table level. Then Replication Server uses
the setting at the database level.