Access during REBUILD INDEX operations

When rebuilding an index or index partition by running the REBUILD INDEX utility, you can specify the level of access that you have to your data by using the SHRLEVEL option.

Before target indexes are built, they are first drained (DRAIN ALL) and then placed in REBUILD-pending (RBDP) status. The indexes are shown in UTRW states.

Log processing with SHRLEVEL CHANGE

When you specify SHRLEVEL CHANGE, Db2 processes the log. This step executes iteratively. Each iteration processes the log records that accumulated during the previous iteration. The iterations continue until one of the following conditions is met:

  • Db2 estimates that the time to perform log processing in the next iteration will be less than or equal to the time that is specified by MAXRO. If this condition is met, the next iteration is the last one.
  • The number of log records that the next iteration will process is not sufficiently lower than the number of log records that were processed in the previous iteration. If this condition is met but the first condition is not met, message DSNU377I is returned to the console. Db2 continues log processing for the length of time that is specified by DELAY and then performs the action specified by LONGLOG.

Operator actions

LONGLOG specifies the action that Db2 is to perform if log processing is not occurring quickly enough. If the operator does not respond to console message DSNU377I, the LONGLOG option automatically goes into effect.

Db2 does not take the action specified in the LONGLOG option if any of the following events occur before the delay expires:

  • A TERM UTILITY command is issued.
  • Db2 estimates that the time to perform the next iteration is likely to be less than or equal to the time specified on the MAXRO keyword.
  • REBUILD terminates for any reason (including the deadline).