Task 1: Identify the Schema on the Oracle Database

On the Oracle database, use SQL*Plus to connect to the Oracle database as a database administrator.

  1. Identify tables to cache on the Oracle Database.

    Since the cache tables are based on the tables you want to cache in the Oracle Database, identify the Oracle Database tables that you want to be cached in the TimesTen database.

    Each table should be either:

    • An Oracle Database table with a primary key on non-nullable columns. The TimesTen cache table primary key must be defined on the full Oracle Database table primary key.

    • An Oracle Database table with non-nullable columns upon which a unique index is defined on one or more of the non-nullable columns in the table. The TimesTen cache table primary key must be defined on all of the columns in the unique index.

    For example, you decide to cache the sales.customers, and sales.orders tables on the Oracle database. Then, note that the definition of the customers and orders tables are:

    CREATE TABLE sales.customers
    (cust_num NUMBER(6) NOT NULL PRIMARY KEY,
     region   VARCHAR2(10),
     name     VARCHAR2(50),
     address  VARCHAR2(100));
    
    CREATE TABLE sales.orders
    (ord_num      NUMBER(10) NOT NULL PRIMARY KEY,
     cust_num     NUMBER(6) NOT NULL,
     when_placed  DATE NOT NULL,
     when_shipped DATE NOT NULL)
     FOREIGN KEY(cust_num) REFERENCES sales.customers(cust_num));
  2. Since these tables are going to be cached in a read-only cache group, grant the SELECT privilege on the customers and orders tables to the Oracle cache administration user:

    SQL> GRANT SELECT ON sales.customers TO cacheadmin;
    SQL> GRANT SELECT ON sales.orders TO cacheadmin;