ttCacheCheck

The ttCacheCheck built-in procedure performs a check for missing constraints for cached tables on the Oracle database.

Any unique index, unique constraint, or foreign key constraint on columns in Oracle Database tables that are to be cached should also be created on asynchronous writethrough cache tables within TimesTen. If you have not created these constraints on the AWT cache tables and you have configured the cache group for parallel propagation, TimesTen serializes any transactions with DML operations to those tables with missing constraints.

This procedure provides information about missing constraints and the tables marked for serialized propagation.

Call ttCacheCheck to manually check for missing constraints, under these conditions:

  • After completing a series of DROP CACHE GROUP statements.

  • After creating or dropping a unique index or foreign key on the Oracle database.

  • To determine why some transactions are being serialized.

This procedure updates system tables to indicate if DML executed against a table should or should not be serialized, therefore you must commit or roll back after the ttCacheCheck built-in completes.

See Improving AWT Throughput with Parallel Propagation to the Oracle Database in Oracle TimesTen In-Memory Database Cache Guide.

Required Privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in both TimesTen Classic and TimesTen Scaleout.

Related Views

This procedure has no related views.

Syntax

ttCacheCheck('operation', cgOwner, cgName)

Parameters

ttCacheCheck has these parameters:

Parameter Type Description

operation

TT_VARCHAR(30)

Specifies the constraint to be checked. Supported values are:

  • ForeignKey - Checks foreign key constraints

  • Unique - Checks unique constraints

  • Awt - Checks both foreign key and unique constraints

  • NULL - Checks both foreign key and unique constraints

cgOwner

TT_VARCHAR(30)

Specifies the owner of the cached Oracle database table.

If NULL, checks all asynchronous writethrough cache groups owned by the connection user.

If both cgOwner and cgName are NULL, checks all asynchronous cache groups.

cgName

TT_VARCHAR(30)

Specifies the name of the cached Oracle database table.

If NULL, but the cgOwner is specified checks all asynchronous writethrough cache groups owned by cgOwner.

If both cgOwner and cgName are NULL, checks all asynchronous cache groups.

Result Set

ttCacheCheck returns the result set:

Column Type Value

cgOwner

TT_VARCHAR(30) NOT NULL

The owner of the cache group.

cgName

TT_VARCHAR(30) NOT NULL

The name of the cache group.

tblOwner

TT_VARCHAR(30)

The owner of the table.

tblName

TT_VARCHAR(30)

The name of the table.

objectType

TT_VARCHAR(15)

The type of Oracle object: unique index, constraint or foreign key.

objectOwner

TT_VARCHAR(30)

The owner of the Oracle object.

objectName

TT_VARCHAR(30)

The object name.

msgType

TT_SMALLINT NOT NULL

The type of message:

0 = Informational

1 = Warning

-1 = Error

msg

TT_VARCHAR(100000) NOT NULL

Message describing the issue.

objectDesc

VARCHAR2(200000)

A description of the object. If the object is AWT checking, the description is the SQL statement that describes the object.

Examples

The following example determines if there are any missing constraints for the cache group update_orders that is owned by cacheadmin. A result set is returned that includes the warning message. The ordertab table in the update_orders cache group is marked for serially propagated transactions.

Command> call ttCacheCheck( NULL, 'cacheadmin, 'update_orders');

< CACHEADMIN, UPDATE_ORDERS, CACHEADMIN, ORDERTAB, Foreign Key, CACHEADMIN, 
CUST_FK, 1, Transactions updating this table will be serialized to Oracle
because: The missing foreign key connects two AWT cache groups., 
table CACHEADMIN.ORDERTAB constraint CACHEADMIN.CUST_FK foreign key(CUSTID) 
references CACHEADMIN.ACTIVE_CUSTOMER(CUSTID) >
1 row found.

This procedure is available only for cache operations.