Unloading a Cache Group

You can delete some or all cache instances from the cache tables in a cache group with the UNLOAD CACHE GROUP statement.

Unlike the DROP CACHE GROUP statement, the cache tables themselves are not dropped when a cache group is unloaded.

To prevent an unload operation from processing a large number of cache instances within a single transaction, which could reduce concurrency and throughput, use the COMMIT EVERY n ROWS clause to specify a commit frequency.

Use caution when using the UNLOAD CACHE GROUP statement with cache groups with autorefresh. An unloaded row can reappear in the cache table as the result of an autorefresh operation if the row, or its related parent or child rows, are updated in the cached Oracle Database table.

Processing of the UNLOAD CACHE GROUP statement for an AWT cache group waits until updates on the rows have been propagated to the Oracle database.

The following example unloads all cache instances from all cache tables in the customer_orders cache group. A commit frequency is specified, so the operations is performed over several transactions by committing every 256 rows:

UNLOAD CACHE GROUP customer_orders COMMIT EVERY 256 ROWS;

The following statement unloads all cache instances from all cache tables in the customer_orders cache group in a single transaction. A single transaction should only be used if the data within customer_orders is small:

UNLOAD CACHE GROUP customer_orders;

The following equivalent statements delete the cache instance for customer number 227 from the cache tables in the new_customers cache group:

UNLOAD CACHE GROUP new_customers WITH ID (227);
UNLOAD CACHE GROUP new_customers WHERE (sales.customer.cust_num = 227);

See UNLOAD CACHE GROUP in the Oracle TimesTen In-Memory Database SQL Reference.