BACKUP & RECOVERY IN DBMS

BaivabiNayak 937 views 20 slides May 01, 2019
Slide 1
Slide 1 of 20
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20

About This Presentation

BACKUP & RECOVERY IN DBMS


Slide Content

Backup and recovery in database management system Presented By: BAIVABI NAYAK

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).

Types of backup 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.

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.

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.

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.

The need for database backup 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.

Log file The DBMS maintains a special file called log file to keep track of database transactions. 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.

- after-image of the data item which means the value after change. - log management information.

Check pointing Check pointing is the synchronization between the database and the transaction log file. 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.

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.

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

A DBMS should provide the following facilities to assist with recovery: - a backup mechanism - a logging factors - a checkpoint facility - a recovery manager

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.

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.

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.

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.

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.

ALTERNATIVES TO BACKUP & RECOVERY Standby databases Replication - snapshot - symmetric replication Disk mirroring

Thank you…
Tags