Disabling Full Autorefresh for Cache Groups
If performance is a concern, you can set the
DisableFullAutorefresh cache configuration
parameter to 1 to disallow full autorefresh requests for all cache groups
defined with incremental autorefresh.
If you do disallow full autorefresh, then the initial load for each cache group requires a manual load since the initial load requires a full refresh.
You can disable full autorefresh using the DisableFullAutorefresh cache configuration parameter in both TimesTen Classic and TimesTen Scaleout.
Note:
The default value is 0 for the DisableFullAutorefresh cache configuration parameter, which specifies full autorefresh behavior. Full autorefresh is only supported on TimesTen Classic.
call ttCacheConfig('DisableFullAutorefresh',,,'1');You can query the current value of the DisableFullAutorefresh parameter.
call ttCacheConfig('DisableFullAutorefresh');If a full autorefresh is triggered for a cache group, TimesTen changes the cache
group status to disabled. After which, all
autorefresh operations cease on the cache group. You are
notified of this action with a message logged in both the daemon
and user log files. See Error,
Warning, and Informational Messages in the
Oracle TimesTen In-Memory Database Operations
Guide.
The TimesTen database status is set to recovering when at least one of its cache groups have an autorefresh status of disabled or recovering. You can check the state of a database and cache group with the ttCacheDbCgStatus built-in procedure. The following example shows that:
-
Recovering: Some or all the cache groups with theAUTOREFRESHattribute in the database are being resynchronized with the Oracle database server. The status of at least one cache group isrecovering. -
Disabled: Thecg1cache group isdisabled.
Command> call ttCacheDbCgStatus('ttuser','cg1');
< recovering, disabled >
1 row found.When you set the DisableFullAutorefresh cache configuration parameter to 1, then the DeadDbRecovery cache configuration parameter automatically changes to Manual. TimesTen restores the original setting for the DeadDbRecovery cache configuration parameter if you change the DisableFullAutorefresh cache configuration parameter to 0.
If the autorefresh status of a cache group is either disabled or dead, its cache tables are no longer being automatically refreshed when updates are committed on the cached Oracle Database tables. The cache group must be recovered in order to resynchronize the cache tables with the cached Oracle Database tables.
-
For each cache group whose autorefresh status is disabled, a
REFRESH CACHE GROUPstatement must be issued in order to resume autorefresh operations for these cache groups. -
For each dynamic cache group whose autorefresh status is disabled, an
UNLOAD CACHE GROUPstatement must be issued in order to resume autorefresh operations for these cache groups. -
See Impact of Failed Autorefresh Operations on TimesTen Databases for details on how to specify recovery when the autorefresh status of a cache group is
dead.
The following example shows the steps to manually refresh a disabled cache group.
-
Pause autorefresh for the cache group and return the cache group status to
OKwith theALTER CACHE GROUP SET AUTOREFRESH STATE PAUSEDstatement. -
Manually request a full refresh with the
REFRESH CACHE GROUPstatement (optionally, with parallelism).
ALTER CACHE GROUP cg_static SET AUTOREFRESH STATE PAUSED; REFRESH CACHE GROUP cg_static COMMIT EVERY 500 ROWS PARALLEL 2;
Perform the following to reload a dynamic cache group:
-
To return the cache group status to
OK, pause autorefresh for the cache group with theALTER CACHE GROUP SET AUTOREFRESH STATE PAUSEDstatement. -
Unload the disabled dynamic cache group with the
UNLOAD CACHE GROUPstatement. -
Optionally, you can load the cache group with the
LOAD CACHE GROUPstatement (optionally, with parallelism) or initiate a dynamic load. See Dynamic Cache Groups.
The following example reloads the cg dynamic cache group:
ALTER CACHE GROUP cg_dynamic SET AUTOREFRESH STATE PAUSED; UNLOAD CACHE GROUP cg_dynamic COMMIT EVERY 500 ROWS; LOAD CACHE GROUP cg_dynamic COMMIT EVERY 500 ROWS PARALLEL 2;