ttStatsConfig

The ttStatsConfig built-in procedure controls statistics collection and parameters for the ttStats utility. This procedure takes a name/value pair as input and outputs a single row result set corresponding to the name/value pair parameters.

Required Privilege

This procedure requires the ADMIN privilege.

Related Views

This procedure has no related views.

Syntax

ttStatsConfig('param', [value], [option])

Parameters

ttStatsConfig has the parameters:

Parameter Type Description

param

VARCHAR2(50) NOT NULL

The name of the parameter to configure.

value

VARCHAR2(200)

The value of the specified parameter. If no value is supplied, the built-in procedure displays the current value for the specified parameter.

option

VARCHAR2 (200)

The value of a second optional parameter, for example con_id for LatchStats.

Parameter / Value Pairs

These parameter/value pairs can be set with TimesTen:

Parameter Value Description

ConnSampleFactor

C,S

0<=C<=Connections

0<=S<=60000000

Specifies the frequency at which a specific connection is sampled.

C – Stands for the connection ID to be sampled. For connection ID, see ttXactIdGet.

Connections – Represents the total number of connections to the database.

S – Is the sampling factor. The default value is 0 and indicates that sampling is turned off. A value greater than 0 indicates that a sample is taken at that interval of statements for the connection specified.

LatchStats

scope,level

scope=conn|db|con_id

level=NONE|TYPICAL|

ALL|BASIC

Specifies the scope, scope, and the level, level, for collection for latch statistics.

The scope value determines at what level TimesTen should collect latch statistics:

  • conn - Collects latch statistics for your current connection.

  • db - Collects latch statistics for your database.

  • con_id - Collects latch statistics for the connection id that you specify.

The level value determines the level at which TimesTen collects statistics:

  • NONE - Disables the collection of latch statistics.

  • TYPICAL - Ensures the collection of major useful latch statistics.

  • ALL - Additional statistics are added to the set of statistics collected with the TYPICAL setting. The additional statistics include internal and debugging statistics.

  • BASIC - Disables the collection of many of the important latch statistics.

If latch statistics are enabled, TimesTen allocates around 100KB from temporary memory to store these statistics.

Once you have configured the LatchStats parameter, you can use the ttLatchStatsGet built-in procedure to view latch statistics. See ttLatchStatsGet for more information.

SQLCmdHistogramReset

0 or not

The existing SQL run time statistics are reset if the specified value is nonzero.

SQLCmdSampleFactor

0 <= value <= 60000000

The frequency at which a SQL command sample is taken. The default is 0. A value of 0 indicates that sampling is turned off. A value greater than 0 indicates that a sample is taken at that interval of SQL statements. For example, a value of 10 indicates that for every 10th SQL statement run, the wall clock time of that run is captured.

StatsLevel

NONE

TYPICAL

ALL

BASIC

Specifies the level of collection for database statistics. TimesTen stores theses statistics in system tables.

Setting the StatsLevel parameter to NONE disables the collection of system statistics.

The default setting of TYPICAL ensures collection of major useful statistics and should be adequate for most environments.

When the StatsLevel parameter is set to ALL, additional statistics are added to the set of statistics collected with the TYPICAL setting. The additional statistics include internal and debugging statistics.

Setting the StatsLevel parameter to BASIC disables the collection of many of the important statistics required by many TimesTen features.

Note:

There are two ttStatsConfig calls that configure the collection of histogram data for SQL commands.
  • ttStatsConfig('SQLCmdSampleFactor', S) enables SQL histogram collection for all connections and the frequency at which a SQL command sample is taken. The value of the sampling factor S should be greater than 0.
  • ttStatsConfig('ConnSampleFactor', 'C, S') enables SQL histogram collection for a connection to the database (C ) and the frequency at which a specific connection is sampled. The value of the sampling factor S should be greater than 0.

If the sampling factor value is greater than 0 for both calls, then the value for ttStatsConfig('ConnSampleFactor', 'C, S') takes precedence. If the sampling factor value is set to 0 for both parameters, then the sampling is turned off.

Result Set

ttStatsConfig returns the result set:

Column Type Description

param

VARCHAR2(50) NOT NULL

The name of the parameter that was configured.

value

VARCHAR2(200)

The value of the specified parameter. If no value is supplied, the built-in procedure displays the current value for the specified parameter.

Examples

These are supported examples:

Sample every command:

Command> call ttStatsConfig('SqlCmdSampleFactor',1);
< SQLCMDSAMPLEFACTOR, 1 >
1 row found.

Check sampling:

Command> call ttStatsConfig('SqlCmdSampleFactor');
< SQLCMDSAMPLEFACTOR, 1 >
1 row found.
 

Sample every fifth statement on connection 1.

Command> call ttStatsConfig('ConnSampleFactor', '1,5');
< CONNSAMPLEFACTOR, 1,5 >
1 row found.

Turn off sampling on connection 1.

Command> call ttStatsConfig('ConnSampleFactor', '1,0');
< CONNSAMPLEFACTOR, 1,0 >
1 row found.
 

Check data store statistics collection level.

Command> call ttstatsconfig('StatsLevel');
< STATSLEVEL, TYPICAL >
1 row found.
 

Turn off data store statistics collection.

Command> call ttstatsconfig('StatsLevel','None');
< STATSLEVEL, NONE >
1 row found.