Database Reference
In-Depth Information
Commit
Abort
Types of Log File Records Recovery requires a few pieces of important infor-
mation about each transaction and the data items the transaction intends to update.
Therefore, a log file keeps different types of records to trace the operations of each
transaction. Each record type is identified in the log file. A log record contains a
transaction identifier and a record type indicator. Each record is also date and time-
stamped. Here is a list of the record types. The record types shown are for a trans-
action T performing operations on data item D.
(T, BEGIN)
Marks the start of T.
(T, D, value)
Indicates the read operation and contains the value of D read from database.
(T, D, old value, new value)
Indicates an update, insertion, or deletion operation. A record indicating an inser-
tion contains the new value (after image field). For update, the old and new values
(before and after image fields) are present in the log record. For deletion, the log
record has the old value (before image field).
(T, COMMIT)
Marks the commit point of T.
(T, ABORT)
Marks the abort operation for T.
Checkpoint
By now, you have realized that the recovery manager of the DBMS needs to read
through the log file, first to identify the transactions that were in progress at the time
of a failure and then to use the information from the log records for actually per-
forming the recovery process. The recovery manager has to search through the log
records. In a large database environment, there are thousands of transactions daily
and many of these perform update operations. So in the event of a recovery, the
recovery manager is compelled to go through thousands of log records to redo or
undo partial database updates and restore the database to a consistent state. Two
difficulties arise:
The recovery process will be too long because of the time taken for the recov-
ery manager to process thousands of log records.
On the basis of the recovery technique adopted, the recovery manager is likely
to unnecessarily redo many updates to the database that had already taken
place. This will further extend the recovery time.
What if the DBMS periodically marks points of synchronization between the
database and the log file? Checkpoint records may be written on the log file with
date- and timestamps. These points of time indicate that completion of all database
Search WWH ::




Custom Search