cdr change replicate

The cdr change replicate command modifies an existing replicate by adding or deleting one or more participants.

Syntax


1  cdr change replicate?  %Connect Option  (1)
1   --add replicate +  participant modifier
1   --delete replicate +  participant
1  --verify
1?   --autocreate
3?   --erkey
Notes:
Element Purpose Restrictions Syntax
modifier Specifies the rows and columns to replicate. Participant and participant modifier
participant Specifies the database server and table for replication. The participant must exist. Participant and participant modifier
replicate Name of the replicate to change. The replicate must exist. Long Identifiers

The following table describes the options to cdr change replicate.

Long Form Short Form Meaning
--add -a Adds participants to a replicate.
--autocreate -u For use with master replicates only. Specifies that if the tables in the master replicate definition do not exist in the databases on the target servers, then they are created automatically. However, the table cannot contain columns with user-defined data types. The tables are created in the same dbspace as the database.
Note: Tables that are created with the --autocreate option do not automatically include non-replication key indexes, defaults, constraints (including foreign constraints), triggers, or permissions. If the tables you create with the --autocreate option require the use of these objects you must explicitly create the objects by hand.
--delete -d Removes participants from a replicate.
--erkey -K Includes the ERKEY shadow columns, ifx_erkey_1, ifx_erkey_2, and ifx_erkey_3, in the replicate definition, if the table being replicated has the ERKEY shadow columns. The ERKEY shadow columns are used as the replication key.
--verify -v For use with master replicates only. Specifies that the cdr change template command verifies the database, tables, and column data types against the master replicate definition on all listed servers

Usage

Use this command to add or delete a participant from a replicate. You can define a replicate that has zero or one participants, but to be useful, a replicate must have at least two participants. You cannot start and stop replicates that have no participants. All participants for the replicate must be online and the cdr utility must be able to connect to each participant.

Important: Enterprise Replication adds the participant to the replicate in an inactive state, regardless of the state of the replicate. To activate the new participant, run cdr start replicate with the name of the server group. See cdr start replicate.

When you run the cdr change replicate command, an event alarm with a class ID of 65 is generated, if that event alarm is enabled.

You can run this command from within an SQL statement by using the SQL administration API.

Example 1: Add two participants

The following example adds two participants to the replicate named repl_1: db1@server1:antonio.table with the modifier select * from table1, and db2@server2:carlo.table2 with the modifier select * from table2:
cdr change repl -a repl_1 \
   "db1@server1:antonio.table1" "select * from table1" \
   "db2@server2:carlo.table2" "select * from table2"

Example 2: Remove two participants

The following example removes the same two participants from replicate repl_1:
cdr change repl -d repl_1 \
   "db1@server1:antonio.table1" \
   "db2@server2:carlo.table2"

Example 3: Add a participant that includes ERKEY shadow columns

The following example adds a participant and includes the ERKEY shadow columns from the table table1:

cdr change repl -a repl_1 --erkey\
   "db1@server1:antonio.table1" "select * from table1"