Updating real-time statistics immediately

You can issue a command to externalize in-memory statistics to the real-time statistics catalog table immediately.

About this task

Normally, in-memory statistics are externalized to the real-time statistics table only when the interval specified by the STATSINT subsystem parameter elapses. The result can be problematic when operations, such as DSNACCOX stored procedure, that depend upon accurate statistics are invoked long after that last interval period, especially for objects that are subject to frequent changes.

Procedure

To immediately externalize in-memory statistics to the real-time statistics tables:

Issue the ACCESS DATABASE command, and specify the MODE(STATS) option.
For example, you might issue the following command to externalize all in-memory statistics for the subsystem to the realtime statistics tables:
ACCESS DB(*) SP(*) MODE(STATS)
Although ranges and partial asterisk values, such as DB(A:B) or DB(A*), are supported for the DB or SP options, the results are inefficient. Therefore, the recommendation is to avoid specifying range or partial asterisks for these values whenever possible, usually by specifying to the next higher object level instead. The following table shows the recommended combinations of values for different object levels:
Option Description
Partition-level statistics ACCESS DB(db-name) SP (sp-name) MODE (STATS) PART (partition-name)
Tablespace level statistics ACCESS DB(db-name) SP (sp-name) MODE (STATS)
Database-level statistics ACCESS DB(db-name) SP (*) MODE (STATS)
Subsystem-level statistics ACCESS DB(*) SP (*) MODE (STATS)