Choose a topic
Unloading a cache groupYou 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.Use caution when using the UNLOAD CACHE GROUP statement with autorefresh cache groups. 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.Execution of the UNLOAD CACHE GROUP statement for an AWT cache group waits until updates on the rows have been propagated to the Oracle database.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.Note:For more information, see "UNLOAD CACHE GROUP" in the Oracle TimesTen In-Memory Database SQL Reference.Example 5-9 Unloading cache groupsThe following statement 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 (oratt.customer.cust_num = 227);Unloading a cache group across all grid membersYou can unload a cache group in all members of a cache grid by setting an optimizer flag. Before executing the UNLOAD CACHE GROUP statement, call the ttOptSetFlag built-in procedure and set the GlobalProcessing optimizer flag to 1:Note:The unload operation does not execute across multiple grid nodes when using the COMMIT EVERY n ROWS clause, regardless of the state of the GlobalProcessing optimizer flag.CALL ttOptSetFlag('GlobalProcessing', 1);Consider this statement:UNLOAD CACHE GROUP customer WHERE customer_id=54321;A local unload operation removes the customer record only if the record exists on the node where the statement is executed. A global unload operation removes the customer record regardless of which node contains the record.
Unloading a cache group