Overview of the online reorganization process
IMS Online Reorganization Facility performs the reorganization process in several phases.
Reorganization phases occur in the following sequence:
- Verification phase
- Copy phase
- Reorganization phase
- Apply phase
- Takeover phase
- Completion phase
Descriptive messages are written to the MSGPRINT log. These messages indicate the start and end of each phase and the progress of the tasks that are being performed.
IMS Online Reorganization Facility makes a copy of the target databases and reorganizes the copy. While that phase is being processed, IMS Online Reorganization Facility captures any updates that were made since the first copy was taken and processes those recent updates against the reorganized copy. This process continues until all the updates have been applied.
A single /DBR command outage is necessary at the end of the reorganization to alter the database data sets from the shadow names to the original names and to make any ACB or DMB replacements in the online systems.
After the updates are applied, a user-scheduled short outage occurs. During the outage, the database data sets are swapped, and the new reorganized database becomes available.
To schedule this outage, use the TAKEOVER.WINDOW keyword.
The following figure shows the data flow through the phases of IMS Online Reorganization Facility processing.
The Verification phase
The Verification phase is the initial phase during which the IMS environment components and databases are verified to ensure that they meet the requirements. The following verifications are performed during this phase:
- IMS Release and component requirements are met.
- DBRC registration and database state requirements are met.
- Database DBD requirements are met.
- Database data set requirements are met. They cannot exceed 42 characters in length and they must be cataloged.
- The level of IMS Online Reorganization Facility for the STEPLIB in the batch job and the IMS control regions is verified.
- JCL requirements are met.
- Control statement syntax is verified.
- Shadow data set (.S data sets) are constructed and deleted, and reallocation is performed and verified.
- Temporary (.T data sets) ALTER data sets are deleted, and the deletions are verified.
- Other miscellaneous checking is performed.
The Verification phase attempts to perform all necessary verifications at the beginning of the reorganization. If minimum requirements are not met, this phase fails with a U999 abend, and all messages are written to the MSGPRINT log. The original databases are not impacted.
The Copy phase
- It captures all changes that are made to the primary database data sets.
- It sends the changes to the Online Reorganization batch utility.
- It prepares the changes for the application during the Copy phase.
The Copy phase copies only the original primary database to a shadow copy. The shadow data sets are allocated during the Verification phase. The shadow data sets are dynamically constructed based on the original data set names and an appended .S suffix.
- Any application update calls to the primary database are captured.
- Changes are sent to the IMS Online Reorganization Facility batch utility.
- Changes are made to the shadow primary database.
- The shadow primary index (for HIDAM or PHIDAM) is created from the shadow primary database.
The primary index is rebuilt without any effect on the availability of the original databases. Secondary indexes are not copied to shadow databases in this phase; they are rebuilt later.
The Reorganization phase
The following tasks, which are necessary to complete a reorganization of a primary database and all of its associated databases, are performed during the Reorganization phase.
- The shadow database is unloaded.
- The shadow database is reloaded.
- Any existing secondary indexes are rebuilt. (Indexes for HALDB databases are not rebuilt unless you specify PSINDEXBLD(Y).)
- Any existing internal logical relationships are rebuilt.
- The reorganized shadow databases of the original databases that are registered as RECOV in DBRC are image copied and can be pointer checked.
During the Reorganization phase, any application update calls that are captured by the online component of IMS Online Reorganization Facility are written to a temporary data set for use in the subsequent Apply phase.
The Apply phase
During the Apply phase, all of the application calls that occurred since the start of the reorganization process are applied to the shadow data sets. Throughout the Apply phase, any application update calls that are issued in the IMS online regions are captured and stored in a temporary data set. After the Apply phase determines that it applied nearly all of the captured update calls, it issues a /DBR command. The /DBR command stops additional access to the original database in the IMS online regions and turns on the prohibit authorization flag in DBRC. The database and its indexes are unavailable until after the Takeover phase. After all of the captured update calls are applied, the Apply phase ends.
The Takeover phase
The Takeover phase begins when the Apply phase completes.
During the Takeover phase, the original databases are swapped with the reorganized shadow databases. The following tasks are performed in the following order during the Takeover phase:
- Verifies that the database and its indexes are unavailable.
- Notifies DBRC of the REORG with a time stamp after the /DBR command.
- Notifies DBRC of the image copy with a time stamp that is greater than the REORG time stamp.
- Notifies DBRC of logs that were created during the Apply phase. These logs are marked in error until the Takeover phase completes.
- Notifies DBRC of a DB ALLOC that log data sets require.
- Swaps the reorganized shadow data sets with the original database data sets.
- Copies the NEWDBD to the current DBDLIB if DBDCOPY(Y) is specified.
- Performs the ACBGEN and ACBLIB or DMB replacements if DBD changes have occurred.
- Authorizes the databases in DBRC.
- Uses a /START command to start the databases.
- Continues to recover the log marked in error. Uses a valid time stamp that is greater than the DBRC REORG and image copy notifications to correct the previous log that was marked in error. The Takeover phase does not wait for the previous log correction to occur.
- Notifies DBRC of the log that has the new time stamp.
If the Takeover phase completes abnormally, the job abends, the databases are left in a prohibit authorization (PROHIBIT AUTH = ON) status, and the information that is required to restart the Takeover phase is saved in the restart data set.
You can restart the IMS Online Reorganization Facility batch job only if the job terminated abnormally within the Takeover phase. No other phase of IMS Online Reorganization Facility is restartable. For more information, see Takeover restart processing.
Backout can be performed when the previous online reorganization job for a specific database (DBD name or partition name) failed during the Takeover phase and TAKEOVER(BACKOUT) is specified in HRFSYSIN.
- Delete a database reorganization record
- Delete an image copy record
- Delete an allocation record
- Delete PRILOG and SLDS records
- Back out the original database data sets
The Completion phase
The Completion phase is the final phase of IMS Online Reorganization Facility processing.
During this phase, the following cleanup tasks are performed:
- All of the final reports and messages are written.
- If you specified DELETE(Y), shadow data sets are deleted.
- Data sets are deallocated.
- Miscellaneous cleanup tasks are performed.
- The IMS Online Reorganization Facility batch job ends.