ttAgingScheduleNow

The ttAgingScheduleNow procedure starts the aging process, regardless of the value of the aging cycle. The aging process begins right after the procedure is called unless there is 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, and so on.

If performed manually or in an external scheduler (such as a cron job), this procedure starts the aging process at the time the procedure is performed (if there is no aging process in progress) or as soon as the current aging process has been completed. In the case that you want aging to occur only when the external scheduler runs 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 must be done. Calling ttAgingScheduleNow only guarantees that the aging thread works on the specified tables 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.

Required Privilege

This procedure requires the DELETE privilege on the table being aged, or the DELETE ANY TABLE privilege when you do not specify a table.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure runs locally on the element from which it is called.

Related Views

This procedure has no related views.

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 tblName is omitted, the aging process is started on all tables defined with any aging policy.

Using a synonym to specify a table name is not supported.

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 ();

In this example, the user sampleuser1 (not the instance administrator) creates the table agingex with time-based aging policy and the aging state set 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 SAMPLEUSER1.AGINGEX:
    Columns:
     *COL1   TT_INTEGER NOT NULL
      TS     TIMESTAMP (6) NOT NULL
    PRIMARY KEY (COL1) RANGE INDEX
    Aging: Timestamp based uses column TS lifetime 1 minute cycle 30 minutes off
  
  1 table found.
  (primary key columns are indicated with *)

The user inserts two rows with data. Then the user calls the ttAgingScheduleNow procedure and the rows are deleted from the table. After ttAgingScheduleNow is called, the aging state remains OFF.

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, 2022-11-08 23:57:00.000000>
< 2, 2022-11-08 23:57:18.000000>
2 rows found.

Command> CALL ttAgingScheduleNow ('agingex');
Command> SELECT * FROM agingex;
0 rows found.

See Also