DATABASE RECOVERY SYSTEM
database recovery concepts
types of database failure
types of database recovery
recovery techniques
Buffer Management
DATABASE SECURITY
Goals
Discretionary access control
Mandatory Access control
Firewalls
Data encryption
Database Recovery is the process of
restoring the database to a correct
(consistent) state in the event of a
failure.
Database backup and recovery functions
constitute a very important component
of DBMS.
Some provide automatic database
backups to secondary storage devices
such as disks, CDs, tapes and so on.,
Backups can be considered as follows
1) Full backup or dump of the
database
2) A differential backup of the
database
3) A backup of transaction log only.
Backup is stored in a secure place,
usually in a different building and
protected against danger such as fire,
theft, flood and other potential
Types of Database Failures:1) Hardware Failures:(memory errors, disk crashes, bad
disk
sectors, disk full errors).
2) Software Failures:(softwares such operating system,
DBMS software, application
programs)
3) System Crashes:(h/w or s/w errors, resulting the loss
of
main memory)
4) Network failures:(client/server configurations,
distributed system database,
communication failures)
5) Media Failures:(Head crashes, unreadable media,
loss of part in the secondary storage,
dangerous failures).
6) Application Software errors:(logical errors in the programming).
7) Natural physical Disasters:-
8) Carelessness:(unintentional destruction of data, or
facilities by operators or users).
9) Sabotage:(failures due to intentional corruption or
destruction of data ,h/w or s/w).
TYPES OF DATABASE RECOVERY:Any transaction must be aborted or
committed to maintain data integrity.
Any transaction begins with start
(BEGIN) and ends with successful
execution of SAVE (COMMIT)
TWO
TYPES
OF
TRANSACTION
RECOVERY
1) FORWARD RECOVERY
2) BACKWARD RECOVERY
FORWARD RECOVERY OR REDO OR
ROLL-FORWARD:used in the case of physical damage.
the
intermediated
results
transactions are
written in the database buffers.
of
the
database buffers occupy an area in the
main memory.
From this buffer, the data is transferred to
and from secondary storage of database.
Last
Database
Copy
Roll-forward
program
Transactio
n log
Recreated
Database
BACKWARD RECOVERY OR UNDO OR
ROLL BACKWARD:used in case an error occurs in the
middle of normal operation on the
database.
if the transaction was not committed at
the time of failure, it will cause
inconsistency in the database.
then the recovery manager must undo
any effects of the transaction database.
Current
database
Rollbackward
program
Transactio
n log
corrected
Database
RECOVERY TECHNIQUES:They depend on the type and extent of
damage that has occurred to the database.
They are based on the atomic
transaction property.
Two types of damages can take place to
the database.
1) Physical damage
2) Non-Physical or Transaction failure.
Techniques are used for recovery
1) Deferred Update
2) Immediate Update
Deferred Update:Updates are not written to the database
until after a transaction has reached its
COMMIT point.
or
Updates to the database are deferred (or
postponed) until the transaction completes
its execution successfully and reaches its
commit point.
Immediate Update:all updates to the database are applied
immediately as they occur without waiting
to reach the COMMIT point and a record of
all changes is kept in the transaction log.
Considering the following transaction:Time-1
READ (A,a1)
Time-2
a1=a1+20000
Time-3
WRITE (A,a1)
Time-4
READ (B,b1)
Time-5
b1:=b1-20000
Time-6
WRITE (B,b1)
DEFERRED UPDATE LOG ENTRIES FOR
THE TRANSACTION T IS A FOLLOWS:Before start of transaction
B=80000
Time-1 <T,BEGIN>
A=70000
Time-2 <T,A,20000>
Time-3 <T,B,20000>
Time-4 <T,COMMIT>
After transaction
A=90000, B=60000
IMMEDIATE UPDATE LOG ENTRIES FOR
THE TRANSACTION T IS A FOLLOWS:Before start of transaction A=70000
B=80000
Time-1 <T,BEGIN>
Time-2 <T,A,70000,20000>
Time-3
A=90000
Time-4 <T,B,80000,20000>
Time-5
B=60000
Time-6 <T,COMMIT>
After transaction
A=90000, B=60000
BUFFER MANAGEMENT:DBMS application programs require
input/output (I/O)operations, which are
performed by a component operating
system.
I/O operations normally use buffers to
match speed of the processor and the
relatively fast main with the slower
secondary storage devices.
This type of tasks is performed by the
Replacement stragegies used by the
buffer management
1) FIFO (First-In-First-out)
2) LRU (Least Recently Used)