DB2 Server for VSE & VM: Data Restore Guide


Procedures to Recover from Failures

Recover from Directory Failure

If the directory is corrupted or the database is down and cannot be restarted due to a disk error, there are two ways to recover:

In all cases, when restarting use the same LOGMODE as before. If this was LOGMODE=A, the log is synchronized. If this was LOGMODE=L, you are prompted for subsequent log files to be restored, and the log is synchronized.

Recover from Database Corruption

Should you detect a user or program error, disable the dbspace containing the table to prevent more updates to the damaged table or to prevent users from getting incorrect data. This DISABLE DBSPACE command takes the specified dbspace offline so no access is allowed. Once you have determined how to fix this user error, you can use the ENABLE DBSPACE command to bring the dbspace back online and fix the problem.

The same procedure applies if there are persistent DB2 abnormal terminations in DBSS. In this case the database manager would terminate and display the message ARI040E which would identify a module whose first four characters are ARIY. To avoid more corruption, or until the problem is corrected, disable all the dbspaces involved.

Another way to recover from abnormal DBSS terminations would be to restore a DB2 archive, Data Restore archive or user archive and apply the log tapes with Filtered Log Recovery. This allows you to exclude some LUWs that affected the corrupted dbspace and might have led to the error.

The command sequence for disabling a dbspace and for forward log recovery is described in the DB2 Server for VSE & VM Diagnosis Guide and Reference manual.

Data Recovery

From a Physical Error

You can replace the disk and restore the database as follows:

In all cases, when restarting use the same LOGMODE as before. If this was LOGMODE=A, the log is synchronized. If this was LOGMODE=L, you are prompted for subsequent log files to be restored, and the log is synchronized.

For more information about restoring a storage pool and log recovery, refer to Log Recovery.

You can also try the following procedure, but it might not always work and can take more time than the storage pool level recovery or even the database restore:

  1. Drop the dbspace where the damaged area is
  2. Add a new extent to the pool to replace the damaged one
  3. Delete the damaged extent. This will move the data from the damaged extent to the space available on the new extent in the same storage pool.
  4. Create the dbspace again
  5. Acquire the dbspace
  6. Reload the dbspace that you dropped previously using the Data Restore RELOAD with forward recovery from an archive:

Recover from System Failure

There might be an occasion where the complete operation has to be moved to another system. In such a case, you would not only need a backup of the database, but also of all other disks that are related to the operating system and the database. In most cases you would restore an image copy of all DASDs.

Recommendation: Before making copies of all DASDs, shut down the database manager so that all data is written to disk.

If you need to move only the database to another system, you will need some files or jobs to restart your database. These files and jobs are related to the database but are neither saved by the DB2 ARCHIVE nor by the Data Restore BACKUP process. These are the database definitions and the log history file.

Database Definitions

In VM these files are:

In VSE these jobs are:

Log History File

In VM this file is:

This file keeps the history information, which is also available in the last page of the current log, and which can be displayed with the DB2 operator command SHOW LOGHIST.

In VM the log history file is located on the work disk, default 191, of the database manager. This A-disk file is automatically used during a subsequent restore, if the log history area is unusable due to a log failure.

When a COLDLOG RECONFIGURE is performed, this file is copied to ARIHSDS PRECLDLG to ensure recoverability.

In VSE the log history information is only available in the current log. To back up this information a VSAM backup should be made offline of the log file LOGDSK1. After disaster recovery this backup should be restored and COLDLOG REFORMAT should be performed to clear all other log information.

If you restore the database to another system, or when you have replaced all disks, you cannot apply the log archive tapes without a recent copy of the log disk or of the externalized history file.

For LOGMODE=L, this is a question of to which point in time (which log archive tape) you plan to fall back in case of a disaster. If you want to be able to recover also the latest log archive, then whenever an archive or log archive is taken, you might want to immediately afterwards make a copy of the ARIHSDS ARCHIVE file.

For LOGMODE=A, on a different system you can only restore archives taken offline. Because at the begin archive checkpoint LUWs can have been active, an online archive would need forward recovery using the current log to get into a consistent state. Therefore, the log history file is less important for LOGMODE=A.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]