Recovering from a total loss of the log

If all system and user table spaces remain intact and you have a recent copy of the BSDS, you can recover from a total loss of the log. Db2 can still be restarted, and data that belongs to that Db2 subsystem can still be accessed.

Before you begin

All system and user table spaces must be intact, and you must have a recent copy of the BSDS. Other VSAM clusters on disk, such as the system databases DSNDB01, DSNDB04, and DSNB06, and also user databases are assumed to exist.

Procedure

To restart Db2 when the entire log is lost:

  1. Define and initialize the BSDSs by recovering the BSDS from a backup copy.
  2. Define the active log data sets by using the access method services DEFINE command. Run utility DSNJLOGF to initialize the new active log data sets.
  3. Prepare to restart Db2 with no log data.
    Each data and index page contains the log RBA of the last log record that was applied against the page. Safeguards within Db2 disallow a modification to a page that contains a log RBA that is higher than the current end of the log. You have two choices:
    • Determine the highest possible log RBA of the prior log. From previous console logs that were written when Db2 was operational, locate the last DSNJ001I message. When Db2 switches to a new active log data set, this message is written to the console, identifying the data set name and the highest potential log RBA that can be written for that data set. Assume that this is the value X'8BFFF'. Add one to this value (X'8C000'), and create a conditional restart control record that specifies the following change log inventory control statement:
      CRESTART CREATE,STARTRBA=8C000,ENDRBA=8C000

      When Db2 starts, all phases of restart are bypassed, and logging begins at log RBA X'8C000'. If you choose this method, you do not need to use the RESET option of the DSN1COPY utility, and you can save a lot of time.

    • Run the DSNJU003 utility, specifying the DELETE and NEWLOG options to delete and create new logs for all active log data sets.
    • Run the DSN1COPY utility, specifying the RESET option to reset the log RBA in every data and index page. Depending on the amount of data in the subsystem, this process might take quite a long time. Because the BSDS has been redefined and reinitialized, logging begins at log RBA 0 when Db2 starts.
      If the BSDS is not reinitialized, you can force logging to begin at log RBA 0 by constructing a conditional restart control record (CRCR) that specifies a STARTRBA and ENDRBA that are both equal to 0, as the following command shows:
      CRESTART CREATE,STARTRBA=0,ENDRBA=0
  4. Start Db2. Use the START DB2 ACCESS(MAINT) command until data is consistent or page sets are stopped.
  5. After restart, resolve all inconsistent data as described in Resolving inconsistencies resulting from a conditional restart.