Recovering in a data mirroring environment

In a data mirroring environment, you can recover data at your secondary site from a disaster at your primary site.

About this task

This procedure applies to all Db2 data mirroring scenarios except those that use Extended Remote Copy (XRC). This general procedure is valid only if you have established and maintained consistency groups before the disaster struck the primary site. If you use data mirroring to recover, you must recover your entire Db2 subsystem or data sharing group with data mirroring.

You do not need to restore Db2 image copies or apply Db2 logs to bring Db2 data to the current point in time when you use data mirroring. However, you might need image copies at the recovery site if the LOAD, UNLOAD, or RECOVER utility was active at the time of the disaster.

Procedure

To recover at the secondary site after a disaster:

  1. At your recovery site, IPL all z/OS® images that correspond to the z/OS images that you lost at your primary site.
  2. For environments that do not use data sharing, continue with step 3.
    Data sharing
    For data sharing groups, you must remove old information from the coupling facility.
    1. Enter the following z/OS command to display the structures for this data sharing group:
      D XCF,STRUCTURE,STRNAME=grpname*
    2. For group buffer pools and the lock structure, enter the following command to force off the connections in those structures:
      SETXCF FORCE,CONNECTION,STRNAME=strname,CONNAME=ALL
    3. Delete all the Db2 coupling facility structures by using the following command for each structure:
      SETXCF FORCE,STRUCTURE,STRNAME=strname
  3. If you are using the distributed data facility, set LOCATION and LUNAME in the BSDS to values that are specific to your new primary site.
    To set LOCATION and LUNAME, run the stand-alone change log inventory utility (DSNJU003) with the following control statement:
    DDF LOCATION=locname, LUNAME=luname
  4. Start all Db2 members by using local DSNZPARM data sets and perform a normal restart.
    Data sharing
    For data sharing groups, Db2 performs group restart. Shared data sets are set to GRECP (group buffer pool RECOVER-pending) status, and pages are added to the LPL (logical page list).
  5. For scenarios other than data sharing, continue to step 6.
    Data sharing
    For objects that are in GRECP status, Db2 automatically recovers the objects during restart. Message DSNI049I is issued when the recovery for all objects that are in GRECP status is complete. A message is issued for each member, even if the member did not perform GRECP recovery.

    After message DSNI049I is issued:

    1. Display all data sets with GRECP or LPL status by issuing the following Db2 command:
      -DISPLAY DATABASE(*) SPACENAM(*) RESTRICT(GRECP, LPL) LIMIT(*)
      Record the output that this command generates.
  6. Use the following Db2 command to display all utilities that the failure interrupted:
    -DISPLAY UTILITY(*)
    If utilities are pending, record the output from this command, and continue to the next step. You cannot restart utilities at a recovery site. You will terminate these utilities in step 8. If no utilities are pending, continue to step number 9.
  7. Use the DIAGNOSE utility to access the SYSUTIL directory table.
    You cannot access this directory table by using normal SQL statements (as you can with most other directory tables). You can access SYSUTIL only by using the DIAGNOSE utility, which is normally intended to be used under the direction of IBM® Software Support.

    Use the following control statement to run the DIAGNOSE utility job:

    DIAGNOSE DISPLAY SYSUTIL

    To stop the utility, issue this control statement:

    END DIAGNOSE

    Examine the output. Record the phase in which each pending utility was interrupted, and record the object on which each utility was operating.

  8. Terminate all pending utilities with the following command:
    -TERM UTILITY(*)
  9. For environments that do not use data sharing, continue to step 10.
    Data sharing
    For data sharing groups, use the following START DATABASE command on each database that contains objects that are in LPL status:
    -START DATABASE(database) SPACENAM(*)

    When you use the START DATABASE command to recover objects, you do not need to provide Db2 with image copies.

    Tip: Use up to 10 START DATABASE commands for each Db2 subsystem to increase the speed at which Db2 completes this operation. Multiple commands that run in parallel complete faster than a single command that specifies the same databases.
  10. Start all remaining database objects with the following START DATABASE command:
    START DATABASE(*) SPACENAM(*)
  11. For each object that the LOAD utility places in a restrictive status, take one of the following actions:
    • If the object was a target of a LOAD utility control statement that specified SHRLEVEL CHANGE, restart the LOAD utility on this object at your convenience. This object contains valid data.
    • If the object was a target of a LOAD utility control statement that specified SHRLEVEL NONE and the LOAD job was interrupted before the RELOAD phase, rebuild the indexes on this object.
    • If the object was a target of a LOAD utility control statement that specified SHRLEVEL NONE and the LOAD job was interrupted during or after the RELOAD phase, recover this object to a point in time that is before this utility ran.
    • Otherwise, recover the object to a point in time that is before the LOAD job ran.
  12. For each object that the REORG utility places in a restrictive status, take one of the following actions:
    • When the object was a target of a REORG utility control statement that specified SHERLEVEL NONE:
      • If the REORG job was interrupted before the RELOAD phase, no further action is required. This object contains valid data, and the indexes on this object are valid.
      • If the REORG job was interrupted during the RELOAD phase, recover this object to a point in time that is before this utility ran.
      • If the REORG job was interrupted after the RELOAD phase, rebuild the indexes on the object.
    • When the object was a target of a REORG utility control statement that does not specify SHRLEVEL NONE:
      • If the REORG job was interrupted before the SWITCH phase, no further action is required. This object contains valid data, and the indexes on this object are valid.
      • If the REORG job was interrupted during the SWITCH phase, no further action is required. This object contains valid data, and the indexes on this object are valid.
      • If the REORG job was interrupted after the SWITCH phase, you might need to rebuild non-partitioned secondary indexes.