In this example, define the repl2 replicate.
cdr define replicate --conflict=ignore repl2 \ "stores@g_usa:informix.stock" "select * from stock" \ "stores@g_italy:informix.stock" "select * from stock"
These lines are all one command. The backslashes (\) at the end of the lines indicate that the command continues on the next line.
This step specifies that conflicts should be ignored and describes two participants, usa and italy (including the table and the columns to replicate) in the replicate.
Because neither P (primary) nor R (receive-only) is specified, the replicate is defined as update-anywhere. If any data in the selected columns changes, on either participant, that changed data should be sent to the other participants in the replicate.
cdr list replicate
The command returns the following information:
CURRENTLY DEFINED REPLICATES --------------------------------------------------------- REPLICATE: repl1 STATE: Active CONFLICT: Ignore FREQUENCY: immediate QUEUE SIZE: 0 PARTICIPANT: g_usa:informix.manufact g_italy:informix.manufact REPLICATE: repl2 STATE: Inactive CONFLICT: Ignore FREQUENCY: immediate QUEUE SIZE: 0 PARTICIPANT: g_usa:informix.stock g_italy:informix.manufact
Although this output shows that repl2 exists, it does not show the participant modifiers (the SELECT statements) for repl2.
cdr list replicate repl2
This command returns the following information:
REPLICATE | TABLE | SELECT |
---------------------------------------------------------------------- |
||
repl2 | stores@g_usa:informix.stock | select * from stock |
repl2 | stores@g_italy:informix.stock | select * from stock |
cdr define server --connect=japan --init \ --sync=g_usa g_japan
You can use either g_usa or g_italy in the --sync option.
Enterprise Replication maintains identical information on all servers that participate in the replication system. Therefore, when you add the japan database server, information about that server is propagated to all previously-defined replication servers (usa and italy).
cdr list server
The command returns the following information:
SERVER | ID | STATE | STATUS | QUEUE | CONNECTION CHANGED |
---------------------------------------------------------------------- |
|||||
g_italy | 8 | Active | Connected | 0 | JUN 14 14:38:44 2000 |
g_japan | 6 | Active | Connected | 0 | JUN 14 14:38:44 2000 |
g_usa | 1 | Active | Local |
cdr change replicate --add repl2 \ "stores@g_japan:informix.stock" "select * from stock"
cdr list replicate repl2
The command returns the following information:
REPLICATE | TABLE | SELECT |
---------------------------------------------------------------------- | ||
repl2 | stores@g_usa:informix.stock | select * from stock |
repl2 | stores@g_italy:informix.stock | select * from stock |
repl2 | stores@g_japan:informix.stock | select * from stock |
repl2
Changes made to the stock table on usa are reflected in the stock tables on both italy and japan.
cdr list replicate
The command returns the following information:
CURRENTLY DEFINED REPLICATES ------------------------------------------------------ REPLICATE: repl1 STATE: Active CONFLICT: Ignore FREQUENCY: immediate QUEUE SIZE: 0 PARTICIPANT: g_usa:informix.manufact g_italy:informix.manufact REPLICATE: repl2 STATE: Active CONFLICT: Ignore FREQUENCY: immediate QUEUE SIZE: 0 PARTICIPANT: g_usa:informix.stock g_italy:informix.manufact g_japan:informix.manufact