Create and Configure the Standby Database

This example shows how to create and configure a standby database in an active standby pair replication scheme.

The following is the definition of the cachestandby DSN for the standby database of the active standby pair:

[cachestandby]
DataStore=/users/OracleCache/cachestand
PermSize=64
OracleNetServiceName=orcl
DatabaseCharacterSet=WE8ISO8859P1
CacheAdminWallet=1

Note:

If you set the CacheAdminWallet as a first connection attribute (normally set in the DSN), then when you register the cache administration user credentials with the ttCacheUidPwdSet built-in procedure, they are stored in an Oracle Wallet rather than in memory.

As the instance administrator, create the standby database as a duplicate of the active database by running a ttRepAdmin -duplicate utility command from the standby database system. The instance administrator user name of the active database's and standby database's instances must be identical.

Use the -keepCG option so that cache tables in the active database are duplicated as cache tables in the standby database, because the standby database is connected with the Oracle database.

In the following example:

  • The -from option specifies the file name prefix of the active database's checkpoint and transaction log files.

  • The -host option specifies the host name of the TimesTen system where the active database resides.

  • The -uid and -pwd options specify a user name and password of a TimesTen internal user defined in the active database that has been granted the ADMIN privilege.

  • The -cacheuid and -cachepwd options specify the Oracle cache administration user name and password.

  • cachestandby is the DSN of the standby database.

  • The -keepCG option specifies that the standby database keeps the cache groups defined on the active database.

% ttRepAdmin -duplicate -from cacheact -host "sys3" -uid cacheadmin -pwd timesten
    -cacheuid cacheadmin -cachepwd orapwd -keepCG cachestandby

Start the ttIsql utility and connect to the cachestandby DSN as the cache administration user. Set the Oracle cache administration user name and password by calling the ttCacheUidPwdSet built-in procedure.

% ttIsql "DSN=cachestandby;UID=cacheadmin;PwdWallet=/wallets/cacheadminwallet"
Command> CALL ttCacheUidPwdSet('cacheadmin','orapwd');

If desired, you can test the connectivity between the standby database and the Oracle database using the instructions stated in Testing the Connectivity Between the TimesTen and Oracle Databases.

Start the cache agent on the standby database by calling the ttCacheStart built-in procedure as the TimesTen cache administration user:

Command> CALL ttCacheStart;

As the TimesTen cache administration user, start the replication agent on the standby database by calling the ttRepStart built-in procedure.

Command> CALL ttRepStart;