Adding partitions to an existing HALDB database

You can add partitions to your existing HALDB databases. Typically, you do this when a partition grows too large. Adding a partition usually causes records in an existing partition to be moved to the new partition.

To add a new partition:

  • 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 adding a partition.
  • Identify all existing partitions that contain records that will be redistributed to the new partition. You must unload, initialize, and reload these partitions to add the new partition.
  • After you add the partition, ensure that the online IMS system recognizes the new partition and updates its online database structures. IMS rebuilds its online structures when any of the following events occur:
    • A /START DB HALDB_Master OPEN command is issued.
    • An UPDATE DB NAME(HALDB_Master) START(ACCESS) OPTION(OPEN) command is issued.
    • A DL/I call causes an authorization call to DBRC for a partition affected by the change. The first DL/I call goes through HALDB partition selection again to properly select and authorize the correct partition.

In the following figure, partition D is added to a database that uses high keys for partition selection. The high key of partition D is 300. Previously defined partitions A, B, and C had high keys of 200, 400, and high values. The addition of the new partition requires the movement of records with keys above 200 and up to 300 from partition B to partition D. This means that partition B is affected by the change. When partition D is defined with a high key of 300, IMS sets the PINIT flag for partitions B and D. Partition initialization will initialize these two partitions. Partitions A and C are not affected by the change.

Figure 1. Adding a partition with key range partitioning