Setting Up an Active Master Cache Database

This tutorial will make use of the pre-defined DSN cachedb1_1122 and cachedb2_1122 shipped with TimesTen 11.2.2. The hostnames of the two machines in the examples are tthost1 and tthost2. cachedb1_1122 will be created as the active cache database on tthost1, and cachedb2_1122 on tthost2 will be created as the standby cache database.

In order to set up an active standby database, you must first create a cache database which will be the initial active master database. This database must include a user with ADMIN privilege, and cache groups owned an application user.

1. Create a cache database
  1. Follow the tutorials in Configuring TimesTen Application-Tier Database Cache (TimesTen Cache) to create an initial cache database cachedb1_1122. The cache database contains two cache groups, a dynamic updatable global cache group based on the Oracle hr.employees and hr.job_history tables, and a read only local cache group based on the Oracle hr.departments table.

    To create these cache groups, complete the following tutorials:

    • Required configuration on the Oracle database

    • Setting up a cache database

    • Adding cache groups to a cache database
      • Within this tutorial, the following steps are not required:
        • Step 4: Attach the Cache Database to the Cache Grid
        • Step 5: Preload data into Cache Groups
      • When setting up an active standby pair, the grid attach and the load cache group steps (steps 4 and 5 shown above) must be performed after the standby database has been created. Specifically, these steps are done in the following steps later in this tutorial:
        • Step 11: Attach the active database to the cache grid
        • Step 14: Attach the standby database to the cache grid
        • Step 15: Preload data into Cache Groups

  2. Create a DSN for the standby cache database on the standby server. This DSN should have the same attribute definitions as the active cache database. In our example, we will use cachedb2_1122 as the standby database DSN on tthost2.

    Log in to server 2 (tthost2) as the instance administrator, create a DSN called cachedb2_1122 with the same attribute settings as cachedb1_1122.

    If necessary, refer to the Creating a TimesTen Database section for more information.

2. Create a database user to administer the replication operations
  1. Create a database user and assign him the role of the replication administrator, this user is responsible for setting up and managing the Active Standby Pair replication. Instead of creating a new database user, you can also grant the required privilege to cacheadm, this user will then be responsible for managing both Replication and Cache operations.

    Using ttisql, log into the database cachedb1_1122 as the Instance administrator and execute:

    grant admin to cacheadm;

    Note: In the previous TimesTen Cache example, we have already granted the ADMIN privilege to cacheadm, hence this step is not needed.

After setting up an initial cache database, you can now define the configuration of the Active Standby Pair and assign the current database (cachedb1_1122 on tthost1) as the Active database.

1 2 3 Next >