RUNSTATS options

RUNSTATS gathers statistics about the data in table spaces and indexes and records the statistics in the Db2 catalog.

About this task

RUNSTATS statistics help Db2 determine access paths at bind time. Some of the options that can be set when specifying the RUNSTATS utility include:

  • Whether you want RUNSTATS to update the catalog
  • The application share level
  • Whether you want to generate a report
Note: You can use object profiles to set column-level RUNSTATS statistics for indexes or tables. Using the column-level statistics settings will override the settings in the RUNSTATS utility profile. Refer to the topic Specifying object-specific utility options for information about this feature.

When you specify to set RUNSTATS options, the panel that is shown in the following figure is displayed:

Figure 1. Runstats Options panel
 AUTOXPRT V1R1 ------------- Runstats Options ------------ 2024/08/26  12:04:21 
 Option   ===>                                                 Scroll ===> CSR  
   Creator: TWUSR      Name: RUNSTATS TEST                    User: TWUSR       
                                                     Db2 Subsystem: SS01        
                                                                    More:     + 
   Exception Rule . . . . . . A (A - Accepted, R - Rejected, B - Both)          
   Utility ID . . . . . . . .                   (16 characters)                 
   Sharelevel . . . . . . . . R (R - Reference, C - Change)                     
     Register . . . . . . . .   (blank, Y - Yes, N - No)                        
   Report . . . . . . . . . . Y (Yes/No)                                        
   Update Catalog Tables  . . N (A - All, C - aCcesspath, S - Space, N - None)  
   Update History Tables  . . N (A - All, C - aCcesspath, S - Space, N - None)  
   Reset Accesspath . . . . . N (Yes/No)                                        
      History Accesspath  . . N (Yes/No)                                        
   Force Rollup . . . . . . .   (blank, Y - Yes, N - No)                        
   Invalidate Cache . . . . . N (Yes/No)                                        
   Table All  . . . . . . . . Y (Yes/No)                                        
      Sample  . . . . . . . . 25     (Percent)                                  
      TableSample . . . . . .        (Auto, 0.01 - 100.00, None)                
        Repeatable  . . . . .        (Number)                                   
   Index  . . . . . . . . . . A (A - All, N - No, P - Part)                     
      Keycard . . . . . . . . N (Yes/No)                                        
      Update Statistics . . . N (Yes/No)                                        
   Save Stats in Repository   N (Yes/No)                                        
   Group Partitions by  . . . N (J - Job, S - Step, N - None)                   
   Profile  . . . . . . . . .   (Blank - Not used, U - Use,                     
                                 I - use Include npi, D - Delete,               
                                 P - uPdate, S - Set,                           
                                 E - set from Existing stats)                   
   Sort Device Type  . . . .            (CART/DISK/etc.)                        
   Sort Number  . . . . . . .     (2-255)                                       
   Stat Colgroup Mem Sort . .            (Integer, Blank)                       
  Optional Skeletals          -BEFORE-     -AFTER-                              
   JCL Skeletal . . . . . . .          . .          (8 Character Name)          
   Control Cards Skeletal . .          . .          (8 Character Name)          
   Step End Skeletal  . . . .          . .          (8 Character Name)          
                                                                                

Procedure

  1. Set the Exception Rule field.
  2. Set other fields on the panel as desired.
    Refer to the help panel for detailed information about the fields on this panel.
  3. If you want index statistics to be collected during the REBUILD INDEX, configure the type of statistics to be collected as follows:
    1. Enter A or P in the Index field.
    2. Enter Y in the Update statistics field and press Enter.
    3. On the Runstats Utility Column Statistics panel, follow the instructions in Setting RUNSTATS column statistics to complete configuring the statistics.