written 7.9 years ago by | modified 2.8 years ago by |
Mumbai University > Information Technology > Sem 5 > Advanced Database Management System
Marks: 10M
Year: May 2015
written 7.9 years ago by | modified 2.8 years ago by |
Mumbai University > Information Technology > Sem 5 > Advanced Database Management System
Marks: 10M
Year: May 2015
written 7.9 years ago by |
The recovery procedure involves flushing, its logs stored in data buffers into disk
Two main approaches in recovery process
a) Log-based recovery using WAL protocol.
b) Shadow-paging
Write-Ahead Logging (WAL)
The before image of an item cannot be overwritten by its after image in the database on disk until all UNDO-type log records for the updating transaction –up to this point in time- have been force-written to disk.
Ensures atomicity.
Steal/no-steal-- Force/no-force Approaches
No-steal approach
1) A cache page updated by a transaction cannot be written to disk before the transaction commits.-deferred update follows this approach-
2) The pin-unpin bit indicates if a page cannot be written back to disk
Steal approach
1) An updated buffer can be written before the transaction commits.
Used when the buffer manager replaces an existing page in the cache, that has been updated by a transaction not yet committed, by another page requested by another transaction.
2) Advantage: avoid the need for a very large buffer space.
Force/No-Force approaches
1) Force approach if all pages updated by a transaction are immediately written to disk when the transaction commits
2) No-force approach otherwise.
Advantage: an updated page of a committed transaction may still be in the buffer when another transaction needs to update it.-save in I/O cost. Typical database systems follow a steal/no-force strategy.
Checkpoints
Shadow Paging
A directory with n entries where the ith entry points to the ith DB page on disk.
All references –reads or writes- to the DB pages on disk go through the directory.
The directory is kept in main memory if not too large.
When a transaction begins executing, the current directory is copied into a shadow directory and the shadow directory is saved on disk
The current directory entries point to the most recent or current DB pages on disk
To recover from a failure Free the modified database pages and discard the current directory. Reinstate the shadow directory to recover the state of the DB before transaction execution. Return to the state prior to the transaction that was executing when the crash occurred.
To commit a transaction Discard the previous shadow directory.