This is just one way to resync the replicated database in Sybase
log into primary server and change database
sp_stop_rep_agent <DBNAME>
dbcc settrunc(ltm, ignore)
log into repserver
suspend connection to <secondary_dbserver>.<dbname>
Check disk space on the RepServerlog into RepServer
admin disk_space
log into RSSD database (typically on the standby Sybase ASE)
run rs_helppartition “partition name” to determine which queues this partition contains
If we are going to resync, we need to flush the queue (in the RepServer)
sysadmin hibernate_on, “Reason for flushing queue”
sysadmin sqm_purge_queue, <connection #>, 0
sysadmin sqm_purge_queue, <connection #>, 1
sysadmin sqm_purge_queue, 140, 0 (“0” is the outbound queue. “1” is the inbound queue) – do for both queues
sysadmin hibernate_off, “Reason for flushing queue”
rs_zeroltm <primary_server>.<dbname>
turn secondary truncation marker in primary server.dbnamedbcc settrunc(ltm, valid)
dump database on primary server
sp_start_rep_agent <dbname>this will transfer the transactions from the primary database’s log segment into the queues.
load database on secondary server (do not bring on line)dbcc dbrepair(<dbname>, ‘ltmignore’)
online database <dbname>
resume connection to <secondary_dbserver>.<dbname>
if the replication definitions are for individual tables and not the entire databaseset autocorrection on for <table_repdef> with replicate at <secondary_dbserver>.<dbname>
when the tables are in sync, turn off autocorrection (replace ‘on’ with ‘off’)
if the replication definition is for the entire databasebe prepared to run “resume connection to <secondary_dbserver>.<dbname> skip transaction” until the databases are in sync – can be quite a few (this can be scripted if necessary).