5. Configuring Replication Using Replicator Manager : Table Registration Summary : CreateKeys Options
 
Share this page                  
CreateKeys Options
The CreateKeys option creates replicated transaction keys for every row in the base table and populates the shadow table. It can optionally populate the input queue. You must use CreateKeys if you install Ingres Replicator on an existing database that contains data. If you install Ingres Replicator on empty databases, replicated transaction keys are created and the shadow table is populated automatically when you insert data.
How you use CreateKeys varies depending on the contents of your databases. There are two options when using CreateKeys:
ShadowTableOnly
This option populates the local shadow table. You need to copy the populated shadow table to all Full Peer or Protected Read-only targets that are part of the table’s CDDS.
Note:  Once you use ShadowTableOnly on a database, you need to use the copydb utility to copy the resulting shadow table to other databases in the CDDS. In other words, you cannot use ShadowTableOnly against the same table in two different databases, because the resulting replicated transaction keys do not match.
BothQueue&ShadowTable
This option populates the shadow table and the input queue. Use this option if your databases are not synchronized; the altered rows are placed in the input queue for reconciliation or distribution. This option also needs to be used if the table is horizontally partitioned.
The following table explains when to use which CreateKeys option:
Databases
How To Use CreateKeys
Both are empty
Do not need to use CreateKeys. Because there are no rows of data, no replicated transaction keys can be generated.
One contains data, one is empty
Only use BothQueue&ShadowTable option of CreateKeys if your database is very small. The recommended procedure is to unload the tables with data and reload them into the empty database.
Both contain data and are synchronized
Use the ShadowTableOnly option of CreateKeys. This option populates the shadow tables so that Ingres Replicator does not detect collisions when manipulating rows for the first time.
Both contain data but are not synchronized
If a table to be replicated is rather large, attempt to synchronize the databases through some other means or use the BothQueue&ShadowTable option of CreateKeys. Ingres Replicator populates the shadow tables and sends the rows from the local database to the target database. Nonmatching rows cause collisions, which need to be resolved manually or by using collision resolution. For more information on collision handling, see Collision Design.
Note:  If the BothQueue&ShadowTable option of CreateKeys is used, the rows placed in the input queue are not immediately transferred to the distribution queue. To effect the transfer, ensure that all users disconnect from the database. The transfer takes place when you re-connect.