Creating a Cache Group
You create cache groups by using a CREATE CACHE GROUP
SQL statement or by using Oracle SQL Developer, a graphical tool.
For more information about SQL Developer, see Oracle TimesTen In-Memory Database SQL Developer Support User's Guide.
Cache groups must be created by and are owned by the TimesTen cache administration user.
You cannot cache Oracle Database data in a temporary database.
Cache groups are identified as either system managed or user managed. System managed cache groups enforce specific behaviors, while the behavior of a user managed cache group can be customized.
System managed cache groups include:
-
Read-Only Cache Group: Committed updates on the cached Oracle Database tables are automatically refreshed to the cache tables on TimesTen. The TimesTen cache tables cannot be updated directly.
-
Asynchronous WriteThrough (AWT) Cache Group: Committed updates on the TimesTen cache tables are automatically and asynchronously propagated to the cached Oracle Database tables.
-
Synchronous WriteThrough (SWT) Cache Group: Committed updates on the TimesTen cache tables are automatically and synchronously propagated to the cached Oracle Database tables.
-
Hybrid Cache Group: Dynamically load committed updates from cache tables that do not have a root table on the Oracle database.
User Managed Cache Group: Customize caching behavior. If the system managed cache groups do not satisfy your application's requirements, you can create a user-managed cache group that defines customized caching behavior with cache table attributes.
You can define how data is loaded:
-
Static cache group: Cache instances are loaded manually into the TimesTen cache tables.
-
Dynamic cache group: Cache instances are loaded into the TimesTen cache tables on demand from an Oracle database using a dynamic load operation or manually using a load operation.
See Transmitting Changes Between the TimesTen and Oracle Databases.
The following topics also apply to creating a cache group:
-
Creating a Dynamic Cache Group With the DYNAMIC Keyword that enables dynamic load of new cache instances updated on cached Oracle database tables into TimesTen cache groups.
-
Automatically Refreshing a Cache Group: The
AUTOREFRESH
cache table attribute specifies that committed changes on cached Oracle Database tables are automatically refreshed to read-only TimesTen cache tables. -
Using a WHERE Clause: You can restrict the rows to cache in the TimesTen database for particular cache group types.
-
ON DELETE CASCADE Cache Table Attribute: Specifies that when rows containing referenced key values are deleted from a parent table, rows in child tables with dependent foreign keys are also deleted.
-
Creating a Hash Index on the Primary Key Columns of the Cache Table: Specifies that a hash index rather than a range index is created on the primary key columns of the cache table.