Obtaining statistical information with STOSPACE

When Db2 storage groups are used in the creation of table spaces and indexes, Db2 defines the data sets for them. The STOSPACE utility permits a site to monitor the disk space that is allocated for the storage group.

About this task

The following table lists statistical information that the STOSPACE utility records and that is useful for making space allocation decisions.

Begin general-use programming interface information.
Table 1. Db2 catalog data that STOSPACE collects
Catalog table Column name Column description
SYSTABLESPACE SPACEF Number of kilobytes of storage that are allocated to the table space
SYSTABLEPART SPACEF Number of kilobytes of storage that are allocated to the table space partition
SYSINDEXES SPACEF Number of kilobytes of storage that are allocated to the index
SYSINDEXPART SPACEF Number of kilobytes of storage that are allocated to the index partition
SYSSTOGROUP SPACEF Number of kilobytes of storage that are allocated to the storage group
SYSSTOGROUP STATSTIME Time when STOSPACE was last run on a particular storage group
End general-use programming interface information.

STOSPACE does not accumulate information for more than one storage group. If a partitioned table space or index space has partitions in more than one storage group, the information in the catalog about that space comes from only the group for which STOSPACE was run.

When you run the STOSPACE utility, the SPACEF column of the catalog represents the high-allocated RBA of the VSAM linear data set. Use the value in the SPACEF column to project space requirements for table spaces, table space partitions, index spaces, and index space partitions over time. Use the output from the Access Method Services LISTCAT command to determine which table spaces and index spaces have allocated secondary extents. When you find these, increase the primary quantity value for the data set, and run the REORG utility.

Procedure

  • For information about space utilization in the DSN8S13E table space in the DSN8D13A database:
    1. Run the STOSPACE utility
    2. Execute the following SQL statement:
      Begin general-use programming interface information.
      EXEC SQL
        SELECT SPACE
        FROM SYSIBM.SYSTABLESPACE
        WHERE NAME = 'DSN8S13E
        AND DBNAME = 'DSN8D13A'
      ENDEXEC
      End general-use programming interface information.
    Alternatively, you can use TSO to look at data set and pack descriptions.
  • To update SYSIBM.SYSSTOGROUP for storage group DSN8G130, as well as SYSIBM.SYSTABLESPACE and SYSIBM.SYSINDEXES, for every table space and index that belongs to DSN8G130, use the following utility control statement:
    STOSPACE STOGROUP DSN8G130