Interaction between application of a log and maintenance of a table that maps record identifiers during online reorganization of a database
First Claim
1. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform method steps for performing reorganization in a database management system (DBMS), said method steps comprising:
- reorganizing a data record in an old area of a table space, wherein said data record has an old record identifier (RID), while read/write access to said old area is retained;
directing said reorganized version of said data record to a new area in said table space, wherein said reorganized version of said data record has a new RID, while read/write access to said old area is retained;
maintaining a mapping table that maps between said old RID and said new RID;
copying a subset of a log;
translating a log entry RID for a log entry to said new RID, wherein said log entry RID is said old RID; and
applying said translated log entry with said new RID to said reorganized version of said data record in said new area in said table space.
0 Assignments
0 Petitions
Accused Products
Abstract
The present invention includes reorganization of a Database Management System (DBMS) The reorganization of the present invention is implemented by recording a first current Relative Byte Address (RBA) Then, data is copied from the old area in the table space to a new area in the table space in reorganized form. In the present invention, throughout most of reorganization a user maintains access to the DBMS'"'"'s normal facilities to read and write to the old area. The DBMS uses its normal facilities to record writing, which occurs during reorganization, in,a log. The reorganization in accordance with the present invention reads the log (that has been written to during reorganization) and processes the log to the new area to bring the new area up to date. This process is performed with the use of a RID mapping table. Finally, at the end of reorganization, the user'"'"'s access is switched from the old area to the new area.
-
Citations
22 Claims
-
1. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform method steps for performing reorganization in a database management system (DBMS), said method steps comprising:
-
reorganizing a data record in an old area of a table space, wherein said data record has an old record identifier (RID), while read/write access to said old area is retained; directing said reorganized version of said data record to a new area in said table space, wherein said reorganized version of said data record has a new RID, while read/write access to said old area is retained; maintaining a mapping table that maps between said old RID and said new RID; copying a subset of a log; translating a log entry RID for a log entry to said new RID, wherein said log entry RID is said old RID; and applying said translated log entry with said new RID to said reorganized version of said data record in said new area in said table space. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform method steps for reorganizing a database, said method steps comprising:
-
recording a first current relative byte address (RBA) for a log as a first variable, while read/write access to an old area of a table space is retained; performing reorganization of a data record with an old record identifier (RID) in said old area of said table space such that a reorganized version of said data record has a new RID in a new area of said table space, while read/write access to said old area is retained; storing a second current RBA for said log as a second variable; reading said first variable; reading said second variable; applying a first log entry including a log entry RID, wherein said log entry RID is said old RID, to said reorganized version of said data record identified by said new RID in said new area by using a RID mapping table to translate said old RID to said new RID, while read\write access to said old area is retained; recording a third current RBA for said log as a third variable; comparing a next iteration, which is a difference between said third variable and said second variable, with a most recent iteration, which is a difference between said second variable and said first variable; implementing an action to allow said reorganization to catch up if said next iteration is at least as much as said most recent iteration; quiescing write access to said old area, while said second variable is set to said third variable; applying a second log entry with a second log entry RID, wherein said second log entry RID is said old RID, to said reorganized version of said data record identified by said new RID, by using said RID mapping table to translate said old RID to said new RID, while read-only access is retained; quiescing all access of said table space; converting access from said old area to said new area; creating a backup copy of said table space containing said new area; starting read/write access to said table space containing said new area; and erasing said old area and said RID mapping table. - View Dependent Claims (8, 9, 10, 11)
-
-
12. A computer program product, comprising:
-
a computer usable medium having a computer readable program code means embodied in said medium for causing a database management system (DBMS) to be reorganized, the computer readable program code means comprising, computer readable program code means for causing a computer to reorganize a data record in an old area of a table space, wherein said data record has an old record identifier (RID), while read/write access to said old area is retained; computer readable program code means for causing a computer to direct said reorganized version of said data record to a new area in said table space, wherein said reorganized version of said data record has a new RID, while read/write access to said old area is retained; computer readable program code means for causing a computer to maintain a mapping table that maps between said old RID and said new RID; computer readable program code means for causing a computer to copy a subset of a log; computer readable program code means for causing a computer to translate a log entry RID for a log entry to said new RID, wherein said log entry RID is said old RID; and computer readable program code means for causing a computer to apply said translated log entry with said new RID to said reorganized version of said data record in said new area in said table space. - View Dependent Claims (13, 14, 15, 16, 17)
-
-
18. A computer program product, comprising:
-
a computer usable medium having computer readable program code means embodied in said medium for causing a database management system (DBMS) to be reorganized, the computer readable program code means comprising, computer readable program code means for causing a computer to record a first current relative byte address (RBA) for a log as a first variable, while read/write access to an old area of a table space is retained; computer readable program code means for causing a computer to perform reorganization Of a data record with an old record identifier (RID) in said old area of said table space such that a reorganized version of said data record has a new RID in a new area of said table space, while read/write access to said old area is retained; computer readable program code means for causing a computer to store a second current RBA for said log as a second variable; computer readable program code means for causing a computer to read said first variable; a computer readable program code means for causing a computer to read said second variable; computer readable program code means for causing a computer to apply a first log entry including a log entry RID, wherein said log entry RID is said old RID, to said reorganized version of said data record identified by said new RID in said new area by using a RID mapping table to translate said old RID to said new RID, while read\write access to said old area is retained; computer readable program code means for causing a computer to record a third current RBA for sad foe as a third variable; computer readable program code means for causing a computer to compare a next iteration, which is a difference between said third variable and said second variable, with a most recent iteration, which is a difference between said second variable and said first variable; computer readable program code means for causing a computer to implement an action to allow said reorganization to catch up if said next iteration is at least as much as said most recent iteration; computer readable program code means for causing a computer to quiesce write access to said old area, while said second variable is set to said third variable; computer readable program code means for causing a computer to apply a second log entry with a second log entry RID, wherein said second log entry RID is said old RID, to said reorganized version or said data record identified by said new RID, by using said RID mapping table to translate said old RID to said new RID, while read-only access is retained; computer readable program code means for causing a computer to quiesce all access of said table space; computer readable program code means for causing a computer to convert access from said old area to said new area; computer readable program code means for causing a computer to create a backup copy of said table space containing said new area; computer readable program code means for causing a computer to start read/write access to said table space containing said new area; and computer readable program code means for causing a computer to erase said old area and said RID mapping table. - View Dependent Claims (19, 20, 21, 22)
-
Specification