Method and apparatus for reorganizing an active DBMS table
First Claim
1. A method of on-line reorganization of a source table, comprising the steps of:
- establishing a timestamp identifying a point in time and a state of said source table at said point in time;
making a reorganized copy of said source table by,creating a new object for maintaining said reorganized copy, unloading data from blocks of said source table that are unmodified since said timestamp, andloading the data into said new object;
applying transactions occurring after said timestamp to the reorganized table; and
switching said source table with the reorganized table.
4 Assignments
0 Petitions
Accused Products
Abstract
Reorganization of database tables is performed while the tables being reorganized are available for normal OLTP activity. A trigger is setup to record OLTP activity on a source table to be reorganized. The source table is momentarily locked to establish an SCN checkpoint and determine the location of data blocks allocated for the source table. A copy of the table is created (new table) and blocks untouched/modified since the timestamp are unloaded from the source table and inserted into the new table. Transactions occurring since the timestamp are performed on the new table until no more transactions since the timestamp remain in the trigger record. The new table is switched with the source table (renamed as the source table), and the original source table is dropped.
219 Citations
29 Claims
-
1. A method of on-line reorganization of a source table, comprising the steps of:
-
establishing a timestamp identifying a point in time and a state of said source table at said point in time; making a reorganized copy of said source table by, creating a new object for maintaining said reorganized copy, unloading data from blocks of said source table that are unmodified since said timestamp, and loading the data into said new object; applying transactions occurring after said timestamp to the reorganized table; and switching said source table with the reorganized table. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method of on-line reorganization of a source table, comprising the steps of:
-
employing a trigger on said source table for logging entries of transactions on said source table in a transaction table; obtaining a lock on said source table to prevent transactions from occurring to said source table; deleting entries logged by said trigger prior to obtaining said lock on said source table; establishing a timestamp identifying a point in time and a state of said source table at said point in time; unlocking said source table; creating a reorganized copy of said source table at said timestamp; applying transactions occurring after said timestamp to the reorganized table; and switching said source table with the reorganized table, wherein; said steps of employing a trigger and obtaining a lock are performed prior to said step of establishing a timestamp; and said step of applying transactions comprises the steps of, obtaining an exclusive lock on said source table, applying remaining entries in said transaction log to the reorganized table, and determining if any additional transactions are pending as a result of said exclusive lock, and if additional transactions are pending, performing the steps of, releasing said exclusive lock on said source table, and repeating said steps of obtaining an exclusive lock, applying remaining entries, and determining until no more additional transactions are pending. - View Dependent Claims (9)
-
-
10. A computer readable medium having computer instructions stored thereon that, when loaded into a computer, cause the computer to perform the steps of:
-
establishing a timestamp identifying a point in time and a state of said source table at said point in time; making a reorganized copy of said source table by, creating a new object for maintaining said reorganized copy, unloading data from blocks of said source table that are unmodified since said timestamp, and loading the data into said new object; applying transactions occurring after said timestamp to the reorganized table; and switching said source table with the reorganized table. - View Dependent Claims (11, 12, 13, 14, 15)
-
-
16. A computer readable medium having computer instructions stored thereon that, when loaded into a computer, cause the computer to perform the steps of:
-
employing a trigger on said source table for logging entries of transactions on said source table in a transaction table; obtaining a lock on said source table to prevent transactions from occurring to said source table; deleting entries logged by said trigger prior to obtaining said lock on said source table; establishing a timestamp identifying a point in time and a state of said source table at said point in time; unlocking said source table; creating a reorganized copy of said source table at said timestamp; applying transactions occurring after said timestamp to the reorganized table; and switching said source table with the reorganized table, wherein; said steps of employing a trigger and obtaining a lock are preformed prior to said step of establishing a timestamp; wherein said step of applying transactions comprises the steps of, obtaining an exclusive lock on said source table, applying remaining entries in said transaction log to the reorganized table, and determining if any additional transactions are pending as a result of said exclusive lock, and if additional transactions are pending, performing the steps of, releasing said exclusive lock on said source table, and repeating said steps of obtaining an exclusive lock, applying remaining entries, and determining until no more additional transactions are pending. - View Dependent Claims (17)
-
-
18. An apparatus for on-line reorganization of a source file, comprising:
-
a checkpoint device configured to establish an SCN checkpoint comprising a point in time and identifying a state of said source file at said point in time; a copy mechanism configured to create a reorganized copy of said source file; applying transactions occurring after said timestamp to the reorganized file; switching said source file with the reorganized file; trigger configured to log entries of transactions on said source file in a transaction table; a locking mechanism configured to obtain a lock on said source file to prevent transactions from occurring to said source file; a removal device configured to delete entries logged by said trigger prior to obtaining said lock on said source file; and an unlocking mechanism configured to unlock said source file; wherein; said copy mechanism comprises, a creation device configured to create a new object for maintaining said reorganized copy, an unloading mechanism configured to unload data from blocks of said source file that are unmodified since said timestamp; and a loading mechanism configured to load the data into said new object. - View Dependent Claims (19, 20, 21, 22, 23, 29)
-
-
24. An apparatus for on-line reorganization of a source file, comprising:
-
a checkpoint device configured to establish an SCN checkpoint comprising a point in time and identifying a state of said source file at said point in time; a copy mechanism configured to create a reorganized copy of said source file; applying transactions occurring after said timestamp to the reorganized file; switching said source file with the reorganized file; a trigger configured to log entries of transactions on said source file in a transaction table; a locking mechanism configured to obtain a lock on said source file to prevent transactions from occurring to said source file; a removal device configured to delete entries logged by said trigger prior to obtaining said lock on said source file; and an unlocking mechanism configured to unlock said source file;
wherein said transaction device comprises,an applicator configured to apply remaining entries in said transaction log to the reorganized file; a decision mechanism configured to determine if any additional transactions are pending as a result of said source table being locked; and a controller configured to repeatedly release said exclusive lock on source file, obtain an exclusive lock on said source file, and apply remaining entries in said transaction log until no more additional transactions are pending via utilization of said locking mechanism, unlocking mechanism, applicator, and decision mechanism. - View Dependent Claims (25)
-
-
26. An apparatus for on-line reorganization of a source table, comprising:
-
means for employing a trigger on said source table for logging entries of transactions on said source table in a transaction table; means for obtaining a lock on said source table to prevent transactions from occurring to said source table; means for deleting entries logged by said trigger prior to obtaining said lock on said source table; and means for establishing a timestamp comprising a point in time and identifying a state of said source table at said point in time; means for creating a reorganized copy of said source table in a state just prior to said timestamp; means for unlocking said source table; means for applying transactions occurring after said checkpoint to the reorganized table; and means for switching said source table with the reorganized table; wherein said means for creating a reorganized copy of said source table comprises means for creating a new object for maintaining said reorganized copy; means for unloading data from blocks of said source table that are unmodified since said timestamp, and means for loading the data into said new object. - View Dependent Claims (27, 28)
-
Specification