Reversing the Roles of the Active and Standby Databases

You can 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. Call ttRepDeactivate on the current active database. This puts the database in the IDLE state.
  5. Call ttRepStateSet('ACTIVE') on the current standby database. This database now acts as the active database in the active standby pair.
  6. Set up the replication agent policy and start the replication agent on the old active database.
  7. 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.
  8. Resume any applications that were paused in Step 1.