Show TOC

Example documentation-force with Update Statistics Locate this document in the navigation structure

 

This section gives examples of how you can use the -force options to override the internal rules for update statistics. For more information about the -force options, see -f stats.

Caution Caution

Only use these options in exceptional circumstances.

End of the caution.
  • Check and update statistics for all tables in tablespace PSAPBTAD

    brconnect -u / -c -f stats -t psapbtabd -f allsel

  • Update statistics without check for all tables relevant to the application monitor

    brconnect -u / -c -f stats -t dbstatc_mon -f collect

  • Update statistics for a pool table specified in the DBSTATC table with the ACTIVE flag set to N, to determine space usage, using method “estimate 10% rows”:

    brconnect -u / -c -f stats -t atab -m EI -s P10 -f allsel,method,sample,collect,space

    BRCONNECT stores the space usage data in tables DBSTATTORA (for tables) and DBSTATIORA (for indexes). Finally, the statistics can be immediately deleted - for example, when the ACTIVE flag is set to N in DBSTATC.

    If you want to keep the statistics for such tables – for example, for test purposes – you must include the keep option in the command, as follows:

    brconnect -u / -c -f stats -t rfblg -m EI -s P10 -f allsel,method,sample,keep

    Caution Caution

    Option -m EI locks the relevant indexes.

    End of the caution.
  • Check and update statistics according to the two-phase concept:

    1. First phase: check statistics

      brconnect -u / -c -f stats -t all -f nocoll

    2. Second phase: update statistics on tables identified in the first phase

      brconnect -u / -c -f stats -t all -f nocheck