What to do about utilities that were in progress at time of failure

After you restore data from image copies and archives, you might need to take some additional steps. For example, you need to determine what to do about any utilities that were in progress at the time of the failure.

You might need to take additional steps if any utility jobs were running after the last time that the log was offloaded before the disaster.

After restarting Db2, only certain utilities need to be terminated with the TERM UTILITY command.

Allowing the RECOVER utility to reset pending states is preferable. However, you might occasionally need to use the REPAIR utility to reset them. Do not start the table space with ACCESS(FORCE) because FORCE resets any page set exception conditions described in Database page set controls.

For the following utility jobs, perform the indicated actions:

CHECK DATA
Terminate the utility, and run it again after recovery is complete.
COPY
After you enter the TERM UTILITY command, Db2 places a record in the SYSCOPY catalog table to indicate that the COPY utility job was terminated. This makes it necessary for you to make a full image copy. When you copy your environment at the completion of the disaster recovery scenario, you fulfill that requirement.
LOAD
Find the options that you specified in the following table, and perform the specified actions. For the SORTKEYS option, you must specify a value that is greater than zero for integer. If you specify zero for integer, the SORTKEYS option does not apply.
Table 1. Actions to take when a LOAD utility job is interrupted
LOAD options specified What to do
LOG YES

If the RELOAD phase completed, recover to the current time. Recover the indexes.

If the RELOAD phase did not complete, recover to a prior point in time. The SYSCOPY record that is inserted at the beginning of the RELOAD phase contains the RBA or LRSN.

LOG NO and copy-spec

If the RELOAD phase completed, the table space is complete after you recover it to the current time. Recover the indexes.

If the RELOAD phase did not complete, recover the table space to a prior point in time. Recover the indexes.

LOG NO, copy-spec, and SORTKEYS integer

If the BUILD or SORTBLD phase completed, recover to the current time, and recover the indexes.

If the BUILD or SORTBLD phase did not complete, recover to a prior point in time. Recover the indexes.

LOG NO Recover the table space to a prior point in time. You can use the TOCOPY option of the RECOVER utility to do this.

To avoid extra loss of data in a future disaster situation, run the QUIESCE utility on table spaces before invoking the LOAD utility. This enables you to recover a table space by using the TOLOGPOINT option instead of TOCOPY.

REORG
For a user table space, find the options that you specified in the following table, and perform the specified actions.
Recommendation: Make full image copies of the catalog and directory before you run REORG on them.
Table 2. Actions to take when the REORG utility is interrupted
REORG options specified What to do
LOG YES

If the RELOAD phase completed, recover to the current time. Recover the indexes.

If the RELOAD phase did not complete, recover to the current time to restore the table space to the point before the REORG job began. Recover the indexes.

LOG NO

If the build or SORTBLD phase completed, recover to the current time, and recover the indexes.

If the build or SORTBLD phase did not complete, recover to the current time to restore the table space to the point before the REORG job began. Recover the indexes.

SHRLEVEL CHANGE or SHRLEVEL REFERENCE

If the SWITCH phase completed, terminate the utility. Recover the table space to the current time. Recover the indexes.

If the SWITCH phase did not complete, recover the table space to the current time. Recover the indexes.

For a catalog or directory table space, the instructions are somewhat different. For those table spaces that were using online REORG, find the options that you specified in the preceding table, and perform the specified actions.

If you have no image copies from immediately before REORG failed, use this procedure:
  1. From your DISPLAY UTILITY command and DIAGNOSE utility output, determine what phase the REORG job was in and which table space it was reorganizing when the disaster occurred.
  2. Run the RECOVER utility on the catalog and directory in the correct order. Recover all table spaces to the current time, except the table space that was being reorganized at the time of the disaster. If the RELOAD phase of the REORG job on that table space had not completed when the disaster occurred, recover the table space to the current time. Because REORG does not generate any log records prior to the RELOAD phase for catalog and directory objects, a recovery to the current time restores the data to the state that it was in before the REORG job. If the RELOAD phase completed, perform the following actions:
    1. Run the DSN1LOGP utility against the archive log data sets from the disaster site.
    2. Find the begin-UR log record for the REORG job that failed in the DSN1LOGP output.
    3. Run the RECOVER utility with the TOLOGPOINT option on the table space that was being reorganized. Use the URID of the begin-UR record as the TOLOGPOINT value.
  3. Recover or rebuild all indexes.

If you have image copies from immediately before the REORG job failed, run the RECOVER utility with the TOCOPY option to recover the catalog and directory, in the correct order.