7. Maintaining the Replicator : Reconfiguration of the Replicator : How You Copy Replicated Tables Between Replicated Databases
 
Share this page                  
How You Copy Replicated Tables Between Replicated Databases
Copying a table between replicated databases is done for several reasons. For example, a table already exists in both databases and is being added to the replication scheme, in which case, it is important to synchronize; or a table exists in only one database and the CDDS is being extended to encompass a new or existing database.
Command Line and Replicator Manager:
To copy replicated tables to other replicated databases, follow these steps:
1. Copy the base replicated table to the new database using the copydb command. (Do not copy shadow and archive tables at this time.) For example:
copydb dbname tablename
2. Execute the copy.out file against the old database and the copy.in command against the new database. For example:
sql old_dbname < copy.out
sql new_dbname < copy.in
3. Access Replicator Manager on the old database to register the table in the new database.
4. Select Configuration from the Replicator Manager for the old database.
5. Select MoveConfig from the Configuration menu.
6. Place the cursor on the new database and select ThisDatabase, from the Move Configuration window.
7. To confirm that the new table was registered correctly, access Replicator Manager on the new database.
8. From the Replicator Manager for the new database, select Configuration.
9. From the Configuration menu, select Tables.
10. From the Table Registration Summary window, place the cursor on the new table and select Edit.Determine the name of the shadow table and, if necessary, the archive table using the SQL Terminal Monitor.
Note:  The archive table is needed if the base table is part of a Full Peer CDDS at the target database.
11. Use the copydb command to copy the shadow and archive tables from the old database.
For example:
copydb old_dbname shadow_name [archive_name]
sql old_dbname < copy.out
12. Edit the copy.in script and remove any CREATE TABLE, MODIFY, and CREATE INDEX statements. Copy the shadow and archive tables into the new database.
For example:
sql new_dbname < copy.in