Advantages of storage groups

Allowing Db2 to manage your data sets by using Db2 storage groups offers several advantages.

The following list describes some of the things that Db2 does for you in managing your auxiliary storage requirements:

  • When a table space is created, Db2 defines the necessary VSAM data sets using VSAM Access Method Services. After the data sets are created, you can process them with access method service commands that support VSAM control-interval (CI) processing (for example, IMPORT and EXPORT).
    Exception: You can defer the allocation of data sets for table spaces and index spaces by specifying the DEFINE NO clause on the associated statement (CREATE TABLESPACE and CREATE INDEX), which also must specify the USING STOGROUP clause.
  • When a table space is dropped, Db2 automatically deletes the associated data sets.
  • When a data set in a segmented or simple table space reaches its maximum size of 2 GB, Db2 might automatically create a new data set. The primary data set allocation is obtained for each new data set.
  • When needed, Db2 can extend individual data sets.
  • When you create or reorganize a table space that has associated data sets, Db2 deletes and then redefines them, reclaiming fragmented space. However, when you run REORG with the REUSE option and SHRLEVEL NONE, REORG resets and reuses Db2-managed data sets without deleting and redefining them. If the size of your table space is not changing, using the REUSE parameter could be more efficient.
    Exception: When reorganizing a LOB table space with the SHRLEVEL NONE option, Db2 does not delete and redefine the first data set that was allocated for the table space. If the REORG results in empty data sets beyond the first data set, Db2 deletes those empty data sets.
  • When you want to move data sets to a new volume, you can alter the volumes list in your storage group. Db2 automatically relocates your data sets during the utility operations that build or rebuild a data set (LOAD REPLACE, REORG, REBUILD, and RECOVER).
    Restriction: If you use the REUSE option, Db2 does not delete and redefine the data sets and therefore does not move them.

    For a LOB table space, you can alter the volumes list in your storage group, and Db2 automatically relocates your data sets during the utility operations that build or rebuild a data set (LOAD REPLACE and RECOVER).

    To move user-defined data sets, you must delete and redefine the data sets in another location.