Backup - 331 IT
Download
Report
Transcript Backup - 331 IT
Backup and Recovery (1)
Oracle 10g
CAP364
Hebah ElGibreen
1
Outline
Introduction
Backup and Recovery, Why?
Principle of Backup and Recovery
Backup
Backup Solutions: Overview
Backup Methods
Backup Strategies (Choosing the right backup)
Configuring for Recoverability
Enterprise Manager:
Configuring Backup
Schedule Backup
Managing Backup
Viewing Backup Job
Practice
Recovery (Next Lecture…)
CAP364
Hebah ElGibreen
2
Introduction
Backup and recovery refers to the various strategies and
procedures involved in protecting your database against
data loss and reconstructing the database after any kind of
data loss.
CAP364
Hebah ElGibreen
3
Backup and Recovery, Why?
The database administrators goal is to ensure that the
database is open and available when users need it.
Failures can generally be divided into the following
categories:
CAP364
Statement failure
User process failure
Network failure
User error
Instance failure
Media failure
Hebah ElGibreen
4
Principle of Backup and Recovery
Reconstructing the contents of all or part of a database
typically involves two phases:
Retrieving a copy of the data file from a backup.
Reapplying changes to the file, to bring the database to a
desired SCN since the last backup.
CAP364
Hebah ElGibreen
5
Principle of Backup and Recovery
CAP364
Hebah ElGibreen
6
Backup Solutions: Overview
Backups can be performed by using:
CAP364
Recovery Manager
Oracle Secure Backup
A user-managed scenario
Hebah ElGibreen
7
Backup Methods
Logical Backup (User level)
Export Backup
Import Backup
Physical Backup (DBA centric)
CAP364
Offline Backup (cold backup)
Online Backup (hot backup)
Hebah ElGibreen
8
Backup Strategies …
Choosing the right backup
Tape vs. Disk Backups
Physical vs. Logical Backups
Whole vs. Partial Backups
Consistent vs. Inconsistent Backups
Full vs. Incremental Backups
Hot vs. Cold Backups
Image Copies vs. Backupsets
CAP364
Hebah ElGibreen
9
Backup Strategies …
Choosing the right backup
Tape vs. Disk Backups
A common practice is to make backup copies on disk when possible and
have them copied to tape in a separate operation.
Physical vs. Logical Backups
A logical backup can be much smaller than physical backup.
Logical backups cannot be used to restore the database; they can only be
used to re-create the data.
CAP364
If the database is restored from physical backups, then the redo logs can be used
to recover all modifications to the data made since the physical backup was
initiated.
If a logical backup is used to re-create data, any modifications to the data made
after the logical backup was initiated are lost (i.e. “point in time” backup).
Hebah ElGibreen
10
Backup Strategies …
Choosing the right backup
Whole vs. Partial Backups
If the database is very large, we may not have the time and resources
to create a backup of the entire database in a single operation.
Instead, we might spread the activity over the course of a week and
create a backup of just a portion of the database every night.
Consistent vs. Inconsistent Backups
Consistent backups are taken when the database is shut down
normally or in a MOUNT state.
A database must be in ARCHIVELOG mode to use an inconsistent
backup method.
CAP364
Hebah ElGibreen
11
Backup Strategies …
Choosing the right backup
Full vs. Incremental Backups
CAP364
A distinct advantage to using an incremental backup in a
recovery strategy is that archived and online redo log files may
not be necessary to restore a database or tablespace to a
consistent state.
Hebah ElGibreen
12
Backup Strategies …
Choosing the right backup
Hot vs. Cold Backups
Cold backups are similar to export backups because they are pointin-time backups and therefore of less value if up-to-the minute
recovery of the database is required and the database is not in
archivelog mode.
Another downside to cold backups is the amount of downtime
necessary to perform the backup; any one will not be able to access
the database during it.
Hot backups are inconsistent because, with the database open, there
is no guarantee that the data files are synchronized with the control
files. Inconsistent backups require recovery in order to be used.
CAP364
Hebah ElGibreen
13
Backup Strategies …
Choosing the right backup
Image Copies vs. Backupsets
CAP364
Backup sets use less space on the disk or
tape and it can be compressed to further
reduce the space requirements of the
backup.
Backupsets can be created and restored only
with RMAN.
Image copies are full backups created by
almost any backup environment (e.g.
RMAN or operating system commands).
Hebah ElGibreen
Backup set
Data file #1
Data file #2
Data file #3
Data file #4
Data file #5
Data file #6
Image copies
Data file #1
Data file #4
Data file #2
Data file #5
Data file #3
Data file #6
14
Configuring for Recoverability
To configure your database for maximum recoverability,
you must:
Schedule regular backups
Multiplex control files
Multiplex redo log groups
Retain archived copies of redo logs
Disk 1 Member 1
Member 2
Member 1
Disk 2 Member 2
Member 1
Member 2
Control files
Online redo log files
Group 1
CAP364
Group 2
Archive log files
Group 3
Hebah ElGibreen
15
References
“Beginning Oracle Database 11g Administration: From
Novice to Professional”, By Iggy Fernandez, Apress.
Backup and Recovery Basics 10g Release 2, By Antonio
Romero, Lance Ashdown, Oracle® Database, 2005.
Oracle Database 10g: Administration Workshop I, student
guide.
CAP364
Hebah ElGibreen
16