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.

These are the cache-related metadata files that you can provide:
  • cacheUser: This file contains the TimesTen cache manager user. Its format is user/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 contain CREATE CACHE GROUP statements as well as LOAD 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 and ttOptUpdateStats).

    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. The tnsnames.ora and sqlnet.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's sys.odbc.ini file in TimesTen Classic or in the database definition file (dbDef) in TimesTen Scaelout. You must specify the OracleNetServiceName and the DatabaseCharacterSet connection attributes in this file. The DatabaseCharacterSet 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 the schema.sql file and in it include the schema user. You must also assign the appropriate privileges to this schema user. For example, if the oratt schema user was created in the Oracle Database, and this user is not the TimesTen cache manager user, you must create the TimesTen oratt 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 complete examples, see the following: