Deleting partitions from an existing HALDB database

You can delete partitions from an existing HALDB database. You do this typically when a partition has little data. Deleting a partition usually involves moving its records to another partition.

Prior to deleting a partition, you should:

Procedure

  1. Determine whether your HALDB database performs partition selection using high keys or a partition selection exit routine. If your HALDB database is using a partition selection exit routine you must take extra steps when you delete a partition.
  2. Identify all other partitions that will receive records previously stored in the deleted partition. You must unload, initialize, and reload these partitions in addition to the deleted partition.
  3. Determine if the HALDB database uses a secondary index (PSINDEX). You might need to rebuild the PSINDEX after you delete a partition.
  4. Make an image copy of the partition.
  5. Export the partition definition of the partition you are going to delete by using the HALDB Partition Definition utility (%DFSHALDB).
  6. Disable the partitions that you intend to delete.
    Disabling a partition effectively removes the partition from the HALDB database without deleting any information about the partition from the RECON data set. The partition definition, including the partition ID number, are retained in the RECON data set. If you need to restore the partition, you can easily enable it again and any prior image copies are still usable. After you are certain you will not need to restore the partition, you can then delete the partition record from the RECON data set.

The following figure shows the deletion of a partition from a HALDB database that performs partition selection using high keys. The HALDB database has partitions A, B, C, and D. Partition B, with a high key of 400, is deleted. The records in partition B move to partition C, meaning that partition C is affected by the deletion of partition B. When the definition of partition B is deleted, IMS sets the PINIT flag for partition C. Partition initialization initializes partition C. Partitions A and D are not affected by the change.

Figure 1. Deleting a partition with key range partitioning
A HALDB has four partitions: A, B, C, and D. Partition B is deleted, its records are moved to Partition C, and only three partitions remain in the HALDB database.