Setting up your system for real-time statistics

You can use real-time statistics to determine when objects require maintenance by utilities such as REORG, RUNSTATS, or COPY. These statistics can also be used to automate the scheduling of such utility jobs.

About this task

Db2 always generates in-memory statistics for each table space and index space in your system, including catalog objects. Db2 periodically writes these real-time statistics to certain catalog tables, at a specified interval. You can use these real-time statistics to determine when objects require maintenance by utilities such as REORG, RUNSTATS, or COPY. These statistics can also be used to automate the scheduling of such utility jobs.

For partitioned spaces, Db2 generates information for each partition. However, no statistics are generated for the real-time statistics table spaces (SYSTSTSS and SYSTSISS) and the corresponding index spaces. Similarly Db2 does not generate statistics for certain items in the directory, such as the SYSLGRNX table space and its corresponding indexes DSNLLX01 and DSNLLX02, for example.

Procedure

  1. Set the interval for writing real-time statistics to the tables.
    You can modify STATSINT subsystem parameter to set the interval. The default interval is 30 minutes.
  2. Run the appropriate utilities to establish baseline values for the real-time statistics.
    Many columns in the real-time statistics tables show the number of times that an operation occurred between the last time a particular utility was run and the time when the real-time statistics are written. Therefore, starting values are needed. For example, STATSINSERT in SYSTABLESPACESTATS indicates the number of records or LOBs that have been inserted after the last RUNSTATS utility was run on the table space or partition.