Task 3: Create Users and Grant Privileges in the TimesTen Database
In addition to the Oracle database users, you must create the following TimesTen users before you can use cache.
-
A TimesTen cache administration user performs cache group operations. The TimesTen cache administration user must have the same name as the Oracle cache administration user that can access the cached Oracle Database tables. The password of the TimesTen cache administration user can be different than the password of the Oracle cache administration user with the same name.
-
One or more cache table owner users that own the cache tables. You must create a user that owns the TimesTen cache tables that has the same name as the schema owner that owns Oracle Database tables to be cached in the TimesTen database. The graphic shows one cache table owner called
sales
that has the same name as thesales
schema owner in the Oracle database. The password of a cache table user can be different than the password of the Oracle Database schema owner with the same name.
Use the ttIsql
utility on the TimesTen instance from an operating system shell or command prompt as the instance administrator, and connect to the cache1
DSN to create the TimesTen database that is to be used to cache data from an Oracle database:
% ttIsql cache1
Use ttIsql
to create a cache administration user on TimesTen. Grant this user the minimum set of privileges required to create cache groups and to perform operations on the cache groups. Any cache administration user that creates, owns, and manages cache groups in the TimesTen database needs at least the CREATE SESSION
, CACHE_MANAGER
, and CREATE ANY TABLE
privileges. In the following example, the cache administration user name is cacheadmin
, which is the same name as the Oracle Database cache administration user that was created earlier:
Command> CREATE USER cacheadmin IDENTIFIED BY ttpwd; User created. Command> GRANT CREATE SESSION, CACHE_MANAGER, CREATE ANY TABLE TO cacheadmin;
Then, use ttIsql
to create a cache table owner. In the following example, the cache table owner is sales
, which is the same name as the schema owner that owns the Oracle database tables that are to be cached. Also, granting CREATE SESSION
privilege so that sales
can connect to the TimesTen database, if desired.
Command> CREATE USER sales IDENTIFIED BY ttpwd; User created. Command> GRANT CREATE SESSION to sales; Command> exit; Disconnecting... Done.
Any additional privileges that the cache administration user requires depends on the types of cache groups you create and the operations that you perform on the cache groups. These required privileges are discussed when the cache groups are created.