IBM Support

Database accessibility during Backward phase of crash recovery or HADR takeover

Question & Answer


During a lengthy Backward phase of crash recovery or 'HADR Takeover', how can the database be accessed?


If a database is interrupted unexpectedly before all transactions (or units of work) are committed, or before the changes associated with committed transactions are fully written to disk, then the database is left in an inconsistent state. When the database is restarted or an 'HADR Takeover by Force' is performed, these transactions are rectified during a process called crash recovery (see the 'Related Information' section at bottom for more information). During crash recovery, the changes associated with these transactions are first replayed from the transaction logs - we often refer to this as the Forward or Redo phase of crash recovery. Transactions which were not yet committed at the time of the database failure (or 'HADR Takeover by Force') are then rolled back - we often refer to this as the Backward or Undo phase of crash recovery.

Prior to Version, the database was only accessible after the full completion of crash recovery. This was not ideal, since a very large transaction could require a lengthy Backward phase, leaving the database entirely inaccessible until it completed.

In Version, as a technical preview for testing in non-production environments, the database can be configured to allow accessibility during the backward phase of crash recovery.
This behaviour can be enabled using the following undocumented database registry variable:
       db2set DB2_ASYNC_UNDO=yes

Beginning in Version, this behaviour is now fully supported for production environments.
This behaviour can now be enabled using it's official name:
       db2set DB2_ONLINERECOVERY=yes

(Changes to this variable do not require the database instance to be restarted.)

Please see the Knowledge Center page "Database accessibility during backward phase of crash recovery or HADR takeover" for full details:

[{"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Recovery - Crash Recovery","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"11.1","Edition":"Advanced Enterprise Server;Advanced Workgroup Server;Enterprise Server;Express;Express-C;Personal;Workgroup Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018