Recovery with DB2 UDB for UNIX and Windows

Purpose

To minimize downtime with your DB2 UDB for UNIX and Windows database, you must make sure that you can quickly recover the database in the event of a failure with loss of production data. There are the following types of recovery with DB2 UDB for UNIX and Windows:

  • Crash recovery

This is required if structures on disk are not damaged, but the database instance has aborted.

  • Media recovery

This is required if structures on disk such as a container are damaged.

Process Flow

  1. Devise a recovery strategy and rehearse it in practice

SAP strongly recommends you to rehearse a disaster. You could, for example, use a test system to practice restore and roll forward

This exercise is very valuable to give you some idea how long a recovery would take.

  1. Repeat the recovery rehearsal often enough (for example, twice a year) to take account of the effects of database growth on recovery time.
  2. Choose one of the following types of recovery to restore the DB2 UDB for UNIX and Windows:
    • Crash recovery

In the case of a system crash and a subsequent database restart, DB2 UDB for UNIX and Windows automatically recovers the database. For this, the AUTORESTART database parameter is enabled by default in your SAP database.

The database always creates log files during crash recovery. If there is not enough log space, the recovery fails.

    • Restore recovery (media recovery)

This type of recovery enables the restore of a previous version of the database that was made with the DB2 backup command.

    • Roll forward recovery (media recovery)

A roll forward recovery follows the restore of the database by applying the transaction logs created since the last restored backup.

You can perform roll forward recovery if the database has been configured for LOGRETAIN=ON and LOGRETAIN=ON. This setting is mandatory for production SAP systems.

  1. Use parallel recovery and parallel rollforward.

Consider using parallel recovery by using parameters parallelism and device of restore command. You can turn on parallel rollforward by setting DB2_USE_PARALLEL_RECOVERY=YES using the db2set command.

For a detailed description of recovery with DB2 UDB for UNIX and Windows, refer to SAP Database Administration Guide: IBM DB2 Universal Database for UNIX and Windows or to DB2 UDB for UNIX and Windows documentation.

Result

You can restore your database as quickly and efficiently as possible, so avoiding downtime caused by a failure with loss of database data.