Chapter 23 Data Recovery Flashcards
Purpose of Database Recovery
To bring the database into the last consistent state which existed prior to the failure. To preserve transaction properties.
Types of failure
transaction failure
system failure
media failure
transaction failure
transactions may fail because of incorrect input, deadlock, incorrect synch.
System failure
System may fail because of addressing error, application error,, operating system fault, RAM failure
Media failure
Disk head Crash , power disruption
Transaction log
for recovery from any failure requires value prior to modification (BeFore IMage) and after modification(AFter IMage). these values are stored in a seq file called the transaction log.
data update
Immediate update
Deffered update
Shadow update
in-place update
Immediate Update
As soon as a data item is modified in cache, the disk copy is updated
Defered update
All modified data items in the cache is written either after a transaction ends its execution or after a fixed number of transactions have completed their execution
Shadow update
the mod. version of a data item doesnt overwrite its disk copy but is written at a separate disk location
Data caching
data items are stored into the database by the cache manage then written into the disk after modification. flushing is controlled by modified and pin-unpin bits.
Pin-unpin bits
instructs the OS not to flush the data item.
Modified bits
Indicates the AFIM of the data item.
trans. rollback(UNDO)
restore all BFIMS on to disk (Removes the AFIMS)
trans rollback(REDO)
Restore all AFIMS on to the disk
in-place update
The disk version of the data item is overwritten by the cache version
Checkpointing
Time to time (randomly or under some criteria) the database flushes its buffer to database disk to minimize the task of recovery.
steps defines a checkpoint operation
- Suspend execution of transactions temporarily.
- Force write modified buffer data to disk.
- Write a [checkpoint] record to the log, save the log to disk.
- Resume normal transaction execution.
Possible ways for flushing database cache to database disk:
Steal/No-Steal and Force/No-Force
Steal:
Cache can be flushed before transaction commits