Recovering with damaged table spaces

If table space containers have been damaged and group crash recovery is required on the database, the group crash recovery operation will fail. In a Db2® pureScale® environment with automatic recovery, you can resolve such a scenario as follows.

Before you begin

This scenario demonstrates how to resolve the problem of damaged table spaces in a Db2 pureScale environment so that automatic group crash recovery can proceed.

About this task

Assume that automatic recovery is active, but fails to recover the database because a table space has been damaged. After repeated failures, the Db2 member is moved to another host and restart light is attempted. After further failures to automatically recover the database, the cluster manager raises an alert. The member that failed is not started and is inactive.

Procedure

  1. Disable automatic recovery by setting the autorestart configuration parameter to OFF.
    The autorestart configuration parameter is not dynamic and its new value takes effect the next time the member is started up.
    This command changes the autorestart configuration parameter to OFF for a database called WSDB:
    UPDATE DATABASE CONFIGURATION FOR WSDB USING AUTORESTART OFF
  2. Use the db2cm command (db2cluster command on AIX systems) to clear all outstanding alerts for all members.
    Also, Db2 cluster services will automatically issue the db2start command to restart the members on their home hosts. The members that restart pick up the changed autorestart value and do not initiate automatic recovery.
    On Linux:
    db2cm -clear -alert
    On AIX:
    db2cluster -clear -alert
  3. Issue the RESTART DATABASE command to resolve the damaged table spaces.
    The damaged table spaces are marked as offline and put into the drop pending state.
    RESTART DATABASE WSDB DROP PENDING TABLESPACES (tbsp1, tbsp2)
  4. Re-enable automatic recovery by setting the autorestart configuration parameter to ON.
    For example, this command changes the autorestart configuration parameter to ON for the database called WSDB:
    UPDATE DATABASE CONFIGURATION FOR WSDB USING AUTORESTART ON
    The autorestart parameter is not dynamic and its new value takes effect the next time the member is started up.