16
SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies in Oracle Database

SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

Embed Size (px)

Citation preview

Page 1: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

SRUTHI NAGULAVANCHACIS 764, FALL 2008

Department of Comput ing and Informat ion Sciences (CIS)

Kansas State Univers i ty

-1-

Back up & Recovery Strategies in Oracle

Database

Page 2: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

Outline

Introduction Types of Physical backup Cold backup Recovery techniques Hot backup RMAN ( Recovery Manager) RMAN advantages References

-2-

Page 3: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

Physical Backup

There are basically three types of Physical backup techniques used in oracle:

1) Cold Backup (offline)2) Hot Backup and (online)3) RMAN Backup

-3-

Page 4: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

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 files2) Redo log files 3) Data files

-4-

Page 5: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

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 name2) Names of database data files and archived redo log

files3) Checkpoint , a record indicating the point in the redo

log where all database changes prior to this point have been saved

-5-

Page 6: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

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-

Page 7: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

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-

Page 8: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

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-

Page 9: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

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-

Page 10: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

Implementation of Hot Backup

Hot Backup is used to Backup database even while databaseis up and running.The recovery techniques are similar to cold backup.

Steps to implement Hot backup :1) The database must be in Archive log mode2) Sql > ALTER TABLESPACE user_data BEGIN BACKUP;3) At Operating system level, we have to take backup of all

files belonging to this tablespace4) ALTER TABLESPACE user_data END BACKUP;

-10-

Page 11: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

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 up2)The RMAN client, which interprets backup and recovery

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

Page 12: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

RMAN Architecture

-12-

TargetDatabase

RMAN Client

TargetDatabase

TargetDatabase

AuxiliaryDatabase

RMANCatalogSchema

Catalog Database

Page 13: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

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-

Page 14: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

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-

Page 15: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

References

http://www.oracle.com/technology/deploy/availability/htdocs/BR_Overview.htm

http://www.orafaq.com/wiki/Oracle_database_Backup_and_Recovery_FAQ

Oracle Database 10g: The Complete Reference (Osborne ORACLE Press Series)

-15-

Page 16: SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies

THANK YOU

Questions?