Use this procedure if you are loading only a primary database in a replication system. To load the database to a previous state and resolve any inconsistencies with replicate databases, follow this procedure:
Log in to the primary Replication Server and use the admin get_generation command to get the database generation number for the primary database:
admin get_generation, data_server, database
Write down the generation number so you have it for step 7.
Shut down the RepAgent for the primary database. To do this execute sp_stop_rep_agent system procedure.
sp_stop_rep_agent database
Suspend the DSI connection to the primary database (for exclusive use).
Load the database to the most recent or previous state.
This step entails loading the most recent database dump and all subsequent transaction log dumps.
Refer to the Adaptive Server Enterprise System Administration Guide for instructions.
Resume the DSI connection.
Enter the following commands to dump the transaction log:
use database go dbcc settrunc('ltm', 'ignore') go dump tran database with truncate_only go dbcc settrunc('ltm', 'valid') go
Execute the dbcc settrunc command in the restored primary database to set the generation number to the next higher number. For example, if the admin get_generation command in step 1 returned 0, enter the following commands:
use database go dbcc settrunc('ltm', 'gen_id', 1)
Run the following command to clear the locator information:
rs_zeroltm data_server, database
Start RepAgent for the primary database. To do this, execute the following command:
sp_start_rep_agent database
Run the rs_subcmp program for each subscription at the replicate sites. Use the -r flag to reconcile the replicate data with the restored primary data, or drop all the subscriptions and re-create them.
See Chapter 11, “Managing Subscriptions” in the Replication Server Administration Guide Volume 1 for more information on using rs_subcmp. Also refer to Chapter 7, “Executable Programs,” in the Replication Server Reference Manual for more information about rs_subcmp command.