Combining autonomic and manual statistics maintenance

When autonomic statistics maintenance is enabled, you can still invoke the RUNSTATS utility to capture statistics manually.

About this task

When autonomic statistics monitoring and maintenance is enabled, Db2 uses statistics profiles to maintain the statistics for each table that is not excluded from autonomic maintenance. However, you can still explicitly invoke the RUNSTATS utility at any time either in the traditional manner, or by using profiles at any time.

Procedure

To effectively combine autonomic and manual statics maintenance activities, you might follow the following recommendations:

  • Before enabling autonomic statistics maintenance, consider whether to delete all existing statistics profiles by issuing RUNSTATS control statements and specifying the DELETE PROFILE option.
    By doing that, you enable Db2 to create new statistics profiles based on analysis of your existing statistics. However, this step is optional if you prefer that Db2 uses the settings of your existing RUNSTATS profiles for autonomic maintenance.
  • When you want to collect statistics with different settings than those that are used for autonomic maintenance, run the RUNSTATS utility explicitly and specify the options that you want to use.
    Invoking RUNSTATS in that manner has no impact on the options that are specified in the profile, and periodic autonomic maintenance can continue unchanged. Start of changeFL 507 However, manually running RUNSTATS does not update the profile, and Db2 deletes any statistics not specified in the profile when it is next used.End of change Consequently, you might want to update the profile to use the new options that were specified when you manually collected statistics.
  • When you want to manually collect statistics outside of the autonomic maintenance windows, but with the usual settings, you can specify the USE PROFILE option in the RUNSTATS control statement.
  • When you want to modify the settings that are used for autonomic maintenance, you can issue a RUNSTATS control statement with the UPDATE PROFILE option and specify that options that you want to change.
    After you update the profile, Db2 uses the new options for autonomic maintenance activities.