Task 4: Truncate the log at the point of error

The fourth task in restarting Db2 by truncating the log is to truncate the log at the point of error.

About this task

No Db2 process, including the RECOVER utility, allows a gap in the log RBA sequence. You cannot process up to point X, skip over points X through Y, and continue after Y.

Procedure

To truncate the log at the point of error:

Create a conditional restart control record (CRCR) in the BSDS by using the change log inventory utility.
Specify the following options:
ENDRBA=endrba
The endrba value is the RBA at which Db2 begins writing new log records. If point X is X'7429000', specify ENDRBA=7429000 on the CRESTART control statement.

At restart, Db2 discards the portion of the log beyond X'7429000' before processing the log for completing work (such as units of recovery and database writes). Unless otherwise directed, Db2 performs normal restart processing within the scope of the log. Because log information is lost, Db2 errors might occur. For example, a unit of recovery that has actually been committed might be rolled back. Also, some changes that were made by that unit of recovery might not be rolled back because information about data changes is lost.

FORWARD=NO
Terminates forward-log recovery before log records are processed. This option and the BACKOUT=NO option minimize errors that might result from normal restart processing.
BACKOUT=NO
Terminates backward-log recovery before log records are processed. This option and the FORWARD=NO option minimize errors that might result from normal restart processing.

Results

Recovering and backing out units of recovery with lost information might introduce more inconsistencies than the incomplete units of recovery.

Example

The following example is a CRESTART control statement for the ENDRBA value of X'7429000':
CRESTART  CREATE,ENDRBA=7429000,FORWARD=NO,BACKOUT=NO