ttDBCompactConfig

The ttDBCompactConfig built-in procedure turns on automatic database compaction. By default, TimesTen does not compact databases automatically.

Required Privilege

This procedure requires ADMIN privilege.

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 these related views.

SYS.GV$DB_COMPACT_CONFIG

SYS.V$DB_COMPACT_CONFIG

Syntax

ttDBCompactConfig([[value][,[value]][,[value]]])

Parameters

ttDBCompactConfig has the parameters:

Parameter Type Description

quantum

TT_INTEGER

Specifies the number of data blocks to be compacted. Values from 0 to 100000 are allowed. A value of 0 means that automatic database compaction is disabled.

compactsPerSecond

TT_INTEGER

Number of compaction operations that can occur per second. Values from 0 to 100 are allowed. A value of 0 means that automatic database compaction is disabled.

threshold

TT_INTEGER

Specifies the minimum amount of the database that needs to be compacted, before automatic database compaction occurs. The units are the same as for parameter quantum. Values from 0 to 100000 (100k) are allowed. A value of 0 means that the compaction operations runs whenever there is anything to compact in the database.

Result Set

ttDBCompactConfig returns the result set:

Column Type Description

quantum

TT_INTEGER NOT NULL

Currently active setting for quantum.

compactsPerSecond

TT_INTEGER NOT NULL

Currently active setting for compactsPerSecond.

threshold

TT_INTEGER NOT NULL

Currently active setting for threshold.

Examples

To view the current settings for automatic database compaction, use:

CALL ttDbCompactConfig;
< 0,0,0 >
1 row found.

Note:

These are the default settings. Automatic database compaction is disabled if either of the first two parameters is 0.

To enable automatic database compaction on 1,000 blocks once a second, use:

CALL ttDbCompactConfig (1000,1,0);
< 1000,1,0 >
1 row found.

To enable automatic database compaction on 5,000 blocks ten times a second, use:

CALL ttDbCompactConfig (5000,10,0);
< 5000,10,0 >
1 row found.

To enable automatic database compaction on 2,000 blocks five times a second, but only perform compaction when there is at least this much to compact, use:

CALL ttDbCompactConfig (2000,5,2000);
< 2000,5,2000 >
1 row found.

To stop automatic database compaction from doing further compaction, after it was turned on (note that it is off by default), use:

CALL ttDbCompactConfig (0,0,0);

You can set just one or two values at a time, using commas as placeholders:

CALL ttDBCompactConfig(2000,5,2000);
< 2000, 5, 2000 >
1 row found.
call ttDBCompactConfig(3000);
< 3000, 5, 2000 >
1 row found.
call ttDBCompactConfig(,10);
< 3000, 10, 2000 >
1 row found.
call ttDBCompactConfig(,,2500);
< 3000, 10, 2500 >
1 row found.
call ttDBCompactConfig(3500,,3000);
< 3500, 10, 3000 >
1 row found.

Notes

  • After using this built-in procedure to set a parameter value, initiate a checkpoint to ensure the persistence of the parameter change. See details about the ttCkpt procedure in Checkpoint Operations in the Oracle TimesTen In-Memory Database Operations Guide. For details about the checkpoint built-in procedure, see ttCkpt in this chapter.

  • You can specify one, two, or three input values, using commas as placeholders, or no input to see the current values.

  • Changes to parameter values made by ttDBCompactConfig cannot be rolled back.

See Also

ttDBConfig