13 Work with TimesTen Cache
The TimesTen Operator supports the use of TimesTen Cache with TimesTen Classic and TimesTen Scaleout in your Kubernetes environment.
About Using TimesTen Cache
The TimesTen Operator provides interfaces that you can use in TimesTen Classic and TimesTen Scaleout to configure cache groups.
-
cacheUser
: This file contains the TimesTen cache manager user. Its format isuser/ttpwd/orapwd
, containing the username, TimesTen password, and Oracle password for the user. The Oracle user (called the cache administration user in Oracle Database) must exist prior to creating and deploying TimesTen Classic or TimesTen Scaleout. The Operator creates the TimesTen user in the the TimesTen database with the given name and password. The Operator also grants this user the appropriate privileges.Here is an example:cachemanageruser/ttmgrpwd/oramgrpwd
See cacheUser for more information.
-
cachegroups.sql
: This file may containCREATE
CACHE
GROUP
statements as well asLOAD
CACHE
GROUP
statements for the Operator to automatically run when the TimesTen database is created. The file also contains TimesTen built-in procedures to update statistics on the cache group tables (such as,ttOptEstimateStats
andttOptUpdateStats
).Here is an example:CREATE READONLY CACHE GROUP readcache AUTOREFRESH INTERVAL 5 SECONDS FROM oratt.readtab ( keyval NUMBER NOT NULL PRIMARY KEY, str VARCHAR2(32) ); LOAD CACHE GROUP readcache COMMIT EVERY 256 ROWS;
See cachegroups.sql for more information.
If you provide the cacheUser
and cachegroups.sql
files, the Operator uses them to provision TimesTen Cache when a new database is created.
The following metadata files are also relevant for TimesTen Cache:
-
tnsnames.ora
: This file is required. It defines Oracle Net Services that applications connect to. For TimesTen Cache, this file configures the connectivity between the TimesTen and the Oracle Database (from which data is being cached). In this context, TimesTen is the application that is the connection to the Oracle Database. See tnsnames.ora for details. -
sqlnet.ora
: This file is optional. However, it may be necessary depending on your Oracle Database configuration. The file defines options for how client applications communicate with the Oracle Database. In this context, TimesTen is the application. Thetnsnames.ora
andsqlnet.ora
files together define how an application communicates with the Oracle Database.See sqlnet.ora for details.
-
db.ini
: This file is required. Its contents contain TimesTen connection attributes for your TimesTen database. The files are included in TimesTen'ssys.odbc.ini
file in TimesTen Classic or in the database definition file (dbDef) in TimesTen Scaelout. You must specify theOracleNetServiceName
and theDatabaseCharacterSet
connection attributes in this file. TheDatabaseCharacterSet
value must match the value of the Oracle database character set value.See db.ini for details.
-
schema.sql
: This file may be required. In TimesTen Cache, one or more cache table users own the cache tables. If this cache table user is not the cache manager user, then you must specify theschema.sql
file and in it include the schema user. You must also assign the appropriate privileges to this schema user. For example, if theoratt
schema user was created in the Oracle Database, and this user is not the TimesTen cache manager user, you must create the TimesTenoratt
user in this file.The instance administrator uses the
ttIsql
utility to run this file immediately after the database is created. This file is run before the Operator configures TimesTen Cache, so ensure there are no cache definitions in this file.See Create the Oracle Database Users for more information on the schema users in the Oracle Database. See schema.sql for details about the
schema.sql
file.
In TimesTen Classic, the contents of the cachegroups.sql
file runs on the active database before it is duplicated to the standby. If there are autorefresh cache groups specified in the cachegroups.sql
file, they are paused by the agent prior to duplicating the active database to the standby. After the duplication process completes, these autorefresh cache groups are re-enabled.
In TimesTen Scaleout, the contents of the cachegroups.sql
file runs during database creation.
Once created and rolled out, the Operator does not monitor or manage TimesTen Cache. Specifically, the Operator does not monitor the health of the cache agents, nor does it take further action to start or stop them. In addition, the Operator does not verify that data is propagating correctly between the TimesTen database and the Oracle Database.
If you delete your TimesTenClassic or TimesTenScaleout object, the Operator automatically cleans up the Oracle Database metadata. If, however, you want to retain the Oracle Database metadata, specify the cacheCleanUp
datum in your TimesTenClassic or TimesTen Scaleout object definition and set its value to false
. See cacheCleanup
datum in TimesTenClassicSpecSpec and TimesTenScaleoutSpecSpec.
-
For TimesTen Classic deployments: See TimesTen Cache in TimesTen Classic Example.
-
For TimesTen Scaleout deployments: See TimesTen Cache in TimesTen Scaleout Example.