Cache Operations

Use ttGridAdmin commands in this section to set credentials and to start or stop cache agents for cache operations.

Set Credentials (dbCacheCredentialSet)

Use the dbCacheCredentialSet command to register the Oracle cache administration user name and password in the TimesTen database.

You must register these credentials before any cache group operation can be issued. The cache agent connects to the Oracle database as the Oracle cache administration user to create and maintain Oracle Database objects that store information used to enforce predefined behaviors of particular cache group types. In addition, cache agents connect to the Oracle database with the credentials set to manage Oracle database operations.

You only need to register the cache administration user ID and password once for each new database. See Set the Cache Administration User Name and Password in the TimesTen Database in Oracle TimesTen In-Memory Database Cache Guide.

You can also use the ttGridAdmin dbCacheCredentialSet command to change the Oracle cache administration user name and password. You cannot change the Oracle cache administration user name if there are existing cache groups. In this case, drop all cache groups before attempting to modify the Oracle cache administration user name. See Changing Cache User Names and Passwords in Oracle TimesTen In-Memory Database Cache Guide.

ttGridAdmin dbCacheCredentialSet name

Options

The dbCacheCredentialSet command has the option:

Option Description

name

The name of the database.

Examples

Use the ttGridAdmin dbCacheCredentialSet command to set the Oracle cache administration user name and password. This user name and password are saved in an Oracle Wallet, which each instance in the database can access and use.

When prompted, specify the Oracle cache administration user name as the Oracle user id and the Oracle cache administration user password as the Oracle password.

% ttGridAdmin dbCacheCredentialSet database1
Enter your Oracle user id: cacheadmin
Enter Oracle password:
Password accepted
Configuring cache.....................................................OK

Notes

  • The CacheAdminWallet connection attribute specifies if credentials for the Oracle cache administration user that are registered with the ttGridAdmin dbCacheCredentialSet command are stored in an Oracle Wallet or in memory. See CacheAdminWallet.

  • For TimesTen Scaleout, Oracle Wallets are always located on data instances.

Start a Cache Agent (dbCacheStart)

The cache agent performs cache operations, such as loading a cache group and managing incremental autorefresh. TimesTen distributes cache tasks across different cache agents (each running on different data instances), where all work for a specific autorefresh interval is assigned to a single cache agent. A cache agent can manage multiple autorefresh intervals.

The dbCacheStart command starts the cache agent.

ttGridAdmin dbCacheStart name [-instance hostname[.instancename]]
          [-nowait | -wait [timeout]]

Options

The dbCacheStart command has the options:

Option Description

name

The name of the database.

-instance hostname[.instancename]

If specified, cache agent(s) are created only on the specified instance(s), instead of on all instances of the grid.

If -instance is used, then the hostname is required. The instancename is required only if there is more than one instance on the host. (See Grid Objects and Object Naming.)

-nowait | -wait [timeout]

The command initiates a state change that is recorded in the active management instance of the grid.

The -nowait option causes the command to return immediately without waiting for the state change. This is the default behavior.

The -wait option causes the command to wait for the state change to complete, when the database element has been closed on each instance in the grid. You can optionally subject the wait to a limit of timeout seconds. Otherwise, or if timeout is set to 0, there is no limit.

In a large grid, it is not typical or generally advisable to use -wait. If you do, it is advisable to set a timeout. (See Database Management Operations.)

Examples

From the management instance, use the ttGridAdmin dbCacheStart command to start cache agents on all data instances in the database1 database:

% ttGridAdmin dbCacheStart database1
Database database1 : Starting cache agents. 

% ttGridAdmin dbStatus database1 -element
Database database1 element level status as of Thu Dec 24 09:59:14 PST 2020
 
Host  Instance  Elem Status CA Status Date/Time of Event  Message 
----- --------- ---- ------ --------- ------------------- ------- 
host3 instance1    1 opened started 2020-12-24 09:59:14         
host4 instance1    2 opened started 2020-12-24 09:59:14         
host5 instance1    3 opened started 2020-12-24 09:59:14         
host6 instance1    4 opened started 2020-12-24 09:59:14         
host7 instance1    5 opened started 2020-12-24 09:59:14         
host8 instance1    6 opened started 2020-12-24 09:59:14 

You can start the cache agent for a specific data instance with the -instance option.

% ttGridAdmin dbCacheStart database1 -instance host4.instance1
Database database1 : Starting cache agents. 

% ttGridAdmin dbStatus database1 -element
Database database1 element level status as of Mon Dec  7 14:52:51 PST 2020
 
Host  Instance  Elem Status CA Status Date/Time of Event  Message 
----- --------- ---- ------ --------- ------------------- ------- 
host3 instance1    1 opened stopped 2020-11-23 08:37:35         
host4 instance1    2 opened started 2020-12-07 14:52:51         
host5 instance1    3 opened stopped 2020-11-23 08:37:35         
host6 instance1    4 opened stopped 2020-11-23 08:37:35         
host7 instance1    5 opened stopped 2020-11-23 08:37:35         
host8 instance1    6 opened stopped 2020-11-23 08:37:35 

Stop a Cache Agent (dbCacheStop)

The dbCacheStop command stops the cache agent.

ttGridAdmin dbCacheStop name [-instance hostname[.instancename]]
          [-nowait | -wait [timeout]]

Options

The dbCacheStop command has the options:

Option Description

name

The name of the database.

-instance hostname[.instancename]

If specified, cache agent(s) are stopped only on the specified instance(s), instead of on all instances of the grid.

If -instance is used, then the hostname is required. The instancename is required only if there is more than one instance on the host. (See Grid Objects and Object Naming.)

-nowait | -wait [timeout]

The command initiates a state change that is recorded in the active management instance of the grid.

The -nowait option causes the command to return immediately without waiting for the state change. This is the default behavior.

The -wait option causes the command to wait for the state change to complete, when the database element has been closed on each instance in the grid. You can optionally subject the wait to a limit of timeout seconds. Otherwise, or if timeout is set to 0, there is no limit.

In a large grid, it is not typical or generally advisable to use -wait. If you do, it is advisable to set a timeout. (See Database Management Operations.)

Examples

From the management instance, use the ttGridAdmin dbCacheStop command to stop cache agents on all data instances in the database1 database:

% ttGridAdmin dbCacheStop database1
Database database1 : Stopping cache agents. 

% ttGridadmin dbStatus database1 -element
Database database1 element level status as of Mon Dec  7 15:35:13 PST 2020
 
Host  Instance  Elem Status CA Status Date/Time of Event  Message 
----- --------- ---- ------ --------- ------------------- ------- 
host3 instance1    1 opened stopped   2020-12-07 15:35:13         
host4 instance1    2 opened stopped   2020-12-07 15:35:13         
host5 instance1    3 opened stopped   2020-12-07 15:35:13         
host6 instance1    4 opened stopped   2020-12-07 15:35:13         
host7 instance1    5 opened stopped   2020-12-07 15:35:13         
host8 instance1    6 opened stopped   2020-12-07 15:35:13

You can stop the cache agent for a specific data instance with the -instance option.

% ttGridAdmin dbCacheStop database1 -instance host4.instance1
Database database1 : Stopping cache agents. 

% ttGridadmin dbStatus database1 -element
Database database1 element level status as of Mon Dec  7 15:20:48 PST 2020
 
Host  Instance  Elem Status CA Status Date/Time of Event  Message 
----- --------- ---- ------ --------- ------------------- ------- 
host3 instance1    1 opened started   2020-11-23 08:37:35         
host4 instance1    2 opened stopped   2020-12-07 15:20:48         
host5 instance1    3 opened started   2020-11-23 08:37:35         
host6 instance1    4 opened started   2020-11-23 08:37:35         
host7 instance1    5 opened started   2020-11-23 08:37:35         
host8 instance1    6 opened started   2020-11-23 08:37:35 

Note:

If there is only one cache agent running, do not stop the last cache agent immediately after you have dropped or altered a cache group with autorefresh. Instead, wait for at least two minutes to enable the cache agent to clean up Oracle Database objects such as change log tables and triggers that were created and used to manage the cache group. This is not an issue when you have more than one cache agent running.