Method and system for preserving an original table schema
First Claim
Patent Images
1. A method for preserving an original schema of a table comprising a plurality of rows, the method comprising:
- storing the original schema of the table in a designated table prior to performing a first schema change on the table, wherein the plurality of rows in the table are not self-describing prior to performance of the first schema change;
performing the first schema change on the table to create a new schema for the table;
defining each of one or more rows that are inserted into or updated in the table after performance of the first schema change using the new schema;
making each of the one or more inserted or updated rows a self-describing row by storing metadata describing the new schema in the row; and
rebuilding the table using a valid backup copy of the table,wherein, when a row of the valid backup copy is self-describing, metadata stored in the row is used to rebuild a corresponding row of the table,wherein, when the row of the valid backup copy is not self-describing, the original schema stored in the designated table is used to rebuild the corresponding row of the table, andwherein a backup copy of the table is valid when data in the backup copy is not corrupted or otherwise unsuitable for data recovery.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention is related to a method and system for preserving an original table schema for a table in a database system that supports dynamic table schema changes. The method and system includes storing the original table schema for the table in a designated table prior to performing a schema change on the table. By storing the original table schema in the designated table, a backup copy of the table that includes rows which are not self-describing can be used for data recovery.
31 Citations
12 Claims
-
1. A method for preserving an original schema of a table comprising a plurality of rows, the method comprising:
-
storing the original schema of the table in a designated table prior to performing a first schema change on the table, wherein the plurality of rows in the table are not self-describing prior to performance of the first schema change; performing the first schema change on the table to create a new schema for the table; defining each of one or more rows that are inserted into or updated in the table after performance of the first schema change using the new schema; making each of the one or more inserted or updated rows a self-describing row by storing metadata describing the new schema in the row; and rebuilding the table using a valid backup copy of the table, wherein, when a row of the valid backup copy is self-describing, metadata stored in the row is used to rebuild a corresponding row of the table, wherein, when the row of the valid backup copy is not self-describing, the original schema stored in the designated table is used to rebuild the corresponding row of the table, and wherein a backup copy of the table is valid when data in the backup copy is not corrupted or otherwise unsuitable for data recovery. - View Dependent Claims (2, 3, 4)
-
-
5. A computer program product comprising a computer readable storage medium, the computer readable storage medium including a computer readable program for preserving an original schema of a table comprising a plurality of rows, wherein the computer readable program when executed on a computer causes the computer to:
-
store the original schema of the table in a designated table prior to performing a first schema change on the table, wherein the plurality of rows in the table are not self-describing prior to performance of the first schema change; perform the first schema change on the table to create a new schema for the table; define each of one or more rows that are inserted into or updated in the table after performance of the first schema change using the new schema; make each of the one or more inserted or updated rows a self-describing row by storing metadata describing the new schema in the row; and rebuild the table using a valid backup copy of the table, wherein, when a row of the valid backup copy is self-describing, metadata stored in the row is used to rebuild a corresponding row of the table, and wherein, when the row of the valid backup copy is not self-describing, the original schema stored in the designated table is used to rebuild the corresponding row of the table, and wherein a backup copy of the table is valid when data in the backup copy is not corrupted or otherwise unsuitable for data recovery. - View Dependent Claims (6, 7, 8)
-
-
9. A system for preserving an original schema of a table comprising a plurality of rows, the system comprising:
-
a designated table operable to store the original schema of the table, the original schema being stored in the designated table prior to performance of a first schema change on the table, wherein the plurality of rows in the table are not self-describing prior to performance of the first schema change; a first mechanism operable to; perform the first schema change on the table to create a new schema for the table, define each of one or more rows that are inserted into or updated in the table after performance of the first schema change using the new schema, and make each of the one or more inserted or updated rows a self-describing row by storing metadata describing the new schema in the row; and a second mechanism operable to rebuild the table using a valid backup copy of the table, wherein, when a row of the valid backup copy is self-describing, metadata stored in the row is used to rebuild a corresponding row of the table, wherein, when the row of the valid backup copy is not self-describing, the original schema stored in the designated table is used to rebuild the corresponding row of the table, and wherein a backup copy of the table is valid when data in the backup copy is not corrupted or otherwise unsuitable for data recovery. - View Dependent Claims (10, 11, 12)
-
Specification