Creating a Standby Database

After setting up an active master database, you can create the standby database by cloning the active database to the standby server. In order to duplicate the active database, the instance administrator on the standby machine must be identical to the one on the active server.

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 is the active database on tthost1, and repdb2_1122 on tthost2 is the standby database.

6. Duplicate the active database to the standby
  1. Log in to server 2 (tthost2) as the instance administrator. Use the ttRepAdmin utility to duplicate from the active database to the standby database.

    ttrepadmin -duplicate -from repdb1_1122 -host "tthost1" -uid adm -pwd adm "dsn=repdb2_1122"

    Note: The -from clause is using the data store name <repdb1_1122 and not the DSN name; -uid and -pwd correspond to the username and password of the ADMIN user on the active database.


7. Start the replication agent
  1. Using ttIsql, connect to the database repdb2_1122 as the replication administrator adm.

    ttisql

    connect "dsn=repdb2_1122;uid=adm";


  2. The replication agent on the standby is responsible for processing the data from the active database. Use the built-in procedure ttRepStart to start the replication agent.

    call ttrepstart;


  3. Wait for repdb2_1122 to enter the standby state. Use the built-in procedure ttRepStateGet to verify the current replication state of the database.

    call ttrepstateget;

    Once the standby database entered the "standby" state, the configuration of an active standby pair is completed. Changes to data in the active database will be automatically replicated to the standby.


8. Verify the data is being replicated between the active and the standby
  1. In ttIsql on tthost1, connect to repdb1_1122 as appuser, and insert a record into the orders table.

    ttIsql

    connect "dsn=repdb1_1122; uid=appuser";

    insert into orders values (6853180,1121,'9999999999', sysdate);


  2. Verify that the insert is replicated to the standby database repdb2_1122 on tthost2.

    select * from appuser.orders where order_number=6853180;


 For more information about how to set up and manage an Active Standby Pair on a TimesTen database refer to the documentation here

 

< Previous 1 2 3