Top Banner
Database Backup and Recovery Basics Supervised By : Samir Hillis Done By :Shahed Abo Saleem
27

Database backup and recovery basics

Feb 13, 2017

Download

Engineering

Shahed Mohamed
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Database backup and recovery basics

Database Backup and Recovery Basics

Supervised By : Samir HillisDone By :Shahed Abo Saleem

Page 2: Database backup and recovery basics

What the different between redo log file and archived log file

Redo log : recordrecord of all changes made to the database; used for recovery.

Archived log : copycopy of the contents of previous online redo loges; used for recovery.

Page 3: Database backup and recovery basics

• Goal of the database administrator• What is Backup and Recovery• Types of backup • Categories of Failure• Configuring for Recoverability• Different between no archive log mode

and archive log mode

OutlineOutline

Page 4: Database backup and recovery basics

• Goal of the database administrator• What is Backup and Recovery• Type backup • Categories of Failure• Configuring for Recoverability• Different between no archive log mode and

archive log mode

Page 5: Database backup and recovery basics

Goal of the database administrator

Is to ensure that the database is open open and available and available when users need it.

How to achieve goal ?

Page 6: Database backup and recovery basics

How to achieve goal ?• To achieve that goal, the DBA

• Protect the database from failure wherever possible.

• Increase the mean time between failures (MTBF).

• Protect by redundancy.• Decrease the mean time to recover (MTTR).• Minimize the loss of data.

Page 7: Database backup and recovery basics

• Goal of the database administrator• What is Backup and Recovery• Types of backup • Categories of Failure• Configuring for Recoverability• Different between no archive log mode and

archive log mode

Page 8: Database backup and recovery basics

What is Backup and Recovery?

• BackupBackup is a copy of data from your database that can be used to reconstruct that data.

• Recovery Recovery is carried out through archive records or known as Archive System .

• In generalIn general, backup and recovery refers to the various strategies and procedures involved in protectingprotecting your database against data loss and reconstructingreconstructing the database after any kind of data loss.

Page 9: Database backup and recovery basics

• Goal of the database administrator• What is Backup and Recovery• Types of backup • Categories of Failure• Configuring for Recoverability• Different between no archive log mode and

archive log mode

Page 10: Database backup and recovery basics

Backup

• A backup is a copy of data from your database that can be used to reconstruct that data.

• BackupsBackups can be divideddivided into physical backupsphysical backups and logical backupslogical backups.

Page 11: Database backup and recovery basics

Physical Backups

• Physical backups Physical backups are backups of the physical files physical files used in storing and recovering database, such as data files, control files, and archived redo logs.

• EveryEvery physical backup is a copycopy of files storing database information to some other location, whether on disk or some offline storage

Page 12: Database backup and recovery basics

Logical Backups• Logical backupsLogical backups contain logical data (for example,

tables or stored procedures) exported from a database with an Oracle export utility Oracle export utility and stored in a binary file, for later re-importing into a database using the corresponding Oracle import utility.Oracle import utility.

Page 13: Database backup and recovery basics

Physical Backups and Logical Backups

• Physical backups Physical backups are the foundationfoundation of any backup and recovery strategy.

• Logical backups Logical backups are a useful supplement useful supplement to physical backups in many circumstances but are not sufficient protection against data loss without physical backups.

Page 14: Database backup and recovery basics

• Goal of the database administrator• What is Backup and Recovery• Types of backup • Categories of Failure• Configuring for Recoverability• Different between no archive log mode and

archive log mode

Page 15: Database backup and recovery basics

Categories of Failure• While there are several types of problem that can halt the

normal operation of an Oracle database or affect database I/O operations, only two only two typically require DBA intervention and media recovery: media failure, and user errors.media failure, and user errors.

• Other failures may require DBA intervention to restart the database (after an instance failure) or allocate more disk space (after statement failure due to, for instance, a full data file) but these situations will not generally cause data loss or require recovery from backup.

Page 16: Database backup and recovery basics

Categories of Failure

Page 17: Database backup and recovery basics

• The Oracle database provides Oracle Flashback technology.

• Oracle Flashback technology:- a group of features that support • Viewing past states of data.• Winding data back and forth in time.• Without requiring restoring the database from backup.

• With this technology, you help users analyze and recover from errors.

User error

Page 18: Database backup and recovery basics

• For users who have committed erroneous changes, use the following to analyze the errors:-

• Oracle Flashback Query (SELECT … AS OF…)• Oracle Flashback Versions Query (SELECT …

VERSIONS BETWEEN…)• Oracle Flashback Transaction Query• Possible solutions to recover from user error:• Oracle Flashback Transaction Backout • Oracle Flashback Table • Oracle Flashback Drop

User error

Page 19: Database backup and recovery basics

User errorTypical Causes Possible Solutions

User inadvertently deletes or modifies data.

Roll back transaction and dependent transactions or rewind table.

User drops a table. Recover table from recycle bin.

Oracle LogMiner

Page 20: Database backup and recovery basics

Media Failure

Typical Causes Possible Solutions

Failure of disk drive 1. Restore the affected file from backup.2. Inform the database about a new file

location (if necessary).3. Recover the file by applying redo

information (if necessary).Failure of disk controller

Deletion or corruption of database file

Page 21: Database backup and recovery basics

• Goal of the database administrator• What is Backup and Recovery• Type backup • Categories of Failure• Configuring for Recoverability• Different between no archive log mode and

archive log mode

Page 22: Database backup and recovery basics

Configuring for Recoverability

• To provide the best protection for your data, you must work some step including :- Archive Log Files

Page 23: Database backup and recovery basics

• Goal of the database administrator• What is Backup and Recovery• Type backup • Categories of Failure• Configuring for Recoverability• Different between no archive log mode and

archive log mode

Page 24: Database backup and recovery basics

Different between no archive log mode and archive log mode

NOARCHIVELOG mode• is basically the absence of

ARCHIVELOG mode and has the disadvantage of not being able to recover to any point in time.

• NOARCHIVELOG mode does have the advantage of not having to write transactions to an archive log and thus increases the performance of the database slightly.

ARCHIVELOG mode • a mode that you can put the

database in for creating a backup of all transactions that have occurred in the database so that you can recover to any point in time.

Page 25: Database backup and recovery basics

ARCHIVELOG MODE• Advantages :-

1. You can perform hot backups (backups when the database is online).2. The archive logs and the last full backup (offline or online) or an older backup can completely recover the database without losing any data because all changes made in the database are stored in the log file.

• Disadvantages1. It requires additional disk space to store archived log files. However, the agent offers the option to purge the logs after they have been backed up, giving you the opportunity to free disk space if you need it.

Page 26: Database backup and recovery basics

NO-ARCHIVELOG MODE• Advantages

1. It requires no additional disk space to store archived log files.

• Disadvantages1. If you must recover a database, you can only restore the last full offline

backup. As a result, any changes made to the database after the last full offline backup are lost.

2. Database downtime is significant because you cannot back up the database online. This limitation becomes a very serious consideration for large databases.

Page 27: Database backup and recovery basics

What is MTTR and MTBF

• Mean Time To Recover (MTTR) Mean Time To Recover (MTTR) is the average time that a device will take a device will take to recover from a without failure.

• Mean Time Between Failures (MTBF) Mean Time Between Failures (MTBF) is the average time that a component works component works without failure.