Backup & recovery with rman

17
Oracle Database Backup & Recovery with RMAN Internet & Network Security Abid Hussain Syed Muhammad Mohsin

Transcript of Backup & recovery with rman

Oracle DatabaseBackup & Recovery with RMAN

Internet & Network Security

Abid Hussain

Syed Muhammad Mohsin

Agenda

Types of failures and backups in Oracle

RMAN Architecture Manual vs. RMAN backups RMAN backup strategies Exemplary recovery scanarios

Types of failures

Instance Failure Usually connected with an Oracle process failure

Media Failure Disk failure, storage array controller failure etc.

Block Corruption Usually caused by bugs in Oracle software

Human error In most cases accidentally deleted/updated data

Database user or DBA

Disaster Fire, flood, earthquake, plane crash etc.

Backup options in Oracle

Physical backups Cold (off-line) backups

Full database only

Require downtime

Do not provide flexibility for point in time recovery (PiTR)

Hot (on-line) backups Different types of backups: full, incr. (cumulative, differential),

archivelogs

Different scopes: full database, tablespace(s) or datafile(s)

Do not require database downtime

Can be used to recover full database, single/multiple tablespace(s)/datafile(s) or a corrupted block

Database can be recovered to any point in time within assumed backup retention period

Backup options in Oracle (2)

Logical backups Logical copy of data in the database Support for different backup granularity Can be taken either with legacy Export/Import tools or

with Data Pump (10g)

Standby systems (Data Guard) Physical and logical standby databases

How hot backups are possible?

SGAServer p

roc.

DBWR LGWR

RedoLog

RedoLog

Db file

Db file

Db fileDb file

Lo

g a

rchiver

Archived redo logs

Backu

p p

roc.

Tapes

or

disks

system

RMAN architecture

TargetDatabase

RMAN Client

TargetDatabase

TargetDatabase

AuxiliaryDatabase

RMANCatalogSchema

Catalog Database

Types of RMAN hot backups Copy or backupset Full database backup Incremental backups (in 10g 2 levels available: 0 and 1)

Cumulative, differential Can be used to update a copy of the database

Archivelog backups Tablespace(s), datafile(s) backups

Differential incremental Cumulative incremental

Manual vs. RMAN backups

RMAN advantages: Supports incremental backup strategies

RMAN on-line backups are not so heavy for the system as manual on-line backups

RMAN can detect corrupted blocks

RMAN automatically track database structure changes

Provides easy, automated backup, restore and recovery operations

Keeps invenotory of taken backups

Can seamlessly work with third party media managers

Disadvantage: something new to learn RMAN concepts and command syntax sometimes are not intuitive

RMAN backup strategies RMAN allows many types of backups It possible to build own backup strategy that

suits given database best There are also Oracle recommended backup

strategies: Incremental backup strategy: level 0 backups + level

1 backups (cumulative and/or differential) and archivelog backups inbetween.

Incrementally updated database copy: 1 backup as copy of the whole database + incremental backups used to update the copy + archived redo logs.

• Automatic failover– Database down– Designated health-check

conditions– Or at request of an

application

• Failed primary automatically reinstated as standby database

• All other standby’s automatically synchronize with the new primary

PrimaryDatabase

Observer

PrimaryDatabasePrimary

DatabaseStandby

Database

Data Guard Fast-Start Failover

Role specific database services start automatically

2

StandbyDatabase

Database Tier- OracleReal Application Clusters

Application Tier - Oracle Application Server Clusters

Database Services

PrimaryDatabase

Primary Database

Standbybecomes primary database

Data GuardAutomaticFailover

1

FAN breaks clients out of TCP timeout.TAF/FCF automatically

reconnects applications to new primary

3

Standby Database

Data Guard Automatic Failover

Real-time Queries

ProductionDatabase

Continuous redo shipping, validation & apply

Real-time Reporting

Fast Incremental

Backups

•Offload read-only queries to an up-to-date physical standby

Real-time Reporting

Active Standby Database

Read-writeWorkload

Active Data Guard

•Use fast incremental backups on a physical standby – up to 20x faster

Simple to Manage

Primary Site Remote SiteDisaster Recovery

StandbyDatabase

Remote Standby

Database

ASYNC

Data Guard

PrimaryDatabase

SYNC

Ultimate High Availability

Primary Site Remote SiteDisaster Recovery

ASYNCData Guard

PrimaryDatabase

Remote Standby

Database

Ultimate High Availability