One of the most important functions of a database system is to ensure the consistency of the data at all times. This includes both the physical storage consistency and the logical consistency of the data in the database. First and foremost, the system must command suitable measures to prevent the loss and corruption of data. If errors should occur during database operation, swift recovery to a state of consistency must be possible.
All of the measures directed toward maintaining and restoring data consistency form part of an integrated recovery concept. These measures fall into two categories:
transaction recovery and media recovery.
Whereas the purpose of transaction recovery is to ensure the consistency of the data while the system is running, media recovery is designed to maintain the consistency of the data for the entire lifetime of the database, or to restore the database to a consistent state if the need should arise.
The following paragraphs briefly describe which type of recovery is used for different types of error.
Errors on external storage
An external storage medium (disk) can no longer be processed.
In the event of write and read errors, any open transactions are rolled back using transaction recovery. Restricted database operation takes place until the defective device and its data are replaced.
In the event of hardware errors, you must return to a backup status created using media recovery (and, if necessary, reconstruct an earlier status) before you resume database operation on these data resources.
System errors
The contents of main memory have been lost due to system failure, but external storage still remains intact.
Any open transactions are rolled back using transaction recovery. Normal database operation is then resumed.
Errors in the application program
Depending on the type of error affecting the data resources, either you must return to a backup status created using media recovery (and, if necessary, reconstruct an earlier status) or the open transaction involved is rolled back by means of transaction recovery.
The major features of the UDS/SQL recovery concept are:
prompt detection of errors
confinement of errors to the smallest possible subunits
fast, flexible handling of errors, and the capability to make repairs to the database while the system is running.