Backup and Recovery Sruthi Nagulavancha CIS 764 Nov
Download
Report
Transcript Backup and Recovery Sruthi Nagulavancha CIS 764 Nov
Back up & Recovery Strategies
in Oracle Database
SRUTHI NAGULAVANCHA
CIS 764, FALL 2008
Department of Computing and Information
Sciences (CIS)
Kansas State University
-1-
Outline
Introduction
Types of Physical backup
Cold backup
Recovery techniques
Hot backup
RMAN ( Recovery Manager)
RMAN advantages
References
-2-
Physical Backup
There are basically three types of Physical backup techniques
used in oracle:
Cold Backup (offline)
2) Hot Backup and (online)
3) RMAN Backup
1)
-3-
Cold Backup
The Basic difference between hot backup and cold backup
is that database is shutdown while taking the cold backup.
While taking this type of backup usually the following 3
files are backed up to tape drive :
1) Control files
2) Redo log files
3) Data files
-4-
Control File
Every oracle database has a control file containing the
operating system filenames of all other files that constitute
the database.
This is an important file which contains consistency
information that is used during recovery such as
1) Database name
2) Names of database data files and archived redo log files
3) Checkpoint , a record indicating the point in the redo log
where all database changes prior to this point have been
saved
-5-
Data files
Every Oracle database has one or more Physical data files
which are divided into smaller units called data blocks.
The data of logical database structures, such as tables and
indexes, is physically located in the blocks of the data files
allocated for a database.
-6-
Redo Log files
Redo log files are very crucial for recovery .These record all
changes made in data files.
Before Oracle changes data in a data file it writes these
changes to the redo log.
-7-
Recovery
There are two methods in recovery :
1) Simple Restore
2) Restore and Recovery
Example : suppose let there be a scenario where on a Tuesday
morning at 11:00 am, the database crashed and we need to
get this data back.
Simple Restore : If the database is running in No Archive
log mode then in this case all we can do is to perform a
“Simple Restore” from our mondays night tape backup.
-8-
Recovery
But the simple restore scenario is not an industry option since
we are loosing lot of data, which happened during Tuesday
morning(8 am to 11 am)
Restore and Recover : But if the database is in Archive log
mode then we can first restore from mondays night backup
and then recover the database by applying Tuesdays
Archiving files on top of it. Thus there is no loss of data.
-9-
Implementation of Hot Backup
Hot Backup is used to Backup database even while database
is up and running.
The recovery techniques are similar to cold backup.
Steps to implement Hot backup :
1) The database must be in Archive log mode
2) Sql > ALTER TABLESPACE user_data BEGIN BACKUP;
3) At Operating system level, we have to take backup of all
files belonging to this tablespace
4) ALTER TABLESPACE user_data END BACKUP;
-10-
RMAN (Recovery Manager)
RMAN is a tool which manages the process of creating backups
and also manages the process of restoring and recovering
RMAN was introduced in Oracle 8 and it has become simpler
with newer versions and easier than user managed backups
RMAN utilities :
1) The target database to be backed up
2) The RMAN client, which interprets backup and recovery
commands
3) A recovery catalog database is a separate database schema used
to record RMAN activity against one or more target databases.
4) Media Management software, required for RMAN to interface
with backup devices such as tape drives.
-11-
RMAN Architecture
Target
Database
RMAN Client
Target
Database
Target
Database
Auxiliary
Database
RMAN
Catalog
Schema
Catalog
Database
-12-
Steps for RMAN Backup
Install and configure Media Management software
Link MML to Oracle
Create catalog
Register target database in the catalog
Backup the database
-13-
Why use RMAN ?
No extra costs….. Its available free
Proper Security
Faster backups and restores compared to backups without
RMAN
It contains detail of the backups taken etc in its central
repository facility for testing validity of backups. There are
also commands like crosscheck to check the status of
backup
-14-
References
http://www.oracle.com/technology/deploy/availability/ht
docs/BR_Overview.htm
http://www.orafaq.com/wiki/Oracle_database_Backup_a
nd_Recovery_FAQ
Oracle Database 10g: The Complete Reference (Osborne
ORACLE Press Series)
-15-
THANK YOU
Questions?