Chapter 4 Database Recovery
Chapter 4 Database Recovery
Techniques
3 Transaction Log
For recovery from any type of failure data values prior to
modification (BFIM - BeFore Image) and the new value after
modification (AFIM – AFter Image) are required.
These values and other information is stored in a sequential file
called Transaction log.
Pin-Unpin: Instructs the operating system not to flush the data
item.
Modified: Indicates the AFIM of the data item.
undone.
Undo: Restore all BFIMs on to disk (Remove all AFIMs).
Redo: Restore all AFIMs on to disk.
Database recovery is achieved either by performing only Undos or
These give rise to four different ways for handling recovery:
Steal/No-Force (Undo/Redo)
Steal/Force (Undo/No-redo)
No-Steal/No-Force (Redo/No-undo)
No-Steal/Force (No-undo/No-redo)
transaction commits.
database disk.
After reboot from a failure the log is used to redo all the transactions
affected by this failure.
No undo is required because no AFIM is flushed to the disk before a
transaction commits.
during recovery.
No transaction is redone.
Recovery schemes of this category apply undo and also redo
for recovery.
In a single-user environment no concurrency control is
required but a log is maintained under WAL.
Note that at any time there will be one transaction in the
system and it will be either in the commit table or in the active
table.
The recovery manager performs:
Undo of a transaction if it is in the active table.
Redo of a transaction if it is in the commit table.
on the disk.
Thus, at any time a data item has AFIM and BFIM (Shadow copy of
Database
ARIES will retrace all actions of the database system prior to the
crash to reconstruct the database state when the crash occurred.
(a) data update
(b) transaction commit
(c) transaction abort
(d) undo
(e) transaction end
In the case of undo a compensating log record is written.