Reorganizing partition-by-growth table spaces
General considerations for partition-by-growth table spaces
The following general considerations apply to reorganizing partition-by-growth table spaces:
- The strategy that REORG PLUS uses to place rows within the table space depends on whether the table contains a LOB column, as follows:
- If the table contains a LOB column, REORG PLUS does not change any row's partition. For an ORDER YES reorganization, REORG PLUS sorts the rows within each partition by the clustering index.
- If the table does not contain a LOB column, REORG PLUS can move rows within partition ranges. Within each range, REORG PLUS places rows from lowest RID to highest. For an ORDER YES reorganization, REORG PLUS sorts each range by the clustering index.
- When processing partition-by-growth table spaces, REORG PLUS starts at most one unload, reload, and reorg task per range of contiguous partitions. The task that handles the last partition handles the partitions that might be added during the reorganization process.
- If an online SQL UPDATE occurs during a SHRLEVEL CHANGE reorganization and that update causes the updated row to be relocated to another partition, REORG PLUS issues message BMC53099E and terminates.
In addition to the information in the rest of this topic, see the following topics for additional partition-by-growth considerations:
- Building a dictionary
- Copy-data-sets
- SYSREC-data-sets
- Additional restart considerations and restrictions
Extension of partition-by-growth table spaces by REORG PLUS
Either REORG PLUS or Db2 might add partitions to a partition-by-growth table space during the reorganization process. If REORG PLUS runs out of space in the existing set of partitions, it can add partitions to the table space if all of the following conditions exist:
- The table has no LOB columns.
- You include the last partition in the reorganization, either by running a full table space reorganization, or by specifying it using the contiguous PART option (for example, PART n:LAST).
- The value of the Db2 MAXPARTITIONS parameter is greater than the number of partitions in the table space.
- The value of the MAXNEWPARTS option is greater than 0.
Note the following considerations when REORG PLUS adds partitions to a partition-by-growth table space:
- You can specify multiple ranges of partitions (that is, contiguous sets of reorganized partitions). When you do so, if it cannot reload all of the rows unloaded from a range back into that range, REORG PLUS terminates. REORG PLUS considers added partitions to be in the range that includes the last partition.
- If you are making copies, REORG PLUS copies all partitions that it adds to the table space. For information about copy data set requirements, see Partition-by-growth table spaces.
Extension of partition-by-growth table spaces by Db2
Db2 might add partitions during a SHRLEVEL CHANGE reorganization of a partition-by-growth table space or an index defined on its table.
REORG PLUS can support added partitions in most cases. However, REORG PLUS terminates when a partition is added when either of the following conditions exists:
- The number of partitions that Db2 adds exceeds MAXNEWPARTS. REORG PLUS issues message BMC53025E.
- You are reorganizing a LOB base table space (with AUX NO). REORG PLUS issues message BMC51287E.
REORG PLUS copies all partitions that Db2 adds for a full reorganization. For a partial reorganization, REORG PLUS copies partitions that Db2 adds when both of the following conditions exist:
- The last partition is included in the reorganization.
- The table does not include a LOB column.
For information about copy data set requirements, see Partition-by-growth table spaces.