How the self-healing pointer process works

The elements of the self-healing pointer process can be seen in the following figure, which shows the interrelationships between the elements prior to a database reorganization.

Figure 1. HALDB pointer before a reorganization
An EPS of a secondary index or logically related segment points to the ILK of a target segment. An ILE in an ILDS points to the same ILK. The current reorganization number is 5.

Each secondary index entry and each logical child segment contains the key of its target record. For secondary indexes, the key of the target's root segment is included in the prefix. For logical child segments, the concatenated key of the logical parent is included in the segment data.

Each segment in a PHDAM or PHIDAM database has an indirect list key (ILK). The ILK is unique for the segment type across the entire database. It is composed of the relative byte address (RBA), partition ID, and partition reorganization number of the segment when it was first created, as shown in the following figure. The ILK for a segment never changes. It is maintained across reorganizations.

Figure 2. Format of an ILK
Begin figure description: An ILK is shown as a rectangle on its side. First section of rectangle is 4-byte field for initial RBA. Second section is 2-byte field for partition ID. Last section is 2-byte field for reorganization number. End figure description.

Each secondary index entry or logical child segment has an extended pointer set (EPS). The EPS includes the ILK of its target segment. It also contains the RBA, partition ID, and partition reorganization number for the target segment. These parts of the EPS might not be accurate. That is, they might not reflect the current location of the target segment or the current reorganization number of the target segment's partition. In the preceding figure they are accurate.

The target segment has an indirect list entry (ILE) in the ILDS for a partition. The ILE contains accurate information about the target segment. This includes its current RBA, the correct partition ID, and the current reorganization number for the partition. The key of the ILE is composed of the ILK and the segment code of the target segment.

The reorganization number for a partition is physically stored in the partition's first database data set. This number is initialized by partition initialization or load, and incremented with each reorganization that reloads segments in the partition.