Recovery for HALDB Online Reorganization

After DBRC sets the cursor-active status for the partition in the RECON data sets, and until the copying phase completes and DBRC resets the cursor-active status, you can recover any of the input or output data sets using the Database Recovery utility (DFSURDB0).

To restore the output data sets, the Database Recovery utility uses the database change records (type X'50' log records) and applies them to empty output data sets.

Recommendation: Make an image copy of the output data sets as soon as possible after the online reorganization completes. Recovering from this image copy is faster than recovering from the database change records that are logged during the online reorganization. However, you cannot make an image copy while the partition is in cursor-active status.

To recover an output data set before the online reorganization completes, perform the following tasks:

Procedure

  1. Stop the online reorganization by using the TERMINATE OLREORG command. If the online reorganization encountered an abend, it is stopped automatically.
  2. Issue the /DBR or the UPDATE DB command for the HALDB partition.
  3. Run database change accumulation, as necessary. You can create the JCL by issuing the GENJCL.CA command, or you can run the Database Change Accumulation utility (DFSUCUM0) from your own JCL. The purge time for the change accumulation must be equal to the time of the beginning of the online reorganization to represent restoring from the initial empty state of the data set.
  4. Create the output data set to be recovered, either by using a JCL DD statement or by using Access Method Services, as appropriate.
  5. Recover the database changes. You can create the JCL by issuing the GENJCL.RECOV command. Alternatively, you can run the Database Recovery utility (DFSURDB0) from your own JCL with the DD statement for DFSUDUMP specified as DUMMY to indicate that there is no image copy from which to restore.
  6. Run the Batch Backout utility (DFSBBO00), because you might need to back out uncommitted data.
  7. After you have recovered, and possibly backed-out, all of the required data sets of the HALDB partition, issue the /STA DB or the UPDATE DB command for the HALDB partition.
  8. Issue the INITIATE OLREORG command to resume the online reorganization.

You can also recover an output data set after the online reorganization completes but before an image copy has been made. Follow the same steps as for recovering an output data set before the online reorganization completes, except the steps for stopping and restarting the online reorganization.

In addition, you can recover an output data set from a point other than the beginning of the online reorganization, such as from a full dump of a DASD volume, using existing procedures if the online reorganization is either completed or terminated.

Specifying a purge time for the database change accumulation utility

When you run the Database Change Accumulation utility (DFSUCUM0) for one of the output data sets, specify a purge time that is equal to the online reorganization start time.

Specifying this purge time is necessary if change accumulation records (or an input log) that involve the output data set span the time that a online reorganization was started. Specifying the purge time eliminates database change records from before this point in time and is analogous to eliminating database change records from prior to the start time of an image copy.

Specifying a starting point for the GENJCL.CA and GENJCL.RECOV commands

Even if no image copy exists for the output data sets, the RECON data sets reflect the beginning of the online reorganization as a starting point from which you can perform forward recovery of one of these data sets, even after the online reorganization is complete. Until you make an image copy of an output data set, the GENJCL.CA command treats this starting point as though it were the most recent image copy and causes changes to the output data set to be accumulated from that point. Similarly, the GENJCL.RECOV command prepares recovery of an output data set from this point, even if no physical image copy exists.

Specifying the active data sets for the database image copy utilities

The database image copy utilities always copy from the currently active data sets that are recorded in the RECON data sets. Regardless of whether the A-through-J or the M-through-V data sets are active, you do not need to change the JCL or control statements for these utilities to specify which set of data sets to use.

On the utility control statement for the Database Image Copy utility (DFSUDMP0), the DDNAME does not need to refer to the currently active data set. Regardless of whether the A-through-J or the M-through-V data sets are active, the utility automatically uses currently active data sets.

Example: Assume that the data set for a second data set group defined in the DBD is to be copied, and that the partition name is PARTNO3. Regardless of which set of data sets is active, you can code a DDNAME of either PARTNO3B or PARTNO3N on the control statement. If the A-through-J data sets are active, whether you specify PARTNO3B or PARTNO3N, the utility copies from PARTNO3B. Likewise, if the M-through-V data sets are active, the utility copies from PARTNO3N.

In the JCL statements for the Database Image Copy utility, you should omit the DD statement that refers to the input data set. Based on whether the A-through-J or the M-through-V data sets are active, the utility dynamically allocates the appropriate data set. A DD statement that refers to a specific data set name can cause the utility job to fail because of a “Data Set Not Found” condition during job-step initiation. This condition occurs if an inactive data set name is coded in the JCL and the data set does not exist.

Rebuilding the primary indexes and the ILDS while in the cursor-active state

If the integrated HALDB Online Reorganization function is stopped before completion and the partition remains in the cursor-active state, you can still use the HALDB Index/ILDS Rebuild utility (DFSPREC0) to rebuild both the X and the Y primary index data sets and the ILDS.

When the primary index must be rebuilt, the DFSPREC0 utility rebuilds both the X and the Y data sets because the records in the partition are split between the input and output sets of data sets.