Managing the Cache Environment
There are methods to manage the cache environment within TimesTen Scaleout.
Monitoring the Status of the Cache Agent Processes
You can use the ttGridAdmin dbStatus -all
command to check which of
the TimesTen cache agent processes are running.
The following example shows that one of the cache agents of the database1 database is stopped.
% ttGridAdmin dbStatus database1 -all
Database database1 summary status as of Mon Dec 7 14:54:57 PST 2020
created,loaded-complete,open
Completely created elements: 6 (of 6)
Completely loaded elements: 6 (of 6)
Completely created replica sets: 3 (of 3)
Completely loaded replica sets: 3 (of 3)
Cache agents running: 5 (of 6)
Open elements: 6 (of 6)
Then, you can use the ttGridAdmin dbStatus -element
command to verify which cache agents are running on each data instance of the database. All data instances must have access to the Oracle database.
The following example shows that a cache agent is not running on the
host4
instance of the database1
database.
% 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 started 2020-11-23 08:37:35
host4 instance1 2 opened stopped 2020-11-23 08:37:35
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
You can restart the cache agent for the host4.instance1
instance as follows:
% ttGridAdmin dbCacheStart database1 -instance host4.instance1]
Database database1 : Starting cache agents. 0 cache agents started.
See Monitor the Status of a Database (dbStatus) and Start a Cache Agent (dbCacheStart), respectively, in Oracle TimesTen In-Memory Database Reference.
Displaying Information About Cache Groups
You can display information about cache groups in a TimesTen database using the
ttIsql
utility cachegroups
command.
% ttIsql "DSN=database1;UID=cacheadmin;PwdWallet=/wallets/cacheadminwallet"
Command> cachegroups;
Cache Group CACHEADMIN.READCACHE:
Cache Group Type: Read Only
Autorefresh: Yes
Autorefresh Mode: Incremental
Autorefresh State: On
Autorefresh Interval: 5 Seconds
Autorefresh Status: ok
Aging: No aging defined
Root Table: SALES.READTAB
Table Type: Read Only
1 cache group found.
See ttIsql in Oracle TimesTen In-Memory Database Reference.
Changing TimesTen Cache User Names and Passwords
You can change any of the user names or passwords for the TimesTen cache administration user or its companion Oracle cache administration user.
See Changing Cache User Names and Passwords in Oracle TimesTen In-Memory Database Cache Guide.
Changing the Oracle Database Schema
Monitoring Autorefresh Operations on Cache Groups
Managing the Change Log Tables and Triggers in the Oracle Database
For a cache group with autorefresh, TimesTen creates a change log table and trigger in the Oracle database for each cache table in the cache group.
The trigger is fired for each committed insert, update, or delete operation on the cached Oracle database table. The trigger records the primary key of the updated rows in the change log table. The cache agent periodically scans the change log table for updated keys and then joins this table with the cached Oracle database table to get a snapshot of the latest updates. See Managing a Cache Environment with Oracle Database Objects in Oracle TimesTen In-Memory Database Cache Guide.
The following sections describe how to gather information from the change log table and how to remove the change log tables and triggers when necessary:
Gathering Information from the Change Log Table
TimesTen provides the cacheInfo
SQL script that gathers information
from the change log table that exists on the Oracle database for autorefresh cache groups.
The following example is run within SQL*Plus on the Oracle database:
SQL> @$TIMESTEN_HOME/install/oraclescripts/cacheInfo.sql
***************** Database Information *********************
Database name: DATABASE1
Unique database name: database1
Primary database name:
Database Role: PRIMARY
Database Open Mode: READ WRITE
Database Protection Mode: MAXIMUM PERFORMANCE
Database Protection Level: UNPROTECTED
Database Flashback On: NO
Database Current SCN: 21512609
*************************************************************
*************Autorefresh Objects Information ***************
Grid name: grid1 (7D03C680-BD93-4233-A4CF-B0EDB0064F3F)
Timesten database name: database1
Cache table name: SALES.READTAB
Change log table name: tt_07_96977_L
Number of rows in change log table: 4
Maximum logseq on the change log table: 1
Timesten has autorefreshed updates upto logseq: 1
Number of updates waiting to be autorefreshed: 0
Number of updates that has not been marked with a valid logseq: 0
****************************
*************No DDL Tracking objects are found*************
PL/SQL procedure successfully completed.
See Displaying Information from the Change Log Tables in Oracle TimesTen In-Memory Database Monitoring and Troubleshooting Guide.
Dropping Oracle Database Objects Used for Caching
See Dropping Oracle Database Objects Used by Cache Groups with Autorefresh in Oracle TimesTen In-Memory Database Cache Guide.