Resynchronizing the Active and Standby Databases in a Warm Standby Application

Resynchronize the active and standby databases in a warm standby environment, when the warm standby pair is the replicate site for a single primary database.

In this scenario, the replicate site is a warm standby pair that consists of the active and standby databases that act as a single logical database.

Primary ---> Replication ---> Replicate logical database

database     Server           [Active+Standby warm standby

                               pair]

The resynchronization scenario procedure is a two-step process—resynchronize the replicate active database of the warm standby pair with a dump from the primary database, and then resynchronize the replicate standby database of the warm standby pair with a dump from the active database or the existing dump from the primary database.

  1. Stop replication processing by both the primary database RepAgent and the warm standby active database RepAgent.
    In Adaptive Server, execute:
    sp_stop_rep_agent database
  2. Suspend the Replication Server DSI connection to the active and standby databases:
    suspend connection to dataserver.database
  3. Instruct Replication Server to remove data from the outbound queue of the active and standby databases, and wait for a resync marker from the primary database RepAgent:
    resume connection to data_server.database skip to 
    resync marker
  4. Instruct the primary database RepAgent to start in resync mode and send a resync marker to Replication Server.
    • If the truncation point has not been moved from its original position, execute this command in Adaptive Server:
      sp_start_rep_agent database, 'resync'
    • If the truncation point has been moved from its original position, execute this command in Adaptive Server:
      sp_start_rep_agent database, 'resync purge'
  5. Verify that DSI for the active database has received and accepted the resync marker from the primary database RepAgent by looking for this message in the Replication Server system log:
    DSI for data_server.database received and processed
    Resync Database Marker. Waiting for Dump Marker.
  6. Obtain a dump of the primary database contents. See Adaptive Server Enterprise Reference Manual: Commands > Commands > dump database. Adaptive Server automatically generates a dump database marker.
  7. Obtain the RepAgent settings before you apply the dump.
    Note: Adaptive Server stores, within the database, the connectivity settings and other configurations that RepAgent uses. If you load the primary database from a dump that you took from a different database, RepAgent loses its configuration settings, or the settings change to match the settings of the database that you took the dump from.
  8. Verify that the Replication Server DSI for the active database has processed the dump database marker by looking for this message from the active database in the Replication Server system log:
    DSI for data_server.database received and processed
    Dump Marker. DSI is now suspended. Resume after database has been reloaded.
  9. Apply the dump of the primary database to the active database. See Adaptive Server Enterprise Reference Manual: Commands > Commands > load database.
    After you apply the dump, reset the RepAgent configurations to the settings that existed before you applied the dump.
  10. Make sure that the last primary database transaction log page does not contain any operation that can affect replicate database tables by executing at the primary Adaptive Server database:
    rs_update_lastcommit 0, 0, 0, ""
    go 100
  11. Move the truncation point to the end of the transaction log for the active database. In Adaptive Server, execute:
    dbcc settrunc(‘ltm’, ‘end’)
    go
  12. Instruct RepAgent to start in resync mode with the init instruction. In Adaptive Server, execute:
    sp_start_rep_agent database, 'resync init'
  13. Verify that DSI for the standby database has received and accepted the resync marker from the active database RepAgent by looking for this message in the Replication Server system log:
    DSI for data_server.database received and processed
    Resync Database Marker. DSI is now suspended. Resume 
    after database has been reloaded.

    When Replication Server receives and processes the resync database with init marker, the DSI connection suspends.

  14. Obtain a dump of the active database contents and apply the dump to the standby database. You can also apply the dump of the primary database from step 6 if the dump does not include database configuration information.
  15. Resume DSI to the active and standby databases:
    resume connection to data_server.database