Oracle® TimesTen In-Memory Database Reference Release 11.2.1 Part Number E13069-03 |
|
|
View PDF |
Description
Start the aging process, regardless of the value of the aging cycle. The aging process begins right after the procedure is called unless there is already an aging process in progress. In that case, the new aging process begins when the aging process that was in process at the time the built-in was called has completed.
Aging occurs only once when you call this procedure. This procedure does not change any aging attributes. The previous aging state is unchanged. For example, if aging state is OFF when you call ttAgingScheduleNow, the aging process starts. When aging is complete, if your aging state is OFF, aging does not continue. To continue aging, you must call ttAgingScheduleNow again or change the aging state to ON, in which case aging occurs next based on the value of the aging cycle.
For tables with aging ON, the aging cycle is reset to the time when ttAgingScheduleNow was called. For example, if you call this procedure at 12:00 p.m. and the aging cycle is 15 minutes, aging occurs immediately and again at 12:15, 12:30, 12:45, etc.
If used in an external scheduler, such as a cron
job, or executed manually, this procedure starts the aging process at the time the procedure is executed, if there is no aging process in progress, or as soon as the current aging process has completed. In the case that you want aging to occur only when the external scheduler executes the ttAgingScheduleNow procedure or you call it manually, set the aging state to OFF.
Aging is performed by a background thread that wakes up every second to check if any work needs to be done. Calling ttAgingScheduleNow only guarantees that the aging thread will work on the tables specified within the next second, at best. If the aging thread is working on a different table at the time the built-in procedure is called, it may take some time to reach the specified table. The rows are visible until the aging thread commits the delete.
This procedure requires the DELETE privilege on the table being aged, or the DELETE ANY TABLE privilege when you do not specify a table.
Syntax
ttAgingScheduleNow ('tblname')
Parameters
ttAgingScheduleNow has the parameter:
Parameter | Type | Description |
---|---|---|
tblname |
TT_CHAR (61) | The name of the table on which to start the aging process.
If |
Result set
ttAgingScheduleNow returns no results.
Examples
To schedule aging on all tables, including tables defined with both LRU aging and time-based aging, call ttAgingScheduleNow without any parameter values:
CALL ttAgingScheduleNow ();
This examples creates the table agingex
with time-based aging policy and the aging state set to OFF. ttAgingScheduleNow is called, using the ttIsql utility, to start the aging process once. Rows are deleted from the table. After ttAgingScheduleNow is called, the aging state remains OFF. To continue aging, alter the table and set the aging state to OFF.
Command> CREATE TABLE agingex (col1 TT_INTEGER PRIMARY KEY NOT NULL, ts TIMESTAMP NOT NULL) AGING USE ts LIFETIME 1 MINUTES CYCLE 30 MINUTES OFF; Command> DESCRIBE agingex; Table TTUSER.AGINGEX: Columns: *COL1 TT_INTEGER NOT NULL TS TIMESTAMP (6) NOT NULL Aging use TS lifetime 1 minute cycle 30 minutes off 1 table found. (primary key columns are indicated with *) Command> INSERT INTO agingex VALUES (1, SYSDATE); 1 row inserted. Command> INSERT INTO agingex VALUES (2, SYSDATE); 1 row inserted. Command> SELECT * FROM agingex;
< 1, 2007-03-25 13:06:29.000000 > < 2, 2007-03-25 13:06:42.000000 > 2 rows found. Command> CALL ttAgingScheduleNow ('agingex'); Command> SELECT * FROM agingex; 0 rows found.
See also