1. BACKUP AND RECOVERY IN
DATABASE MANAGEMENT SYSTEM
Presented By:
BAIVABI NAYAK
2. WHAT IS BACKUP?
• Backup is an additional copy of data that can be used for
restore and recovery purposes.
• The backup copy is used when the primary copy is lost or
corrupted.
• This backup copy can be created by:
1. simply copying data(there can be one or more
copies).
2. mirroring data (the copy is always updated with
whatever is written to the primary copy).
3. TYPES OF BACKUP
1. FULL BACKUP:
As the name implies, a full backup is when every
single file and folder in the system is backed up. A full
backup takes longer and requires more space than
other types of backups but the process of restoring lost
data from backup is much faster.
4. 2. INCREMENTAL BACKUP:
With incremental backup, only the initial backup is a full
one. Subsequent backups only stores changes that were made
since the previous backup. The process of restoring lost data
from backup is longer but the backup process is muck quicker.
5. 3. DIFFERENTIAL BACKUP:
It is similar to the incremental backup. With both, the
initial backup is full and subsequent backup only store changes
made to files since the last backup. This type of backup
requires more storage space than incremental backup does,
however, but it also allows for a faster restore time.
6. 4. MIRROR BACKUP:
A mirror backup, as the name implies, is when an exact
copy is made of the source data. The advantage of mirror
backup as opposed to full, incremental, or differential backups,
is that you’re not storing old, obsolete files. When obsolete
files are deleted, they disappear from the mirror the mirror
backup as well when the system back up. The downside to
mirror backup is that if files are accidentally deleted, they can
be lost from the backup is well if the deletion isn’t discovered
before the next scheduled backup.
7. THE NEED FOR DATABASE BACKUP
1. The backup can be performed in any of the several ways:
- Use SQL to create backup tables and copy
data into them.
- Use an implementation-defined mechanism
that backs up the whole database or
portions of it.
- Using DBMS installation.
8. LOG FILE
1. The DBMS maintains a special file called log file to keep
track of database transactions.
2. It may contain the following:
- transaction identifier
- type of log record
- identifier of data item affected by the database
action.
- before-image of the data item which means its
value before change.
9. - after-image of the data item which means the
value after change.
- log management information.
10. CHECK POINTING
1. Check pointing is the synchronization between the database
and the transaction log file.
2. Check points involves the following operations:
- writing all log records in main memory to
secondary storage.
- writing the modified blocks in the database
buffers to secondary storage.
- writing a check point record to log the file.
11. WHAT IS RECOVERY?
Database recovery can be very complex task.
Recovery involves much more than simply restoring an image
of the data as it appeared at some earlier point in time.
A database recovery involves bringing a data back to its state
at(or before) the time of the problem.
Simply stated, a successful recovery is one where you get the
application data to the state you want it- whether that state is
how it was last week , yesterday or just a moment ago.
12. THE NEED FOR RECOVERY
There are many types of failure that can affect database
processing.
Some causes of failures are as follows:
-system crashes
-media failures
- application software errors
- natural physical disasters
- carelessness
- sabotage
13. A DBMS should provide the following facilities to assist with
recovery:
- a backup mechanism
- a logging factors
- a checkpoint facility
- a recovery manager
14. RECOVERY TECHNIQUES
The recovery technique that must be selected is dependent on
the extent of the damage that has occurred to the database.
- if the database has been extensively
damaged , for example, a disk head crash
has occurred and destroyed the database.
- if the database has not been physically
damaged but has become inconsistent.
15. Using the deferred update
- in the deferred update protocol, the updates
are not written to the database until after a
a transaction has reached its commit point.
In this protocol, the log file is used as follows:
- write the transaction start record the log.
- write a log record containing the entire log
data specified previously.
- write a transaction commit log record.
- if the transaction aborts, ignore the log
records for the transaction and do not
perform the writes.
16. Using the immediate update
- in the immediate update protocol, the
immediate updates are applied to the
database as they occur without waiting to
reach the commit point.
In this protocol, the log file is used as follows:
- write the transaction start record to the log.
- write a record containing the necessary data
to the log file.
- write the updates to the database buffers.
- write a transaction commit record to the log.
17. FACTORS INFLUENCING THE
RECOVERY DURATION
The smaller the size of the component that need to be
recovered, the shorter the recovery process will be.
Recovering at the partition level can lessen recovery
duration. Sometimes a failure that would otherwise impact
an entire database object can be limited to impacting only a
single partition.
Keeping image copy backups and log archive files on
disk(instead of tape or CD or DVD) can speed up the
recovery process.
Test your image copy backups to make sure they are valid.
18. Automate your backup and recovery procedures to the
greatest extent possible.
Database with few independencies can minimize the
duration of a recovery because fewer related database
objects may need to be recovered at the same time.
Be sure that every DBA understands the recovery
procedures for each database object under his or her
control.
19. ALTERNATIVES TO BACKUP & RECOVERY
• Standby databases
• Replication
- snapshot
- symmetric replication
• Disk mirroring