Establishing a recovery cycle by using the RECOVER utility

Each time that you restore the logs and the BSDS from the primary site at your tracker site, you establish a new recovery cycle. One way to establish a recovery cycle is to use the RECOVER utility.

Procedure

To establish a recovery cycle by using the RECOVER utility:

  1. While your primary site continues its usual workload, send a copy of the primary site active log, archive logs, and BSDS to the tracker site.
    Send full image copies for the following objects:
    • Table spaces or partitions that are reorganized, loaded, or repaired with the LOG NO option after the latest recovery cycle.
    • Objects that, after the latest recovery cycle, have been recovered to a point in time.
    • SYSUTILX. Send a full image copy to DSNDB01.SYSUTILX for normal (full image copy and log) recoveries. For LOGONLY recoveries, create a copy of DSNDB01.SYSUTILX by using the DSN1COPY utility.

    Db2 does not write SYSLGRNX entries for DSNDB01.SYSUTILX, which can lead to long recovery times at the tracker site. In addition, SYSUTILX and its indexes are updated during the tracker cycle when you run your recoveries. Because SYSUTILX must remain consistent with the SYSUTILX at the primary site, discard the tracker cycle updates before the next tracker cycle.

    Recommendation: If you are taking incremental image copies, run the MERGECOPY utility at the primary site before sending the copy to the tracker site.
  2. At the tracker site, restore the BSDS that was received from the primary site by using one of the following methods:
    • Locate the BSDS in the latest archive log that is now at the tracker site.
    • Register this archive log in the archive log inventory of the new BSDS by using the change log inventory utility (DSNJU003).
    • Register the primary site active log in the new BSDS by using the change log inventory utility (DSNJU003).
  3. Use the change log inventory utility (DSNJU003) with the following CRESTART control statement:
    CRESTART CREATE,ENDRBA=nnnnnnnnn000, FORWARD=NO,BACKOUT=NO

    In this control statement, nnnnnnnnn000 equals the value of the ENDRBA of the latest archive log plus 1. Do not specify STARTRBA because you cannot cold start or skip logs in a tracker system.

    Data sharing
    If you are recovering a data sharing group, you must use the following CRESTART control statement on all members of the data sharing group. The ENDLRSN value must be the same for all members.
    CRESTART CREATE,ENDLRSN=nnnnnnnnnnnn,FORWARD=NO,BACKOUT=NO

    In this control statement, nnnnnnnnnnnn is the lowest ENDLRSN of all the members that are to be read during restart. Specify one of the following values for the ENDLRSN:

    • If you receive the ENDLRSN from the output of the print log map utility (DSNJU004) or from message DSNJ003I at the console logs use ENDLRSN -1 as the input to the conditional restart.
    • If you receive the ENDLRSN from the output of the DSN1LOGP utility (DSN1213I message), use the displayed value.
    The ENDLRSN or ENDRBA value indicates the end log point for data recovery and for truncating the archive log. With ENDLRSN, the missing log records between the lowest and highest ENDLRSN values for all the members are applied during the next recovery cycle.
  4. If the tracker site is a data sharing group, delete all Db2 coupling facility structures before restarting the tracker members.
  5. At the tracker site, restart Db2 to begin a tracker site recovery cycle.
    Data sharing
    For data sharing, restart every member of the data sharing group.
  6. At the tracker site, submit RECOVER utility jobs to recover database objects. Run the RECOVER utility with the LOGONLY option on all database objects that do not require recovery from an image copy.

    You must recover database objects as the following procedure specifies:

    1. Restore the full image copy or DSN1COPY of SYSUTILX.

      If you are doing a LOGONLY recovery on SYSUTILX from a previous DSN1COPY backup, make another DSN1COPY copy of that table space after the LOGONLY recovery is complete and before recovering any other catalog or directory objects.

      After you recover SYSUTILX and either recover or rebuild its indexes, and before you recover other system and user table spaces, determine what utilities were running at the primary site.

    2. Recover the catalog and directory in the correct order.

      If you have user-defined catalog indexes, rebuilding them is optional until the tracker Db2 site becomes the takeover Db2 site. (You might want to rebuild them sooner if you require them for catalog query performance.) However, if you are recovering user-defined catalog indexes, do the recovery in this step.

      Exception: Start of changeIf you have any user-defined, STOGROUP-managed indexes on the Db2 catalog and directory, you must rebuild IBM®-defined indexes by name. End of change
    3. If needed, recover other system data such as the data definition control support table spaces and the resource limit facility table spaces.
    4. Recover user data and, optionally, rebuild your indexes.

      You do not need to rebuild indexes unless you intend to run dynamic queries on the data at the tracker site.

    For a tracker site, Db2 stores the conditional restart ENDRBA or ENDLRSN in the page set after each recovery completes successfully. By storing the log truncation value in the page set, Db2 ensures that it does not skip any log records between recovery cycles.
  7. Issue the DISPLAY UTILITY(*) command for a list of currently running utilities.
  8. Run the DIAGNOSE utility with the DISPLAY SYSUTIL statement to determine the names of the object on which the utilities are running.
    Installation SYSOPR authority is required.
  9. Perform the following actions for objects at the tracker site on which utilities are pending.
    Restrictions apply to these objects because Db2 prevents you from using the TERM UTILITY command to remove pending statuses at a tracker site.
    • If a LOAD, REORG, REPAIR, or COPY utility job is in progress on any catalog or directory object at the primary site, shut down Db2 subsystem. You cannot continue recovering by using the list of catalog and directory objects. Therefore, you cannot recover any user data. At the next recovery cycle, send a full image copy of the object from the primary site. At the tracker site, use the RECOVER utility to restore the object.
    • If a LOAD, REORG, REPAIR, or COPY utility job is in progress on any user data, at the next recovery cycle, send a full image copy of the object from the primary site. At the tracker site, use the RECOVER utility to restore the object.
    • If an object is in the restart-pending state, use LOGONLY recovery to recover the object when that object is no longer in a restart-pending state.
      Data sharing
      If read/write shared data (GPB-dependent data) is in the advisory recovery pending state, the tracker Db2 site performs recovery processing. Because the tracker Db2 site always performs a conditional restart, the postponed indoubt units of recovery are not recognized after the tracker Db2 site restarts.
  10. After all recovery has completed at the tracker site, shut down the tracker Db2 site.
    This is the end of the tracker site recovery cycle.
  11. Optional: Stop and start the tracker Db2 site several times before completing a recovery cycle.