Automated REORG with ADBTEP2

Certain SQL statements can create pending changes, place the object in an advisory REORG-pending state, and require that the REORG utility be run to materialize the changes. To help automate the REORG operation, ADBTEP2 initiates an automated REORG, or auto-reorg.

Under certain circumstances, Db2 requires templates for the UNLDDN, COPYDDN, PUNCHDDN, or DISCARDDDN data sets when performing a REORG operation. Auto-reorg uses the following default templates:

  • For UNLDDDN:
    &USERID..ADBREORG.&DB..&SN..&UNIQ.
  • For COPYDDN:
    &USERID..ADBCOPY.&DB..&SN..&UNIQ.
  • For PUNCHDDN: If the table space is partitioned and uses relative page numbering, the following template is used:
    &USERID..ADBPUNCH.&DB..&SN..P&PA.
    Otherwise, the following template is used:
    &USERID..ADBPUNCH.&DB..&SN..&UNIQ.
  • For DISCARDDN:
    &USERID..ADBDISC.&DB..&SN..&UNIQ.

You can override these templates by including the following statements at the beginning of the input stream:

ADMIN REORG TEMPLATE  ADBREORG <template parameters>;
ADMIN COPY TEMPLATE ADBCOPY <template parameters>;
ADMIN PUNCH TEMPLATE ADBPUNCH <template parameters>;
ADMIN DISCARD TEMPLATE ADBDISC <template parameters>;

The ADMIN REORG, ADMIN COPY, ADMIN PUNCH, and ADMIN DISCARD keywords are stripped from the statements.