Scenario: Reorganizing a HALDB database

This scenario demonstrates how to reorganize a HALDB database.

About this task

The following procedure introduces a typical job stream for reorganizing a HALDB database. Some steps are optional.

Tip: If you use IMS HP Unload to unload the database and IMS HP Load to reload the database, you can omit some of the steps in this scenario. For the steps you can omit and for JCL examples to run IMS HP Unload and IMS HP Load, see Example 3: Reorganizing a HALDB database by using IMS HP Unload and IMS HP Load.

Procedure

  1. Optional: Back up the partitions you are reorganizing.
    The IMS Database Image Copy utility (DFSUDMP0) or IMS High Performance Image Copy creates a copy of each data set group of the old partitions. This is the backup copy of your database. It can be used when something goes wrong during the reorganization process.
    Recommendation: This step is not mandatory, however, it is recommended that you always include this step in your reorganization job.
  2. Unload the partitions.

    The IMS HD Reorganization Unload utility (DFSURGU0) or IMS High Performance Unload creates a sequential data set that contains the old unloaded partitions. You can choose to unload a single partition, a sequence of partitions, or all of the partitions in your database.

  3. Optional: Run DBDGEN.

    This IMS procedure creates the DBDs for the reorganized database. If you want to change the parameters in your DBD that affect all partitions, you must reorganize all of the partitions of your database.

  4. Optional: Change partition definitions.

    IMS HALDB Partition Definition utility (DFSHALDB) changes the HALDB partition definitions stored in the DBRC RECON data sets.

  5. Optional: Delete then define the partition data sets.

    IDCAMS deletes and allocates the partition data sets. For VSAM, you must use the REUSE parameter in the original CLUSTER definition to make this step optional. To switch to the VSAM load mode to improve the performance of the ILDS rebuilding process, specify the REUSE parameter in your ILDS CLUSTER definition, and specify ILDSBLD=YES.

  6. Optional: Mark partitions as needing initialization.

    The DBRC CHANGE.DB command marks a partition as needing initialization. If you are sure that every partition you are reorganizing will be populated by segments after reload, you can skip this step. If not, mark all partitions you are reorganizing as needing initialization.

  7. Run the Physical Sequence Sort for Reload utility.

    If you change the partition boundaries during the reorganization, this step is mandatory. Physical Sequence Sort for Reload sorts the unloaded database records so that the partitions are in the order that is required for the subsequent IMS HP Load run.

  8. Run IMS HP Load.

    If you mark the partitions as needing initialization, specify PARTINIT=YES in your IMS HP Load job.

  9. Rebuild the indirect list data set (ILDS).

    Rebuild the ILDS by using the IMS HALDB Index/ILDS Rebuild utility (DFSPREC0). This utility creates the ILDS from the HALDB partition data.

    If the ILDS is already rebuilt in the IMS HP Load step, you can omit this step.

  10. Back up the partitions you have reorganized.

    This step creates the first backup copy of the new partitions.