An
improved method and
system for on-line reorganization of an IMS
database while allowing concurrent updates. In one embodiment, the method involves building and dynamically maintaining a map of free blocks in the IMS
database. The user then provides a
list of candidate
database records to be analyzed. The physical characteristics of each database
record on the
list are then analyzed. Calculations are made to identify fragmented database records and the segments which contain fragmented boundary twin chains. A reorganization recommendation
list is created for each database
record on the list, including fragmented boundary twin chains. Each fragmented database
record on the reorganization recommendation list is then reorganized. This reorganization process includes the following steps: a) determine the number of blocks needed; b) assign and protect the number of blocks needed; c) identify the assigned blocks; d) retrieve the database record, delete the database record, and insert the database record into the identified blocks; e)
commit the changes to the database. This process of analyzing the physical characteristics of each database record on the list and reorganizing the database records is continued until each database record on the list is no longer fragmented. User access to the database is maintained (i.e., the database is on-line) during the analyzing and reorganizing processes.