Task 5: Start Db2 and resolve data inconsistencies
The final task in restarting Db2 by truncating the log is to restart Db2 and resolve inconsistencies.
Before you begin
You must have a CRESTART control statement with the correct ENDRBA value and the FORWARD and BACKOUT options set to NO.
Procedure
To start Db2 and resolve data inconsistencies:
- Start Db2 with
the following command:
-START DB2 ACCESS (MAINT)In response to this command, Db2 performs the following actions:
- Discards from the checkpoint queue any entries with RBAs that are beyond the ENDRBA value in the CRCR (for example, X'7429000').
- Reconstructs the system status up to the point of log truncation.
- Performs pending database writes that the truncated log specifies and that have not already been applied to the data. You can use the DSN1LOGP utility to identify these writes. No forward recovery processing occurs for units of work in a FORWARD=NO conditional restart. All pending writes for in-commit and indoubt units of recovery are applied to the data. The standard forward-log recovery processing for the different unit of work states does not occur.
- Marks all units of recovery that have committed or are indoubt as complete on the log.
- Leaves inflight and in-abort units of recovery incomplete. Inconsistent
data is left in tables that are modified by inflight or indoubt units
of recovery. When you specify a BACKOUT=NO conditional restart, inflight
and in-abort units of recovery are not backed out.
In a conditional restart that truncates the log, BACKOUT=NO minimizes Db2 errors for the following reasons:
- Inflight units of recovery might have been committed in the portion of the log that the conditional restart discarded. If these units of recovery are backed out (as would be normal during backward-log recovery) Db2 might back out database changes incompletely, which introduces additional errors.
- Data that is modified by in-abort units of recovery might have been modified again after the point of damage on the log. For in-abort units of recovery, Db2 might have written backout processing to disk after the point of log truncation. If these units of recovery are backed out (as would be normal during backward-log recovery), Db2 might introduce additional data inconsistencies by backing out units of recovery that are already partially or fully backed out.
At the end of restart, the conditional restart control record (CRCR) is marked
Deactivated
to prevent its use on a later restart. Until the restart completes successfully, the CRCR is in effect. Until data is consistent or page sets are stopped, start Db2 with the ACCESS (MAINT) option. - Resolve all data inconsistency problems.