Database Backup and Restore with Integrated Index Reorganization
First Claim
1. A method for reorganizing a source index tree of a database table resulting in a target index tree of the database table, the method comprising:
- performing a backup of the source index tree from respective source storage locations, wherein the source index tree comprises source leaf pages and source non-leaf pages, wherein the source leaf pages comprise index records specifying respective index keys and respective table row identifiers of the database table, a source logical order defined by a sequence of the respective index keys of the index records, and a source physical order defined by a sequence of the respective source storage locations, wherein the source physical order of the source leaf pages being possibly different from the source logical order of the source leaf pages, and wherein performing the backup of the source index tree from the source storage locations comprises;
determining a sequence of the source storage locations according to the source logical order of the source leaf pages,reading the source leaf pages from the source storage locations according to the determined sequence of the source storage locations, andconstructing target leaf pages of the target index tree, the target leaf pages having copies of the index records and a target logical order defined by the sequence of the index keys of the copies of the index records; and
performing a restore of the target index tree at target storage locations, wherein performing the restore of the target index tree at target storage locations comprises;
writing the constructed target leaf pages to the respective target storage locations defining a target physical order of the target leaf pages, the target physical order corresponding to the target logical order of the target leaf pages,constructing target non-leaf pages of the target index tree based on the distribution of the index keys among the constructed leaf pages, andwriting the constructed target non-leaf pages to the respective target storage locations.
2 Assignments
0 Petitions
Accused Products
Abstract
According to an embodiment of the present invention, a method for reorganizing a source index tree of a database table resulting in a target index tree of the database table is provided. A backup process reads source leaf pages of the source index tree in a logical order defined by a sequence of index keys. The logical order can be different from a physical order of the source leaf pages defined by a sequence of respective storage locations. The backup process constructs target leaf pages of the target index tree maintaining the logical order. A restore process constructs target non-leaf pages of the target index tree based on the distribution of the index keys among the constructed leaf pages and stores the target leaf and non-leaf pages.
-
Citations
26 Claims
-
1. A method for reorganizing a source index tree of a database table resulting in a target index tree of the database table, the method comprising:
-
performing a backup of the source index tree from respective source storage locations, wherein the source index tree comprises source leaf pages and source non-leaf pages, wherein the source leaf pages comprise index records specifying respective index keys and respective table row identifiers of the database table, a source logical order defined by a sequence of the respective index keys of the index records, and a source physical order defined by a sequence of the respective source storage locations, wherein the source physical order of the source leaf pages being possibly different from the source logical order of the source leaf pages, and wherein performing the backup of the source index tree from the source storage locations comprises; determining a sequence of the source storage locations according to the source logical order of the source leaf pages, reading the source leaf pages from the source storage locations according to the determined sequence of the source storage locations, and constructing target leaf pages of the target index tree, the target leaf pages having copies of the index records and a target logical order defined by the sequence of the index keys of the copies of the index records; and performing a restore of the target index tree at target storage locations, wherein performing the restore of the target index tree at target storage locations comprises; writing the constructed target leaf pages to the respective target storage locations defining a target physical order of the target leaf pages, the target physical order corresponding to the target logical order of the target leaf pages, constructing target non-leaf pages of the target index tree based on the distribution of the index keys among the constructed leaf pages, and writing the constructed target non-leaf pages to the respective target storage locations. - View Dependent Claims (2, 3, 4, 5, 7, 8, 9)
-
-
6. (canceled)
-
10-14. -14. (canceled)
-
15. A computer program product for reorganizing a source index tree of a database table resulting in a target index tree of the database table, the computer program product comprising a computer readable storage medium having computer readable program code embodied thereon, wherein the computer readable program code, when executed on a computing device, causes the computing device to:
-
perform a backup of the source index tree from respective source storage locations, wherein the source index tree comprises source leaf pages and source non-leaf pages, wherein the source leaf pages comprise index records specifying respective index keys and respective table row identifiers of the database table, a source logical order defined by a sequence of the respective index keys of the index records, and a source physical order defined by a sequence respective source storage locations, wherein the source physical order of the source leaf pages being possibly different from the source logical order of the source leaf pages, and wherein the computer readable program code to perform the backup of the source index tree from the source storage locations further causes the computing device to; determine a sequence of the source storage locations according to the source logical order of the source leaf pages, read the source leaf pages from the source storage locations according to the determined sequence of the source storage locations, and construct target leaf pages of the target index tree, the target leaf pages having copies of the index records and a target logical order defined by the sequence of the index keys of the copies of the index records; and perform a restore of the target index tree at target storage locations, wherein the computer readable program code to perform the restore of the target index tree at target storage locations further causes the computing, device to; write the constructed target leaf pages to the respective target storage locations defining a target physical order of the target leaf pages, the target physical order corresponding to the target logical order of the target leaf pages, construct target non-leaf pages of the target index tree based on the distribution of the index keys among the constructed leaf pages, and write the constructed target non-leaf pages to the respective target storage locations. - View Dependent Claims (16, 17, 18, 19, 20)
-
-
21. An apparatus for reorganizing a source index tree of a database table resulting in a target index tree of the database table, the apparatus comprising:
-
a processor; and a memory coupled to the processor, wherein the memory comprises instructions which, when executed by the processor, cause the processor to; perform a backup of the source index tree from respective source storage locations, wherein the source index tree comprises source leaf pages and source non-leaf pages, wherein the source leaf pages comprise index records specifying respective index keys and respective table row identifiers of the database table, a source logical order defined by a sequence of the respective index keys of the index records, and a source physical order defined by a sequence of the respective source storage locations, wherein the source physical order of the source leaf pages being possibly different from the source logical order of the source leaf pages, and wherein the computer readable program code to perform the backup of the source index tree from the source storage locations further causes the computing device to; determine a sequence of the source storage locations according to the source logical order of the source leaf pages, read the source leaf pages from the source storage locations according to the determined sequence of the source storage locations, and construct target leaf pages of the target index tree, the target leaf pages having copies of the index records and a target logical order defined by the sequence of the index keys of the copies of the index records; and perform a restore of the target index tree at target storage locations, wherein the computer readable program code to perform the restore of the target index tree at target storage locations further causes the computing device to; write the constructed target leaf pages to the respective target storage locations defining a target physical order of the target leaf pages, the target physical order corresponding to the target logical order of the target leaf pages, construct target non-leaf pages of the target index tree based on the distribution of the index keys among the constructed leaf pages, and write the constructed target non-leaf pages to the respective target storage locations. - View Dependent Claims (22, 23, 24, 25, 26)
-
Specification