How Db2 extends data sets
When a data set is created, Db2 allocates a primary allocation space on a volume that has available space and that is specified in the Db2 storage group. Any extension to a data set always gets a secondary allocation space.
If new extensions reach the end of the volume, Db2 accesses all candidate volumes from the Db2 storage group and issues the Access Method Services command ALTER ADDVOLUMES to add these volumes to the integrated catalog facility (ICF) catalog as candidate volumes for the data set. Db2 then makes a request to allocate a secondary extent on any one of the candidate volumes that has space available. After the allocation is successful, Db2 issues the command ALTER REMOVEVOLUMES to remove all candidate volumes from the ICF catalog for the data set.
Db2 extends data sets when either of the following conditions occurs:
- The requested space exceeds the remaining space in the data set.
- 10% of the secondary allocation space (but not over 10 allocation units, based on either tracks or cylinders) exceeds the remaining space.
If Db2 fails to extend a data set with a secondary allocation space because of insufficient available space on any single candidate volume of a Db2 storage group, Db2 tries again to extend with the requested space if the requested space is smaller than the secondary allocation space. Typically, Db2 requests only one additional page. In this case, a small amount of two units (tracks or cylinders, as determined by DFSMS based on the SECQTY value) is allocated. To monitor data set extension activity, use IFCID 258 in statistics class 3.
Nonpartitioned spaces
- The quantity that is calculated through sliding scale methodology
- The primary quantity from rule 1
- The specified SECQTY value
Partitioned spaces
For a partitioned table space or a partitioned index space, each partition is a data set. Therefore, Db2 defines each partition with the primary allocation space and extends each partition's data set by using a secondary allocation space, as needed.
Extension failures
If a data set uses all possible extents, Db2 cannot extend that data set. For a partitioned page set, the extension fails only for the particular partition that Db2 is trying to extend. For nonpartitioned page sets, Db2 cannot extend to a new data set piece, which means that the extension for the entire page set fails.
To avoid extension failures, allow Db2 to use the default value for primary space allocation and to use a sliding scale algorithm for secondary extent allocations.
Db2 might not be able to extend a data set if the data set is in an SMS data class that constrains the number of extents to less than the number that is required to reach full size. To prevent extension failures, make sure that the SMS data class setting for the number of allowed extents is large enough to accommodate 128 GB and 256 GB data sets.