Database recovery is the process of restoring a database to its most recent consistent state before a failure occurred. The purpose is to preserve the ACID properties of transactions and bring the database back to the last consistent state prior to the failure. Database failures can occur due to transaction failures, system failures, or media failures. A good recovery plan is important for making a quick recovery from failures.
2. Database Recovery
Database recovery is the process of restoring
the database to the most recent consistent
state that existed just before the failure.
Data recovery is important in managing a
database system.
Having a good plan will help make a quick and
successful recovery from a failure.
3. Purpose Of Database
Recovery
Purpose:
To bring the database into the last consistent state,
which existed prior to the failure.
To preserve transaction (ACID) properties:
Atomicity
Consistency
Isolation
Durability
4. Database Failure
A failure is a state where data inconsistency is visible
to transactions if they are scheduled for execution. In
databases usually three types of failure are
encountered:
Transaction failure
System failure
Media failure
5. What Causes Database
Failure?
Database server computer or program crashes
Database client computer or program crashes
Network failure between client and server
Data on a disk drive is corrupted
A transaction executes an illegal operation
Two or more transactions deadlock
Transactions introduce errors into the Database
6. Recovery Strategies
Types of Transaction updates
Deferred update
List of all changes in the order they were committed
‘recovery and roll forward’
Shadow update
List of all changes in reverse order
‘roll back’
Often more efficient than recovery and roll forward
7. Recovery Strategies
Immediate Update
As soon as the data is updated , the disk copy is also
updated.
In place Update
The disk version of data is overwritten by the cache version.
8. Deadlock
A deadlock is a situation in which two or more competing
actions are each waiting for the other to finish, and thus
neither ever does. A deadlock situation can arise if all of the
following conditions hold simultaneously in a system:
Mutual Exclusion:
Hold and Wait
No Preemption
Circular Wait:
9. Deadlock handling &
Recovery
Most current operating systems cannot prevent a
deadlock from occurring When a deadlock occurs,
different operating systems respond to them in
different non-standard manners. Major approaches are
as follows.
Ignoring deadlock
Detection and Recovery
Prevention and Avoidance