How REORG PLUS works
This section contains topics that describes how REORG PLUS works:
Processing phases
This section describes the REORG PLUS processing phases for the following types of reorganizations:
- Two-phase table space
- Two-phase index
- Single-phase table space
- Single-phase index space
- Invoking DSNUTILB
The figures for the various types of SHRLEVEL CHANGE reorganizations are located in the separate section that describes SHRLEVEL CHANGE reorganizations.
The following table describes the REORG PLUS processing phases:
Phase name | Description |
---|---|
UTILINIT | During this phase, REORG PLUS completes the following processes:
|
DSNUTILB | REORG PLUS executes this phase only when the type of reorganization that you are running requires DSNUTILB. During this phase, REORG PLUS passes processing to DSNUTILB. This phase takes the place of the UNLOAD, RELOAD, and REORG phases, as well as the LOGAPPLY and LOGFINAL phases for a SHRLEVEL CHANGE reorganization. Additionally, this phase performs some of the tasks that the UTILTERM phase normally performs, such as updating statistics. |
ANALYZE | During this phase, REORG PLUS completes the following processes:
REORG PLUS uses information from this phase to optimize the reorganization process. |
UNLOAD | During this phase, REORG PLUS completes the following processes:
|
RELOAD | During this phase, REORG PLUS completes the following processes:
|
REORG | During this phase, REORG PLUS performs the functions of both the UNLOAD and RELOAD phase in a single processing phase. The SHRLEVEL specification affects the restartability of the job. |
LOGAPPLY | During this phase, REORG PLUS applies the stored log records to the reorganized staging data sets This phase runs only if you specify SHRLEVEL CHANGE. For more information about the LOGAPPLY phase, see the chapter that describes SHRLEVEL CHANGE reorganizations. |
LOGFINAL | During this phase, REORG PLUS completes the following processes:
This phase runs only if you specify SHRLEVEL CHANGE. For more information about the LOGFINAL phase, see the chapter that describes SHRLEVEL CHANGE reorganizations. |
UTILTERM | During this phase, REORG PLUS performs cleanup as follows:
REORG PLUS executes only part of this phase when invoking DSNUTILB. |
All phases | During all phases except the DSNUTILB phase, REORG PLUS updates the BMCUTIL and BMCSYNC DB2 tables. |
The following figure shows the two-phase table space reorganization:
The following figure shows the two-phase index reorganization:
The following figure shows the single-phase table space reorganization:
The following figure shows the single-phase index reorganization:
The following figure shows the processing phases when invoking DSNUTILB:
Data sets
This section provides a brief overview of the data sets that REORG PLUS uses.
The following table lists the names (ddnames) of the data sets that REORG PLUS uses, and describes each data set. You can override most of the ddnames or ddname prefixes by using REORG command or installation options. For more detailed information about each data set, see the references listed in this table.
Data set or ddname | Description | Reference |
---|---|---|
ASUSRPRT | ASUSRPRT is an optional data set that contains the statistics report that is generated when you specify BMCSTATS YES, BMCSTATS REPORT, or UPDATEDB2STATS YES. | |
BMCFORCE | BMCFORCE is an optional data set that contains the thread cancelation report that is generated when you specify either FORCE REPORTONLY or FORCE_RPT YES. | |
DB2 data sets | REORG PLUS dynamically allocates the Db2 data sets (table spaces or index spaces) that you are reorganizing. Therefore, you do not need to specify them in your JCL. | Not applicable |
DDLIN | The DDLIN input data set contains the SQL ALTER INDEX and ALTER TABLE statements with the new limit key values to use to rebalance partitions. REORG PLUS uses this optional data set only during a table space reorganization. | |
DDLOUT | The DDLOUT output data set contains the SQL ALTER statements for the limit-key updates that REORG PLUS makes during partition rebalancing. REORG PLUS opens this optional data set only if altering limit keys. | |
Full copy data sets 1 | REORG PLUS creates one or more output copy data sets that contain the image copy or DSN1COPY-type copy of the reorganized table space. After completing the copy, REORG PLUS deallocates the data set in order to free the device unless you specify VOL=(,RETAIN) in the JCL. The copy data sets should not be temporary data sets. | |
Incremental copy data sets 1 | During a SHRLEVEL CHANGE reorganization only, REORG PLUS might also create one or more output data sets that contain an incremental image copy. Depending on the option that you choose, REORG PLUS creates a standard image copy during the LOGFINAL phase. After completing the copy, REORG PLUS deallocates the data set in order to free the device unless you specify VOL=(,RETAIN) in the JCL. The incremental copy data sets should not be temporary data sets. | |
SORTWKnn 1 | SORTWKnn is the work data set that is used by BMCSORT. The data set is used in the UNLOAD and RELOAD phases for a two-phase reorganization, and in the REORG phase for a single-phase reorganization. You cannot allocate the sort work files as VIO data sets or tape data sets. You must allocate each individual work file on a single DASD unit. | |
SYSARC | The archive data set contains rows that REORG PLUS discards during a reorganization. REORG PLUS writes to this data set as the table space is unloaded. The SYSARC data set should not be a temporary data set. For DSNUTILB reorganizations, this data set is allocated as the discard data set that the Db2 REORG utility uses, and contains rows that are discarded during the reorganization. | |
SYSERR 1 | This data set holds diagnostic messages that REORG PLUS might produce in error situations when running a SHRLEVEL CHANGE reorganization. | |
SYSEXEC | SYSEXEC specifies the library concatenation where REXX exits reside. | |
SYSIDCIN | The SYSIDCIN input data set contains the IDCAMS command statements that REORG PLUS uses to redefine user-defined (VCAT-defined) data sets, including the staging data sets that REORG PLUS uses when you specify SHRLEVEL REFERENCE or SHRLEVEL CHANGE. REORG PLUS reads, parses, and partially verifies the SYSIDCIN data set in the UTILINIT phase. The IDCAMS commands are issued before REORG PLUS reloads the data set. REORG PLUS uses the statements to redefine the VCAT-defined data sets only. | |
SYSIN | SYSIN is the input data set that contains the REORG command. | |
SYSPRIN2 | The SYSPRIN2 output data set contains the same REORG PLUS messages that are output to SYSPRINT. In a worklist environment, SYSPRIN2 enables you to view REORG PLUS output in real time. | |
SYSPRINT | The SYSPRINT output data set contains REORG PLUS messages. | |
SYSPUNCH | The SYSPUNCH data set is used only for DSNUTILB reorganizations and contains LOAD statements that are generated when records are discarded during the reorganization. | |
SYSRECnn 1 | The SYSREC data set contains the table space’s unloaded rows. If you use multiple data sets, the nn identifies a specific partition number. REORG PLUS does not use the SYSREC data set for a single-phase SHRLEVEL REFERENCE or SHRLEVEL CHANGE table space reorganization. | |
SYSTSPRT | REXX routes all output from the REXX 'SAY' statements to the SYSTSPRT data set. | |
SYSUT1nn 1 | The SYSUT1 data set contains the unloaded index keys. The nn is required only if you specify multiple data sets. REORG PLUS does not use the SYSUT1 data set for a single-phase SHRLEVEL REFERENCE or SHRLEVEL CHANGE index reorganization. | |
UTPRINT 1 | The UTPRINT data set indicates that sort messages should be reported. However, the actual messages for each sort appear in separate SYSnnnnn data sets, where nnnnn is a system-assigned sequential number. |
1 For reorganization jobs that invoke DSNUTILB, the description of how REORG PLUS uses this data set does not apply. For information about how this data set is used for these jobs, see the documentation for the REORG utility in the IBM Db2 Utility Guide and Reference.
Related topic