1/24
Looks like no tags are added yet.
What are possible failures in a database?
system crashes
loss of main memory
hardware failure
loss of database storage
natural disaster
destruction of database system
human errors
corruption/destruction of data,hardware/software
How is reliability achieved in a database?
minimising frequency of failures + side-effects
maximsing ability to recover
What are the 2 types of reliability?
primary - design, implementation
secondary - operating procedures
What are examples of primary reliability?
avoid single point of failure
hardware replication
backup power sources
secure, air conditioned machine rooms
carefully designed operating procedures
What are examples of secondary reliability?
rigorously implemented operating procedures
access controls
reliable backup and recovery mechanisms
What are 4 database system failure types?
transaction failure
system failure
communication failure
media failure
What is an example of a transaction failure and itโs desired effect?
Example: deadlock
Effect: handled by transaction rollback + restart
What is an example of a system failure and itโs desired effect?
Example: power failure
Effect: system should recover to consistent state on re-start
What is an example of a communication failure and itโs desired effect?
Example: network losses
Effect: must be handled in distributed systems
What is an example of a media failure and itโs desired effect?
Example: disk failure - loss of stable storage
Effect: recover from backup
What is database recovery?
process of restoring the DB to a correct state following a failure
What should a recovery mechanism do?
ensure DB completely executed/not at all (atomicity)
ensure committed updates permanently stored (durability)
guarantee database consistency
have minimal impact on normal processing
What are the 3 disk units a typical DBMS installation uses for performance reasons?
system & DBMS software
live data
transaction logs
(beneficial for recovery)
What facilities does a DBMS provide to aid recovery?
backup system
periodically backup copies of DB
logging facility
keep track of DB transactions
checkpoint facility
store DB updates on secondary storage
recovery manager
restore DB to consistent state in event of failures
What is a DBMS log file?
cotnains info about current states of transactions & database updates
transaction records e.g.
transaction ID
type of log record (transaction start/commit/abort records)
pages affected by insert/update/delete actions
data page ID, before image, after image
checkpoint records
where changes made to DB are on the disk
What is the transaction processing model?
pages needed to process transactions read from disk into memory buffers
buffer pages updated
records of updates are written to log
on commit, log records flushed to disk before releasing locks
What does a buffer manager do?
controls buffer pool
pages fetched from disk (as required)
pages removed (when no longer required)
LRU - least recently used
dirty (modified) pages flushed to disk at end of transaction/buffer is full
What are 3 types of lof-based recovery?
normal recovery - after normal shutdown
warm recovery - after system failure
cold recovery - after media failure
What happens in a normal log-based recovery?
start from last log record (checkpoint written at shutdown)
What happens in a warm log-based recovery?
revert to last checkpoint in log
apply committed transactions
remove effects of un-committed transactions
What happens in a cold log-based recovery?
restore from backup/dump
apply log records to reach latest consistent state
What happens at a checkpoint?
all dirty pages in memroy written to disk
accurate record of all current transactions in the log
record describing checkpoint written to log
includes list of current transactions
What are the 5 states at failure a transaction can be at?
A: committed before last checkpoint
B: started before checkpoint, committed before failure
C: started before checkpoint, in progress at failure
D : started after checkpoint, committed before failure
E: started after checkpoint, in progress at failure
What is an exmaple of a warm recovery algorithm?
undo/redo alogorithm
widely used
allows buffer manager to flush dirty pages before/during/after commit
optimal for normal processing
expensive in terms of recovery time
What are the steps of an undo/redo algorithm?
