Adding the standby database to the replication system

To add the standby database to the replication system:

  1. Suspend transaction processing in the active database, if appropriate for your client applications and your method of initializing the standby database.

    You must use dump and load with the “dump marker” method if you do not suspend transaction processing.

  2. Use Sybase Central or rs_init to add the standby database to the replication system. Perform the steps described for adding a database to the replication system.

  3. To monitor the status of the logical connection at any time, enter:

    admin logical_status, logical_ds, logical_db
    

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

  4. If you are initializing the standby database using dump and load, use the dump command to dump the contents of the active database, and load the standby database. For example:

    dump database active_database to dump_device
    
    load database standby_database from dump_device
    
  5. If you have already loaded a previous database dump and subsequent transaction dumps, you can just dump the transaction log and load it into the standby database. For example:

    dump transaction active_database to dump_device
    
    load transaction standby_database from dump_device
    
  6. After completing load operations, bring the standby database online:

    online database standby_database
    

    Refer to the Adaptive Server Enterprise Reference Manual for help with using the dump and load commands and the online database command.

  7. Initialize the standby database. Use bcp or quiesce ... to manifest_file and mount.

    • To initialize the standby database using bcp, copy each of the replicated tables in the active database to the standby database.

      You must copy the rs_lastcommit table, which was created when you added the active database to the replication system.

      Refer to the Adaptive Server utility programs manual for help with using the bcp program.

    • To initialize the standby database using quiesce ... to manifest_file and mount, quiesce the database and create the manifest file. Make a copy of both the database and log devices. Mount the devices on the standby database.

  8. If you initialized the standby database by using dump and load without the “dump marker” method, or by using bcp, or by using quiesce database ... to manifest_file and mount, Replication Server suspended the connection to the active database. Resume the connection by executing the following command in the Replication Server:

    resume connection to active_ds.active_db
    
  9. Regardless of your method for initializing the standby database, you must resume the connection to the standby database by executing the following command:

    resume connection to standby_ds.standby_db
    
  10. Resume transaction processing in the active database, if it was suspended.

Using a blocking command for standby creation

In Replication Server, the wait for create standby command is a blocking command. It tells Replication Server not to accept commands until the standby database is ready for operation. You can use this command in a script that creates a standby database. The syntax is:

wait for create standby for logical_ds.logical_db