cdr define replicateset

The cdr define replicateset command defines a replicate set on all the servers that are included as participants in the replicates. A replicate set is a collection of several replicates to be managed together.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-cdr define replicateset--+--------------------------+-------->
                            |                      (1) |   
                            '-| Connect Option   |-----'   

>--+-----------------------------+--+--------------+------------>
   |                         (2) |  '- --exclusive-'   
   '-| Frequency Options   |-----'                     

               .---------------.                     
               V               |                     
>--+-repl_set----+-----------+-+-----------------+-------------><
   |             '-replicate-'                   |   
   '- --needRemaster=--original_set--derived_set-'   

Notes:
  1. See Connect Option.
  2. See Frequency Options.
Element Purpose Restrictions Syntax
derived_set Name of a temporary replicate set to create that contains only replicates that must be remastered. The name must be unique and cannot be the same as a replicate name. Long Identifiers
original_set Name of an existing replicate set that contains replicates that must be remastered. The replicate set must exist. Long Identifiers
repl_set Name of replicate set to create. The name must be unique and cannot be the same as a replicate name. Long Identifiers
replicate Name of a replicate to be included in the replicate set. The replicate must exist. Long Identifiers

The following table describes the options to the cdr define replicateset command.

Long Form Short Form Meaning
--exclusive -X Creates an exclusive replicate set. Replicates that belong to this replicate set cannot belong to any other replicate sets.
--needRemaster= -n Creates a derived replicate set that contains replicates that have schema changes and must be remastered, and any classic replicates. All classic replicates are converted to master replicates regardless of whether they have schema changes.

Usage

All servers that are specified as participants for all the specified replicates must be online and the cdr utility must be able to connect to each participant.

If you run this command as a DBSA instead of as user informix, you must have INSERT, UPDATE, and DELETE permission on the replicated tables on all the replication servers in the domain.

Any valid replicate can be defined as part of a replicate set. A replicate can belong to more than one non-exclusive replicate set, but to only one exclusive replicate set.

When you create an exclusive replicate set, the state is initially set to active.

To create an exclusive replicate set and make it active

  1. Create an empty replicate set.
  2. Stop the replicate set.
  3. Add replicates to the replicate set.
  4. Set the state of the replicate set to active by running cdr start replicateset.

Because individual replicates in a non-exclusive replicate set can have different states, the non-exclusive replicate set itself has no state. You cannot change whether a replicate set is exclusive or not.

If you change the schema of multiple replicated tables for replicates that belong to the same replicate set, you can create a derived replicate set so that you can remaster all the replicates with one command. Use the --needRemaster option to specify the existing replicate set and the name of the derived replicate set. Then run the cdr remaster replicateset command.

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

Example: Define a non-exclusive replicate set

The following command connects to the default server and defines the non-exclusive replicate set accounts_set with replicates repl1, repl2, and repl3:
cdr def replset accounts_set repl1 repl2 repl3

Example: Define an exclusive replicate set

The following command connects to the server olive and defines the exclusive replicate set market_set with replicates basil and thyme:
cdr def replset --connect=olive --exclusive market_set basil thyme

Example: Define a derived replicate set

The following command defines a derived replicate set named derived_accounts that is based on the replicate set accounts_set:

cdr define replicateset --needRemaster=accounts_set derived_accounts

Copyright© 2020 HCL Technologies Limited