Dropping an Active Standby Pair Configuration

To remove an existing active standby pair configuration, you must stop the replication agents and drop the active standby pair replication scheme on each cache database. This tutorial removes the standby cache database, and reverts the configuration back to a single cache database.

This tutorial uses the predefined DSNs cachedb1_1122 shipped with TimesTen 11.2.2. The hostnames of the two machines are tthost1 and tthost2. cachedb2_1122 is the current active cache database on tthost2, and cachedb1_1122 on tthost1 is the standby cache database.

1. Detach the databases from the cache grid
     (required only if the database is currently attached to a cache grid)

  1. Log in to ttIsql as the user cacheadm, and connect to the standby cache database cachedb1_1122.

    ttIsql

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


  2. Use the built-in ttGridDetach to detach the database from the cache grid.

    call ttgriddetach;


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

    call ttgridnodestatus;

    As can be seen, the fourth parameter in the ttgridnodestatus output (node1Attached) is "F", indicating that the cachedb1 node is no longer attached to the grid.


  4. Repeat the above steps on cachedb2_1122.


2. Stop the replication agents

  1. Log in to ttIsql as the user cacheadm, and connect to the standby cache database cachedb1_1122.

    ttIsql

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


  2. Use the built-in procedure ttRepStop to stop the replication agent on cachedb1_1122.

    call ttrepstop;


  3. Repeat the above step on cachedb2_1122.


3. Remove the active standby scheme

  1. Remove the active standby pair schema in cachedb1_1122 by using the DROP ACTIVE STANDBY PAIR statement. Use the ttIsql command repschemes to verify that the active standby replication scheme has been removed.

    drop active standby pair;
    repschemes;


  2. Repeat the above step on cachedb2_1122.


4. Remove cache groups from the previous standby cache database

The example below shows how to remove the two cache groups that were created in the earlier section from cachedb1_1122.

  1. Enter the following DROP CACHE GROUP statements in ttIsql, to remove the cache groups cacheadm.g_awt and cacheadm.ro, and their corresponding cache tables from the previous standby cache database, cachedb1_1122.

    drop cache group g_awt;
    drop cache group ro;


  2. Use the ttIsql command cachegroups to verify the removal of both cache groups from the cache database.

    cachegroups;


5. Stop the cache agent on the previous standby cache database

  1. Stop the cache agent on the previous standby database cachedb1_1122. Afterwards, exit out of ttIsql.

    call ttcachestop;
    exit


6. Destroy the previous standby cache database

  1. Log in as the instance administrator, use the ttDestroy utility to remove the redundant standby cache database (cachedb1_1122) on server 1 (tthost1).

    ttdestroy cachedb1_1122


7. Attach the cache database back to the cache grid
     (required only if there are global cache groups)

  1. Call the procedure ttGridAttach to add the previous active cache database (cachedb2_1122) back to the cache grid. This step is required only if there are global cache groups in the cache database.

    call ttgridattach (1, 'cachedb2', 'tthost2', 9992);


  2. Use the procedure ttGridNodeStatus to list all the attached grid members, and verify that cachedb2_1122 has re-joined the cache grid samplegrid as a standalone cache database.

    call ttgridnodestatus;