Reversing the Roles of the Active and Standby Databases
To change the role of the active database to standby and vice versa:
- Pause any applications that are generating updates on the current active database.
- Call
ttRepSubscriberWaiton 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. - Stop the replication agent on the current active database. See Starting and Stopping the Replication Agents.
- On the active database, for all read-only cache groups with autorefresh state set to
ON, set the autorefresh state toPAUSED. - Call
ttRepDeactivateon the current active database. This puts the database in theIDLEstate. If you are replicating a read-only cache group, this action automatically causes the autorefresh state to change fromONtoPAUSEDfor this database. - Call
ttRepStateSet('ACTIVE')on the current standby database. This database now acts as the active database in the active standby pair. - Start the replication agent on the former master database.
- Configure the replication agent policy as needed and start the replication agent on the former active database. Use the
ttRepStateGetbuilt-in procedure to determine when the database's state has changed fromIDLEtoSTANDBY. The database now acts as the standby database in the active standby pair. - Start the cache agent on the former active database if it is not already running.
- Resume any applications that were paused in Step 1.