Clearing the RECOVER-pending status

If Db2 needs to undo work that has not been logged (as when a rollback occurs), the table space has lost its data integrity and is marked RECOVER-pending. To prevent access to corrupt data, Db2 places the pages in the logical page list (LPL).

About this task

Tip: Application programmers should commit frequently and try to avoid duplicate key or referential integrity violations when modifying a table in a NOT LOGGED table space.

If Db2 restart recovery determines that a not logged table space may have been in the process of being updated at the time of the failure, then the table space or partition is placed in the LPL and is marked RECOVER-pending. You have several options for removing a table space from the LPL and resetting the RECOVER-pending status:

When a job fails and a rollback begins, the undo records are not available for table spaces that are not logged during the back-out. Therefore, the rows that are in the table space after recovery might not be the correct rows. You can issue the appropriate SQL statements to re-create the intended rows.

Using a REFRESH TABLE statement

About this task

Begin general-use programming interface information.Use the REFRESH TABLE statement to repopulate a materialized query table, but only if the materialized query table is alone in its table space. If the table is not alone in its table space, a utility must be used to reset the table space and remove it from RECOVER-pending status. End general-use programming interface information.

Using the RECOVER utility

About this task

Use the RECOVER utility to recover to a recoverable point.

You can run the RECOVER utility against a table space with the NOT LOGGED logging attribute. To do so, the current logging attribute of the table space must match the logging attribute of the recovery base (that is, the logging attribute of the table space when the image copy was taken). If no changes have been made to the table space since the last point of recovery, the utility completes successfully. If changes have been made, the utility completes with message DSNU1504I.

You can use RECOVER with the TOCOPY, TOLASTFULLCOPY, or TOLASTCOPY keyword to identify which image copy to use. You can also use TORBA or TOLOGPOINT, but the RBA or LRSN must correspond to a recoverable point.

You cannot use RECOVER with the LOGONLY keyword.

Using the LOAD REPLACE utility

About this task

Use the LOAD REPLACE utility or the LOAD REPLACE PART utility in the following situations:

  • With an input data set to empty the table space and repopulate the table.
  • Without an input data set to empty the table space to prepare for one or more INSERT statements to repopulate the table.

Using a DELETE statement without a WHERE clause

About this task

Begin general-use programming interface information.Use the DELETE statement without a WHERE clause to empty the table, when the table space is segmented or universal, the table is alone in its table space and the table does not have:

  • A VALIDPROC
  • Referential constraints
  • Delete Triggers
  • A SECURITY LABEL column (or it does have such a column, but multilevel security with row level granularity is not in effect) End general-use programming interface information.

Using a TRUNCATE TABLE statement

About this task

Begin general-use programming interface information.Use the TRUNCATE TABLE statement to empty the table, when the table space is segmented and the table is alone in its table space and the table does not have:

  • A VALIDPROC
  • Referential constraints
  • A SECURITY LABEL column (or it does have such a column, but multilevel security with row level granularity is not in effect) End general-use programming interface information.