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
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. - 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
ttRepDeactivate
on the current active database. This puts the database in theIDLE
state. If you are replicating a read-only cache group, this action automatically causes the autorefresh state to change fromON
toPAUSED
for this database. - 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 fromPAUSED
toON
for this database. - 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
ttRepStateGet
built-in procedure to determine when the database's state has changed fromIDLE
toSTANDBY
. 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.