Lecture
One of the main requirements for an advanced database management system is the reliability of database storage. This requirement implies, in particular, the possibility of restoring the consistent state of the database after any kind of hardware and software failures. Obviously, some additional information is needed to complete the restorations. In the vast majority of modern relational DBMS, such redundant additional information is maintained in the form of a database change log.
So, the overall goal of logging database changes is to ensure that the consistent state of the database can be restored after any failure. Since the basis of maintaining a complete database state is the transaction mechanism, logging and recovery are closely related to the concept of a transaction. The general principles of recovery are as follows:
This, in fact, means that the most recent consistent state of the database is being restored.
The following situations are possible in which you want to restore the state of the database:
In all three cases, the basis of recovery is redundant data storage. This redundant data is stored in a log containing a sequence of database change records.
There are two main options for maintaining journal information. In the first variant, for each transaction a separate local change log of the database is maintained by this transaction. These local logs are used for individual rollbacks of transactions and can be maintained in operational (or, more correctly, in virtual) memory. In addition, a general database change log is maintained, used to restore the state of the database after soft and hard failures.
This approach allows you to quickly perform individual transaction rollbacks, but leads to duplication of information in local and general journals. Therefore, the second option is more often used - maintaining only the general change log of the database, which is also used when performing individual rollbacks. Next, we consider this option.
Comments
To leave a comment
Databases IBM System R - relational DBMS
Terms: Databases IBM System R - relational DBMS