Database corruption in a data processing system can occur because of programming, user, or administrative staff errors, or other types of errors. This corruption could prevent an application program that depends upon the database from behaving properly or cause the application to return erroneous results, either of which could have serious financial or other consequences. Gravic, Inc. offers two products to restore a corrupted database to a correct state – HPE Shadowbase UNDO and HPE Shadowbase REDO.
The Shadowbase UNDO product utilizes a standard data replication engine in a modified configuration to remove the corruption while the application optionally continues its operation. The approach uses the Database Management System (DBMS) change-data to reverse the database to a state that is known to be correct. This operation can be performed while the application remains online and available for processing both update and read-only requests.
More specifically, when database corruption is known or suspected, Shadowbase UNDO reads the DBMS change-queue to access the events involved in the corruption. It reads from either the start point of corruption to the end point, or conversely, from the end point to the start point. The start and end points usually are supplied as date/time values or as change-queue location values, although in other situations a list of known corrupted transaction or event identifiers is used to access the events needing to be undone.
Although not required, database changes often are saved by the DBMS into an intermediate undo queue. This may be reviewed by the user to identify the events needing undone. If incorrect, the undo queue can be purged, the start/end points adjusted, and the undo queue rebuilt. This process could be repeated until the user is satisfied that the undo queue properly captures the corruption events.
The events in the undo queue are then read and processed by Shadowbase UNDO, and applied in reverse order to the original occurrence order in a manner that “backs out” or undoes their original changes.
More specifically, the events are reversed from their original order and are applied:
Aborted transactions are skipped, and dangling transactions (those without a commit or abort event) are optionally skipped or applied. The undo operation changes are typically reapplied against the source database to selectively “roll back” the changes that were originally made erroneously. If replication to a target environment is in use, then these changes could be replicated to a target database to fix the corresponding corruption in that database. If desired, correct database changes that were applied subsequently to the corruption could be preserved so that the application can continue to run while the UNDO operation is taking place.
Shadowbase UNDO is also useful for reversing valid database changes to reset a database to an earlier point-in-time state. For example, to reset a database prior to executing a series of regression test cases, or reset a database to its original state after a series of test cases are run.
It can be seen that Shadowbase UNDO is a powerful and flexible tool to be used to quickly restore a corrupted database, without interruption to normal processing, thereby mitigating the potential costs and issues arising from incorrect data or system downtime.
The architecture for Shadowbase UNDO is leveraged to provide another database restoration product, Shadowbase REDO. Whereas Shadowbase UNDO “rolls back” selected database changes, Shadowbase REDO “rolls forward” selected database changes onto an earlier (typically saved) copy of the database. It creates an up-to-date database that excludes certain operations that are deemed inappropriate or undesirable.
For both Shadowbase UNDO and Shadowbase REDO, helpful reports can be generated from the undo or redo queues to aid in determining the period of corruption and the contributing sources. The scope of corrective activity is specified by a user or system administrator and includes a time or transaction range, a list of affected files and tables, and a list of sources of corrupted transactions, such as users, programs, etc. Shadowbase UNDO and Shadowbase REDO filter database changes and undo or redo only those specified by the administrator, giving the user total control over which events should be kept, and which removed.