RUNSTATS


The RUNSTATS option allows you to combine the production of image copies and the collection of Db2 statistics in a single pass of a table space or partition. The subordinate RUNSTATS options, REPORT, BMCSTATS, and UPDATE allow you to report the statistics in SYSPRINT and update the BMC or Db2 catalog with the statistics.

RUNSTATS syntax diagram

GUID-ABBAFC03-3C45-489A-A91B-4505E90652DD-low.png

Important

RUNSTATS is not valid with FULL NO, FULL AUTO, or CHANGELIMIT (incremental) copies.

For a description of the statistics produced by RUNSTATS, see the IBM website.

Statistics are not collected for the following items:

  • Indexes.
  • DSNUM integer copy of a nonpartitioned space.
  • DSNUM integer copies of partitioned spaces cannot report or update aggregate statistics, SYSTABLESPACE and SYSTABLES, unless statistics for the other partitions are found in the catalog tables.
  • DSNDB06.SYSCOPY or any spaces in DSNDB01.
  • RUNSTATS is not valid for spaces in REORP status.
  • RUNSTATS and all of its suboptions are ignored for Instant Snapshots.

Option

Description

RUNSTATS

The following are the values of RUNSTATS:

Value

Description

RUNSTATS NO

(Default) Specifying RUNSTATS NO tells 

Some content is unavailable due to permissions.

 that statistics should not be collected.

RUNSTATS YES

Specifying RUNSTATS YES tells 

Some content is unavailable due to permissions.

 that statistics should be collected.

REPORT

The REPORT option under RUNSTATS determines if a set of messages is generated to report the collected statistics.

Values of REPORT

Value

Description

REPORT NO

(Default) REPORT NO indicates that collected statistics should not be output via messages to SYSPRINT.

REPORT YES

REPORT YES indicates that collected statistics should be output via messages to SYSPRINT. The messages generated are dependent upon the combination of keywords specified with RUNSTATS. REPORT YES always generates a report of SPACE and ACCESSPATH statistics regardless of what UPDATE option specifies.

BMCSTATS

The BMCSTATS option under RUNSTATS specifies if the collected table space or table level statistics for RUNSTATS are reflected in the BMCSTATS tables.

Values of BMCSTATS

Value

Description

BMCSTATS NO

(Default) BMCSTATS NO indicates that collected statistics should not be reflected in the BMCSTATS tables.

BMCSTATS YES

BMCSTATS YES indicates that collected statistics should be reflected in the BMCSTATS tables. This option requires BMC DASD MANAGER PLUS. You will get a -206 warning on the bind if synonyms do not exist. At runtime, if the tables are not found,

Some content is unavailable due to permissions.

issues an error message and the job fails.

Important

When you specify UPDATE NONE with BMCSTATS YES,

Some content is unavailable due to permissions.

will update BMCSTATS but will not update the IBM Db2 statistics.

UPDATE

The UPDATE option under RUNSTATS specifies whether

Some content is unavailable due to permissions.

should update the Db2 statistics. Use the option to indicate if

Some content is unavailable due to permissions.

should update the Db2 catalog with the collected statistics, and if so, which category of statistics

Some content is unavailable due to permissions.

should update. UPDATE also allows you to select statistics used for access path selection or statistics used by database administrators.

The tables updated with RUNSTATS UPDATE option shows the Db2 catalog tables that are updated when you use the UPDATE option. For a description of the Db2 catalog tables, see the DB2 for z/OS SQL Reference documentation. Columns updated with RUNSTATS UPDATE option shows the columns that are updated when you specify RUNSTATS UPDATE.

Tables updated with RUNSTATS UPDATE option

UPDATE option

Table updated

ALL

SYSTABLEPART

SYSTABLES

SYSTABLESPACE

SYSTABSTATS

NONE

None

ACCESSPATH

SYSTABLES

SYSTABLESPACE

SYSTABSTATS

SPACE

SYSTABLEPART

Columns updated with RUNSTATS UPDATE option

Table

Columns updated

SYSTABLEPART

CARD

CARDF

NEARINDREF

FARINDREF

PERCACTIVE

PERCDROP

SYSTABLES

CARD 1

NPAGES

PCTPAGES

PCTROWCOMP

STATSTIME

CARDF

SYSTABLESPACE

NACTIVE

NACTIVEF

STATSTIME

SYSTABSTATS

CARD

NPAGES

PCTPAGES

NACTIVE

PCTROWCOMP

STATSTIME

 

1 This DSNUM value applies to index copies only—not to table spaces copies.

If BMCSTATS YES is specified, all BMCSTATS tables are updated. For information about the BMCSTATS tables and how

Some content is unavailable due to permissions.

inserts a row with all columns filled except REORG SPACE, see the DASD MANAGER PLUS for DB2 documentation.

Value

Description

UPDATE ALL

(Default) UPDATE ALL indicates that

Some content is unavailable due to permissions.

will update all collected statistics in the Db2 catalog.

UPDATE NONE

UPDATE NONE indicates that

Some content is unavailable due to permissions.

will not update Db2 catalog tables with collected statistics. This option is only valid when you specify REPORT YES.

Important

When you specify UPDATE NONE with BMCSTATS YES,

Some content is unavailable due to permissions.

will update BMCSTATS but does not update the IBM Db2 statistics.

UPDATE ACCESSPATH

UPDATE ACCESSPATH indicates that

Some content is unavailable due to permissions.

will update only the Db2 catalog table columns that provide statistics used for access path selection. This includes the SYSTABLESPACE, SYSTABLES, and SYSTABSTATS tables.

Important

Some content is unavailable due to permissions.

updates the SYSTABSTATS table only for partitioned spaces.

UPDATE SPACE

UPDATE SPACE indicates that

Some content is unavailable due to permissions.

will update only the Db2 catalog table columns that provide statistics to help assess the status of a particular table space. This includes only the SYSTABLEPART table.


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*