Set Up the Oracle Database to Cache Data
The following sections describe the tasks that must be performed in the Oracle Database:
Create the Oracle Database Users
Before you can use TimesTen Cache, you must create the following users in your Oracle database:
-
A cache administration user. This user creates and maintains Oracle Database objects that store information about the cache environment. This user also enforces predefined behaviors of cache group types.
-
One or more schema users who owns Oracle Database tables that are cached in a TimesTen database.
See Create the Oracle Database Users and Default Tablespace in the Oracle TimesTen In-Memory Database Cache Guide for information.
This example creates the cacheuser2
cache administration user and the oratt
schema user in the Oracle Database.
Grant Privileges to the Cache Administration User
The cache administration user must be granted a specific set of privileges depending on the cache group types that will be created in the TimesTen databases and the operations performed on those cache groups. TimesTen provides the grantCacheAdminPrivileges.sql
SQL*Plus script that you can run in your Oracle Database to grant the cache administration user the minimum set of privileges required to perform cache operations. See Grant Privileges to the Oracle Cache Administration User and see Required Privileges for Cache Administration User for Cache Operations in the Oracle TimesTen In-Memory Database Cache
Guide.
Perform these steps to run the grantCacheAdminPrivileges.sql
script:
You have successfully run the grantCacheAdminPrivileges.sql
script in the Oracle Database.
Create the Oracle Database Tables to Be Cached
This example creates two tables in the oratt
user schema. See "Create the Oracle Database Users" for information on this user.
-
readtab
: This table will later be cached in a read-only cache group. -
writetab
: This table will later be cached in an AWT cache group.
You have successfully created the Oracle Database tables that will be cached in the TimesTen cache group tables.