Method and apparatus for data rollback
First Claim
1. A method of replicating data stored in a first database, comprising the steps of:
- identifying a snapshot of the data corresponding to a first logical time;
obtaining a first snapshot of a data dictionary corresponding to a second logical time, wherein the second logical time is later than the first logical time and the data dictionary includes information that maps logical structures in the data to storage used to store the data;
analyzing a set logs representing changes made to the data and the data dictionary after the first logical time to identify the changes made to the data dictionary between the first and second logical times;
using the first snapshot of the data dictionary and the identified changes to generate a second snapshot of the data dictionary corresponding to the first logical time; and
using the snapshot of the data, the logs and the second snapshot of the data dictionary to replicate in a second database changes made to the logical structures in the data in the first database after the first logical time.
1 Assignment
0 Petitions
Accused Products
Abstract
A database rollback processor allows rollback, or rewind, of the data and metadata to a point at which a failover or other metadata change occurred, therefore “rewinding” the metadata to a previous consistent point. The rollback processor identifies transaction entries in a redo log resulting in changes to the metadata. The changes are identified backward to a target recovery time. Transactions affecting the metadata are stored in a stack. The transactions are then backed out of the metadata according to the stack to restore the metadata to the state at the target recovery time. Data changes from the redo log may then be applied to the corresponding metadata as it existed at the target recovery time. Since the target recovery time is not bound by the timing of the snapshots, but rather may be at an arbitrary point chosen as the target recovery time, a failover, replication or recovery operation need not rely on the snapshot time.
-
Citations
42 Claims
-
1. A method of replicating data stored in a first database, comprising the steps of:
-
identifying a snapshot of the data corresponding to a first logical time; obtaining a first snapshot of a data dictionary corresponding to a second logical time, wherein the second logical time is later than the first logical time and the data dictionary includes information that maps logical structures in the data to storage used to store the data; analyzing a set logs representing changes made to the data and the data dictionary after the first logical time to identify the changes made to the data dictionary between the first and second logical times; using the first snapshot of the data dictionary and the identified changes to generate a second snapshot of the data dictionary corresponding to the first logical time; and using the snapshot of the data, the logs and the second snapshot of the data dictionary to replicate in a second database changes made to the logical structures in the data in the first database after the first logical time. - View Dependent Claims (2, 3, 41, 42)
-
-
4. A method of logical data rollback comprising:
-
generating a snapshot of a data dictionary corresponding to a database state; selecting a rollback time preceding the generated snapshot; selectively identifying, in a change log, change records corresponding to a period between the generated snapshot and selected rollback time and indicating changes to the data dictionary; and reverting the data dictionary to the selected rollback time by backing out changes in the identified records made to the database between the selected rollback time and the time of the snapshot. - View Dependent Claims (5, 6, 7, 8, 9, 10)
-
-
11. A method of restoring a database comprising:
-
identifying, in a redo log, a time corresponding to a desired target restore time; identifying a metadata snapshot corresponding to a time following the target restore time; determining, from the redo log, metadata changes made from the target restore time to the time of the metadata snapshot; and reverting the metadata to the target restore time by backing out changes made to the metadata between the target restore time and the time of the metadata snapshot. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)
-
-
27. A method of rolling back changes to a database from a redo log comprising:
-
identifying first log corresponding to data changes, each of the changes corresponding to a transaction; identifying a second log corresponding to data structure; enumerating a series of changes made in the first log; identifying a point of interest in the first log corresponding to a time after which changes are to be backed out of the first log; and computing a second point in the second log corresponding to the point of interest in the first log, the second point indicative of a snapshot of data structure referenced by the first log at the point of interest. - View Dependent Claims (28)
-
-
29. A database server for restoring a database comprising:
-
a memory operable to encode instructions; an interface connected to a primary database and a standby database; recovery processor responsive to the instructions, the instructions operable to; identify, in a redo log, a time corresponding to a desired target restore time; identify a metadata snapshot corresponding to a time following the target restore time; determine, from the redo log, metadata changes made from the target restore time to the time of the metadata snapshot by identifying an ordered set of changes made from the time of the metadata snapshot back to the target restore time via the redo log; and store the entries according to the order of occurrence revert the metadata to the target restore time by backing out changes made to the metadata between the target restore time and the time of the metadata snapshot. - View Dependent Claims (30, 31, 32, 33, 34, 35, 36, 37, 38)
-
-
39. A computer program product having a computer readable medium operable to store computer program logic embodied in computer program code encoded thereon, the computer program code receivable by a processor for executing computer program instructions for restoring a database comprising:
-
computer program code for identifying, in a redo log, a time corresponding to a desired target restore time; computer program code for identifying a metadata snapshot corresponding to a time following the target restore time; computer program code for determining, from the redo log, metadata changes made from the target restore time to the time of the metadata snapshot; computer program code for identifying an ordered set of changes made from the time of the metadata snapshot back to the target restore time via the redo log; computer program code for storing the entries in a redo stack according to the order of occurrence; and computer program code for reverting the metadata to the target restore time by backing out changes made to the metadata between the target restore time and the time of the metadata snapshot, reverting further including undoing, via a journaling mechanism, transactions occurring from the target restore time to the time of the metadata snapshot, the target time preceding the time of the metadata snapshot.
-
-
40. A computing device for database server for restoring a database comprising:
- means for identifying, in a redo log, a time corresponding to a desired target restore time;
means for identifying a metadata snapshot corresponding to a time following the target restore time; means for determining, from the redo log, metadata changes made from the target restore time to the time of the metadata snapshot; means for identifying, from the determined changes, an ordered set of changes made from the time of the metadata snapshot back to the target restore time via the redo log; means for storing the identified entries in a redo stack according to the order of occurrence; and means for reverting the metadata to the target restore time by backing out changes made to the metadata between the target restore time and the time of the metadata snapshot, the means for reverting further including; means for identifying, from the redo log, logged DB commands resulting in changes affecting the primary metadata representation on the standby server, each of the changes corresponding to a transaction; means for pushing transactions corresponding to the identified changes onto the redo stack; means for associating each of the changes with the corresponding transaction on the stack; and means for formulating a DB command operable to back out each of the transactions on the stack, backing out performed by formulating an inverse of the logged DB command for each change in each backed out transaction.
- means for identifying, in a redo log, a time corresponding to a desired target restore time;
Specification