This section describes how to perform a failover to the standby database after a failure on the active database or server. This includes how to rebuild the previous active database from a standby database.
This tutorial uses the pre-defined DSNs repdb1_1122 and repdb2_1122 shipped with TimesTen 11.2.2. The hostnames of the two machines are tthost1 and tthost2. repdb1_1122 was the active database on tthost1, and in this section, repdb2_1122 on tthost2 will be converted to become the new active database.1. Stop the replication agent on the failed active database
2. Set the state of the standby database to active
Stop the replication agent on the failed database, if it has not already been stopped.
Log in to server 1 (tthost1) as the instance administrator, and use the repdb1_1122.utility to stop replication agent on
ttadmin -repstop repdb1_1122
3. Mark the previous active database as failed
Using ttIsql, connect to the database repdb2_1122 on tthost2 as the replication administrator adm.
Use the built-in procedureto designate the current database as the new active database in the active standby pair. Afterwards, verify the current replication state by calling the built-in procedure .
Once the database has entered the active state, it has been converted to an active database. Applications that were previously connected to the failed database can now be diverted to the new active database. See the section onfor more information.
4. Destroy the failed database
Still logged in as adm in tthost2, use the procedure to register the former active database as failed.
call ttrepstatesave ('failed','repdb1_1122','tthost1');
5. Duplicate the new active database to create a new standby database
Log in as the instance administrator on server 1 (tthost1), use the utility to remove the failed database repdb1_1122.
6. Start the Replication Agent on the Standby Database
Use the utilityto create the standby database by duplicating from the new active database.
ttrepadmin -duplicate -from repdb2_1122 -host "tthost2" -uid adm -pwd adm "dsn=repdb1_1122"
Using ttIsql, connect to repdb1_1122 as the replication administrator adm. Call the built-in procedure to start the replication agent.
Verify that the standby database has entered the standby state by using thebuilt-in procedure.
Once the old active (now new standby) database has entered the "standby" state, the configuration of an active standby pair is completed. Changes to the data in the new active database will be automatically replicated to the new standby database.
For more information about Recovering from a Failure on the Active Database refer to the documentation here