Procedure for switching the active and standby databases

Before switching, you must implement a method for switching clients, as described in “Setting up clients to work with the active data server”.

Follow these steps to switch the active and standby databases for a logical connection:

  1. At the Adaptive Server of the active database, ensure that the RepAgent is shut down. Otherwise, use sp_stop_rep_agent to shut down RepAgent.

  2. At the Replication Server, enter:

    switch active for logical_ds.logical_db
    to data_server.database
    

    data_server.database is the new active database.

    See “Internal switching steps” for information on what Replication Server does when you switch.

  3. To monitor the progress of a switch, you can use the admin logical_status command:

    admin logical_status, logical_ds, logical_db
    

    The Operation in Progress and State of Operation in Progress output columns indicate the switch status.

  4. When the active database switch is complete, you must restart RepAgent for the new active database:

    sp_start_rep_agent dbname
    

NoteIf Replication Server stops in the middle of switching, the switch resumes after you restart Replication Server.