Reversing the Roles of the Active and Standby Databases

To change the role of the active database to standby and vice versa:

  1. Pause any applications that are generating updates on the current active database.
  2. Call ttRepSubscriberWait on the active database, with the DSN and host of the current standby database as input parameters. It must return success (<00>). This ensures that all updates have been transmitted to the current standby database.
  3. Stop the replication agent on the current active database. See Starting and Stopping the Replication Agents.
  4. On the active database, for all read-only cache groups with autorefresh state set to ON, set the autorefresh state to PAUSED.
  5. Call ttRepDeactivate on the current active database. This puts the database in the IDLE state. If you are replicating a read-only cache group, this action automatically causes the autorefresh state to change from ON to PAUSED for this database.
  6. Call ttRepStateSet('ACTIVE') on the current standby database. This database now acts as the active database in the active standby pair. If you are replicating a read-only cache group, this automatically causes the autorefresh state to change from PAUSED to ON for this database.
  7. Start the replication agent on the former master database.
  8. Configure the replication agent policy as needed and start the replication agent on the former active database. Use the ttRepStateGet built-in procedure to determine when the database's state has changed from IDLE to STANDBY. The database now acts as the standby database in the active standby pair.
  9. Start the cache agent on the former active database if it is not already running.
  10. Resume any applications that were paused in Step 1.