Configuring an Active Standby Pair for the Cache Database

After creating an initial cache database, you can then define the configuration of the active standby pair and assign the current database (cachedb1_1122 on tthost1) as the active database.

This tutorial will make use of the predefined DSN cachedb1_1122 shipped with TimesTen 11.2.2. The hostnames of the two machines in the examples are tthost1 and tthost2. cachedb1_1122 is the active cache database on tthost1, and cachedb2_1122 on tthost2 is the standby cache database.

For all the steps within this section, it is necessary to log in to ttIsql as the user cacheadm, passing in the TimesTen and Oracle user passwords for cacheadm.

ttIsql

connect "dsn=cachedb1_1122;uid=cacheadm;pwd=cacheadm;oraclepwd=cacheadm";

3. Detach database from the cache grid
     (only required if the database is currently attached to a cache grid)
  1. This step is required only if the database is currently attached to a cache grid. Use the built-in ttGridDetach to detach the database from the cache grid.

    call ttgriddetach;


  2. Use the procedure ttGridNodeStatus to verify that cachedb1 is no longer attached to a cache grid.

    call ttgridnodestatus;


4. Start the cache agent
  1. Use the built-in procedure ttCacheStart to start the cache agent if not already started.

    call ttcachestart;


5. Set autorefresh state to paused
  1. If there are any autorefresh cache groups, their autorefresh state must be temporarily set to paused before an active standby pair can be defined. Use the ALTER CACHE GROUP SQL statement to change the autorefresh state.

    alter cache group ro set autorefresh state paused;


  2. The ttIsql command cachegroups can be used to return the properties of a cache group.

    cachegroups ro;

    Alter Cache Group Set Autorefresh state paused


6. Stop the replication agent
  1. The replication agent is responsible for replicating data between TimesTen databases. It must be stopped prior to defining an active standby pair configuration. Use the built-in procedure ttRepStop to temporarily stop the replication agent if not already stopped.

    call ttrepstop;


7. Define the active standby pair
  1. Define the active standby pair schema by using the CREATE ACTIVE STANDBY PAIR statement, which by default uses asynchronous replication.

    create active standby pair cachedb1_1122 on "tthost1", cachedb2_1122 on "tthost2";

    Note: The data store names cachedb1_1122 and cachedb2_1122 used in the CREATE ACTIVE STANDBY PAIR statement are not DSNs, these are the filenames defined in the data store path attribute. The hostnames used in defining the active standby pair should match the values returned by the OS hostname command on the respective servers.


  2. The ttIsql command repschemes can be used to verify the current replication scheme deployed in the database.

    repschemes;


8. Set the replication state to Active
  1. Use the built-in procedure ttRepStateSet to designate the current database (cachedb1_1122) as the active cache database in the active standby pair.

    call ttrepstateset ('active');


  2. The built-in procedure ttRepStateGet returns the current replication state of the database.

    call ttrepstateget;


9. Start the replication agent
  1. The replication agent process is responsible for replicating data between TimesTen databases. It must be running on both databases in an active standby pair. Use the built-in procedure ttRepStart to start the replication agent on cachedb1_1122.

    call ttrepstart;


After setting up an active cache database and defining the active standby pair configuration, you can now go and create the standby database.

< Previous 1 2 3 Next >