Role of consistency groups in recovery

Generally a consistency group is a collection of volumes that contain consistent, related data. Consistency groups play an important role in Db2 recovery.

A consistency group, which is a collection of related data, can span logical storage subsystems and disk subsystems. For Db2 specifically, a consistency group contains an entire Db2 subsystem or an entire Db2 data sharing group.

The following Db2 elements comprise a consistency group:

  • Catalog tables
  • Directory tables
  • BSDS
  • Logs
  • All user data
  • ICF catalogs

Additionally, all objects within a consistency group must represent the same point in time in at least one of the following situations:

  • At the time of a backup
  • After a normal Db2 restart

You can use the following methods to create consistency groups:

  • XRC I/O timestamping and system data mover
  • FlashCopy® consistency groups
  • GDPSfreeze policies
  • The Db2 SET LOG SUSPEND command

When a rolling disaster strikes your primary site, consistency groups guarantee that all volumes at the recovery site contain data for the same point in time. In a data mirroring environment, you must perform both of the following actions for each consistency group that you maintain:

  • Mirror data to the secondary volumes in the same sequence that Db2 writes data to the primary volumes.

    In many processing situations, Db2 must complete one write operation before it begins another write operation on a different disk group or a different storage server. A write operation that depends on a previous write operation is called a dependent write. Do not mirror a dependent write if you have not mirrored the write operation on which the dependent write depends. If you mirror data out of sequence, your recovery site will contain inconsistent data that you cannot use for disaster recovery.

  • Temporarily suspend and queue write operations to create a group point of consistency when an error occurs between any pair of primary and secondary volumes.

    When an error occurs that prevents the update of a secondary volume in a single-volume pair, this error might mark the beginning of a rolling disaster. To prevent your secondary site from mirroring a rolling disaster, you must suspend and queue data mirroring by taking the following steps after a write error between any pairs:

    1. Suspend and queue all write operations in the volume pair that experiences a write error.
    2. Invoke automation that temporarily suspends and queues data mirroring to all your secondary volumes.
    3. Save data at the secondary site at a point of consistency.
    4. If a rolling disaster does not strike your primary site, resume normal data mirroring after some amount of time that you define. If a rolling disaster does strike your primary site, follow the recovery procedure in Recovering in a data mirroring environment.