REBUILD INDEX

The REBUILD INDEX online utility reconstructs indexes or index partitions from the table that they reference.

Start of changeDuring the rebuild process, the REBUILD INDEX utility can also create a FlashCopy® image copy of the indexes being rebuilt.End of change

Start of changeTo avoid the cost of running the RUNSTATS utility afterward, you can also specify the STATISTICS option to collect inline statistics when you run the REBUILD INDEX utility.End of change

Restriction: REBUILD INDEX SHRLEVEL CHANGE should only be used to fix a broken or restricted index, to build an index after DEFER, or to support or unencrypt previously encrypted data sets. You should not use the REBUILD INDEX SHRLEVEL CHANGE utility to move an index to different volumes; instead you should use the online REORG utility. REBUILD INDEX SHRLEVEL CHANGE on a unique index will not allow the INSERT option, the DELETE option, or updates that affect the unique index.

Authorization required

To execute this utility, you must use a privilege set that includes one of the following authorities:

  • RECOVERDB privilege for the database
  • STATS privilege for the database is required if the STATISTICS keyword is specified.
  • DBADM or DBCTRL authority for the database. If the object on which the utility operates is in an implicitly created database, DBADM authority on the implicitly created database or DSNDB04 is required.
  • Start of changeDATAACCESS authorityEnd of change
  • Start of changeSystem DBADM authorityEnd of change
  • SYSCTRL or SYSADM authority

Start of changeIf either the FLASHCOPY YES or FLASHCOPY CONSISTENT option is specified, the user ID that invokes the REBUILD INDEX utility must have the authority to execute the DFSMSdss COPY command.End of change

To run REBUILD INDEX STATISTICS REPORT YES, you must use a privilege set that includes the SELECT privilege on the catalog tables.

Execution phases of REBUILD INDEX

The REBUILD INDEX utility operates in the following phases:

UTILINIT
Performs initialization and setup.
UNLOAD
Unloads index entries.
SORT
Sorts unloaded index entries.
BUILD
Builds indexes.
SORTBLD
Sorts and builds a table space for parallel index build processing.
UTILTERM
Performs cleanup.