Creating secondary indexes

Use IMS™ Index Builder to create new secondary indexes without a full reorganization of the physical database.

Build secondary indexes of a physical IMS database for one of the following purposes:
  • To recover one or more damaged secondary indexes and avoid a full database reorganization.
  • To avoid taking image copies of secondary indexes. Instead, you can use IMS Index Builder to build indexes after recovering the physical IMS database. In this case, the full recovery of an IMS database with secondary indexes becomes a two-step process as follows:
    • Recover the physical IMS database
    • Use IMS Index Builder to build the secondary index databases
  • After reloading a HALDB or in the course of online reorganization.

The indexes to be built must be either reusable or deleted/defined by IDCAMS. Because IMS Index Builder rebuilds indexes in VSAM load mode by the control interval (CI), the free space value in the DEFINE CLUSTER command must be low. IMS Index Builder will correctly process indexes with non-unique keys.

IMS Index Builder performs the following functions to build the secondary indexes:
  • Analyzes the control statements, the DBD library, the RECONs, and the physical database, and plans the index build process; initiates WTO capture on the master address space and initiates IMS Tools Knowledge Base.
  • Starts tasks to scan the prime database. Initiates WTO capture for every scan address space that is created.
  • Starts tasks to sort the index records that are built. Initiates WTO capture for every sort address space that is created.
  • When scans are finished, signals the end of input to all sort tasks. Stops WTO capture for scan address spaces.
  • When sorts are finished, initiates the index load process. Stops WTO capture for sort address spaces.
  • Initializes empty indexes and indexes that contain errors. ILDS initialization is included if HALDB.
  • Sends messages to IMS Index Builder output and IMS Tools Knowledge Base and reports the progress of the process and critical control events.
  • Ensures that all scan and sort tasks that are started by IMS Index Builder end properly.
  • Notifies DBRC RECON for indexes that are successfully built.
  • Stops WTO capture for the master address space and creates the WTO capture report.
  • Ends the IMS Index Builder main task with the relevant return code.

The following figure shows the functions that IMS Index Builder performs when building secondary indexes:

Figure 1. Building secondary indexes
This flow chart shows the following lines flowing into IMS Index Builder: