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, will make use of the pre-defined DSN cachedb1_1121 shipped with TimesTen 11.2.1. The hostnames of the two machines in the examples are stacb12 and stach17. cachedb1_1121 is the active cache database on stacb12, and cachedb2_1121 on stach17 is the standby cache database.
11. Attach the active database to the cache grid (required only if global cache groups are present)
a. Log in to server 2 (stach17) as the instance administrator. Use the ttRepAdmin utility to duplicate the active cache database to the standby database. ttrepadmin -duplicate -from cachedb1_1121 -host "stacb12" -uid cacheadm -pwd cacheadm -keepcg -cacheuid cacheadm -cachepwd cacheadm "dsn=cachedb2_1121" Note that the -from clause is using the data store name cachedb1_1121 and not the DSN name. -uid and -pwd correspond to the username and password of a user with ADMIN privilege on the active database.
12. Start the replication agent on the standby database
a. Step 11 is necessary only if there are global cache groups in the cache database, or if global cache group operations are required.
Log in to ttIsql and connect to cachedb1_1121 as the user cacheadm, passing in both the TimesTen and Oracle user passwords for cacheadm.connect "dsn=cachedb1_1121;uid=cacheadm;pwd=cacheadm;oraclepwd=cacheadm"; b. Call the procedure ttGridAttach to add the current cache database to the cache grid. call ttgridattach (1,'cachedb1','stacb12',9991,'cachedb2','stach17',9992); Note: cachedb1 and cachedb2 are arbitrary names used to denote the 2 databases involve in the active standby pair. stacb12 is the host name of the machine where the database cachedb1_1121 is located, and stach17 is the hostname of the machine where the database cachedb2_1121 is located. The TCP/IP port numbers 9991 and 9992 are arbitrary, but they should not conflict with other TCP ports (e.g. ftp, telnet etc.), specifically the hostname + port combination should be unique. The first parameter 1 indicates that the current database is the first database in the parameter list. c. Use the procedure ttGridNodeStatus to list all attached grid members and verify that cachedb1_1121 has joined the cache grid samplegrid. call ttgridnodestatus;
13. Start the cache agent on the standby database
a. Log in to ttIsql and connect to the standby database (cachedb2_1121) as the user cacheadm, passing in both the TimesTen and Oracle user passwords for cacheadm. connect "dsn=cachedb2_1121;uid=cacheadm;pwd=cacheadm;oraclepwd=cacheadm"; b. The replication agent on the standby database is responsible for processing the data from the active database. Use the built-in procedure ttRepStart to start the replication agent. call ttrepstart; c. Wait for cachedb2_1121 to enter the standby state. Use the built-in procedure ttRepStateGet to verify the current replication state of the database. call ttrepstateget;
14. Attach the standby database to the cache grid (required only if global cache groups are present)
a. Call the built-in procedure ttCacheStart to start the cache agent on the standby database. call ttcachestart;
a. Step 14 is necessary only if there are global cache groups in the cache database, or if you need to perform global cache grid operations. Call the procedure ttGridAttach to add the current standby cache database to the cache grid. call ttgridattach (2,'cachedb1','stacb12',9991,'cachedb2','stach17',9992); Note: The first parameter 2, indicates that the current database is the second database in the parameter list. b. Use the procedure ttGridNodeStatus to list all attached grid members and verify that cachedb2_1121 has joined the cache grid samplegrid. call ttgridnodestatus;
15. Preload data into Cache Groups
a. Log in to ttIsql and connect to cachedb1_1121 as the user cacheadm, passing in both the TimesTen and Oracle user passwords for cacheadm. connect "dsn=cachedb1_1121;uid=cacheadm;pwd=cacheadm;oraclepwd=cacheadm"; b. Enter the LOAD CACHE GROUP statement below in ttIsql, to populate the read-only cache group cacheadm.ro load cache group ro commit every 256 rows;
c. Enter the following LOAD CACHE GROUP statement in ttIsql to pre-load a dynamic cache group cacheadm.g_awt, with employees records where their id is greater than 200; load cache group g_awt where employees.employee_id > 200 commit every 0 rows; Note: For global cache groups, the LOAD CACHE GROUP statement will fail, if the cache instances are already present in the cache grid. After loading the data, the autorefresh state for read only cache groups will be changed to ON. Changes to the underlying autorefresh tables in Oracle will be applied to the cache tables once the defined refresh interval has been reached. For asynchronous writethrough cache groups, all updates in the cache database will be propagated to the Oracle database, once the replication agent process is up and running.
The configuration of an active standby pair is completed. Changes to the data in the active cache database will automatically be replicated to the standby cache database.
< Previous 1 2 3
Home | Site Map | Contact Us | Copyright © 2011 |