Set Cache Policies

Options

ttAdmin has these options for cache:

Option Description

-connStr connection_string

An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.

DSN

An ODBC data source name of the database to be administered.

-cachePolicy

Defines the policy used to determine when the cache agent for the database should run.

manual (default) - Specifies that the cache agent must be manually started and stopped.

always - Specifies that the cache agent should always be running for the database. This option immediately starts the cache agent and when the daemon restarts, the cache agent is restarted.

norestart - Specifies that the cache agent for the database is not to be restarted after a failure.

-cacheStart

Starts a cache agent for the database.

-cacheStop

Stops a cache agent for the database. You should not shut down the cache agent immediately after dropping or altering a cache group. Instead, wait for at least two minutes. Otherwise, the cache agent may not get a chance to clean up the Oracle Database objects that were used by the autorefresh feature.

-cachePwd

The password associated with the cache administration user ID that manages autorefresh cache groups and asynchronous writethrough cache groups. The cache administration user has extended privileges. See Grant Privileges to the Oracle Cache Administration User in Oracle TimesTen In-Memory Database Cache Guide for more details.

-cacheUid

The cache administration user ID. The cache administration user manages autorefresh cache groups and asynchronous writethrough cache groups. The cache administration user has extended privileges.

See Grant Privileges to the Oracle Cache Administration User in the Oracle TimesTen In-Memory Database Cache Guide for more details.

-cacheUidGet

Gets the current cache administration user ID for the specified database.

-cacheUidPwdSet

Registers the cache administration user name and password for the specified database, using the -cacheUid and -cachePwd options. Note the following:

  • The CacheAdminWallet connection attribute specifies that credentials for the Oracle cache administration user that are set with the -cacheUidPwdSet option are stored in a system-managed Oracle Wallet. With the CacheAdminWallet connection attribute set to 0, the default value, TimesTen encrypts the credentials that you previously defined and stores them in memory. By setting the value to 1, TimesTen creates an Oracle Wallet to store the credentials. See CacheAdminWallet.
  • You only need to register the cache administration user ID and password once for each new database.

  • For all levels of DDLReplicationLevel, you can register the cache administration user name and password with the -cacheUidPwdSet option while the cache or replication agents are running. See Making DDL Changes in an Active Standby Pair in the Oracle TimesTen In-Memory Database Replication Guide.

  • The cache administration user ID cannot be reset while there are cache groups on the database. The cache administration password can be changed at any time.

-stopTimeout secs

Specifies that the TimesTen daemon should stop the cache agent if it does not stop within secs seconds.

If set to 0, the daemon potentially waits forever for the cache agent. The default value is 100 seconds.

Examples

A database referred to by DSN database1 contains data cached from an Oracle database. Use the following ttAdmin command to start the cache agent for database1:

% ttAdmin -cacheStart database1

You can also use the -cachePolicy option to ask the TimesTen data manager daemon to start the cache agent every time the data manager is started:

% ttAdmin -cachePolicy always database1

To turn off the automatic start of cache agent:

% ttAdmin -cachePolicy manual database1

To set the cache administration user ID and password, use -cacheUidPwdSet with -cacheUid and -cachePwd. For example:

% ttAdmin -cacheUidPwdSet -cacheUid cacheadmin -cachePwd orapwd database1

To get the current cache administration user ID for database1:

% ttAdmin -cacheUidGet database1

Notes

Before using any cache features, you must start the cache agent. Cache options require that you specify a value for the OracleNetServiceName in the DSN.

When using autorefresh or asynchronous writethrough cache groups, you must specify the cache administration user ID and password. This user account performs autorefresh and asynchronous writethrough operations.

To load data from an Oracle database, the TimesTen cache agent must be running. This requires that the ORACLE_HOME environment variable be set to the path of the Oracle installation. See Managing the Cache Agent in Oracle TimesTen In-Memory Database Cache Guide for more details.