Sie sind auf Seite 1von 40

Using Recovery Manager

Copyright 2008, Oracle. All rights reserved.

Objectives

!ommands BACKUP "loc !#$# %nc# Update LIST REPORT DELETE

After completing this lesson, you should be able to do the following: Use the RMAN BACKUP command to create bac up sets and image copies Manage the bac ups and image copies ta en with RMAN

3-2

Copyright 2008, Oracle. All rights reserved.

%ssuing Recovery Manager !ommands


%nteractive client
&nter commands at RMAN prompt# Use when performing analysis, or when running reports or stored scripts#

"atch mode
Use with automated jobs# 'pecify a command file when starting RMAN# 'pecify the log file name to capture session log#

(ipe interface
'pecify the PIPE command)line argument# Use to communicate data between sessions or between RMAN and an e*ternal application#

3-3

Copyright 2008, Oracle. All rights reserved.

%ssuing Recovery Manager !ommands +notes only slide,

3-4

Copyright 2008, Oracle. All rights reserved.

$ypes of RMAN !ommands


RMAN commands are of the following types: 'tand)alone command:
%s e*ecuted individually at the RMAN prompt !annot appear as subcommands within RUN

-ob command:
Must be within the braces of a RUN command %s e*ecuted as a group

'ome commands can be e*ecuted as either a stand)alone or a job command#

3-5

Copyright 2008, Oracle. All rights reserved.

-ob !ommands: &*ample


-ob commands appear inside a RUN command bloc :
RMAN> 2> 3> %> (> ,> RUN { BACKUP AS BACKUPSET FORMAT '/u01/db01/bac u!/"d#"$#"!' DURATION 10&00 MINIMI'E LOAD )DATABASE*+ S-L 'a./01 $2$/03 a1c4560 .78 cu1109/'+

:> ;

3-

Copyright 2008, Oracle. All rights reserved.

RMAN !ommands: Overview


RESTORE RECO<ER FLAS=BACK BACKUP RMAN &nterprise Manager

'(.%/& $arget database !ontrol file

'tored scripts

REPORT LIST

Archived log files

!atalog maintenance CROSSC=ECK DELETE>E?PIRED C=AN@E

!atalog database

3-!

Copyright 2008, Oracle. All rights reserved.

"#A$ Co%%a&d Overvie' (&otes o&ly slide)

3-8

Copyright 2008, Oracle. All rights reserved.

BACKUP !ommand

!ommands 4 BACKUP "loc !#$# %nc# Update LIST REPORT DELETE

RMAN> BACKUP AS BACKUPSET 2> FORMAT '/BACKUP/dA#"d#"$#"!Bbu$' 3> TABLESPACE 41#da/a+


0ata file 1 0ata file 2 0ata file 3 0ata file 1 0ata file 2 0ata file 3

$ablespace =R#DATA

"ac up set

3-*

Copyright 2008, Oracle. All rights reserved.

"ac up !onstraints
$he database must be mounted or open# 5ou cannot bac up online redo logs# Only 6clean7 bac ups are usable in NOARC=I<ELO@ mode# Only 6current7 data file bac ups are usable in ARC=I<ELO@ mode#

3 - +0

Copyright 2008, Oracle. All rights reserved.

(aralleli8ation of "ac up 'ets


.or performance, allocate multiple channels and assign files to specific channels#
0ata file 1 0ata file 9 0ata file :

!hannel MM/ "ac up piece 1

0ata file 2

0ata file 3

0ata file ;

!hannel MM/ "ac up piece 2

0ata file <

0ata file =

0ata file >

!hannel MM/ "ac up (iece 3

3 - ++

Copyright 2008, Oracle. All rights reserved.

$otes O&ly ,lide

3 - +2

Copyright 2008, Oracle. All rights reserved.

!ompressed "ac ups

RMAN> BACKUP AS 2> COMPRESSED BACKUPSET 3> DATABASE+


0atabase files

!ompressed bac up files

RMAN> 2> 3> %>

CONFI@URE DE<ICE TCPE DISK PARALLELISM 2 BACKUP TCPE TO COMPRESSED BACKUPSET+

3 - +3

Copyright 2008, Oracle. All rights reserved.

%mage !opy
RMAN> 2> 3> RMAN> %> (> BACKUP AS COPC DATAFILE '/ORADATA/u$01$#01#db01BdbA' FORMAT '/BACKUP/u$01$01BdbA'+ BACKUP AS COPC ARC=I<ELO@ LIKE 'a1c4#10,0Ba1c' FORMAT 'a1c4#10,0Bba '+
!opy of data file 3
0ata file 3 0ata file 3

!opy of archived log


Archived log file Archived log file
Copyright 2008, Oracle. All rights reserved.

3 - +4

$otes O&ly ,lide

3 - +5

Copyright 2008, Oracle. All rights reserved.

$ags for "ac ups and %mage !opies


A tag is a logical name assigned to a bac up set or image copy#
379/4#Au..#bac u!
0ata files 1,3 0ata files 2,9

D00 #Au..#bac u!
0ata file 3 0ata file 9

"ac up set

"ac up set

3-+

Copyright 2008, Oracle. All rights reserved.

BACKUP !ommand Options



3 - +!

!hec for physical bloc corruptions# 'can for logical corruptions and physical corruptions# 'et a threshold on the number of detected corruptions allowed before aborting# ?alidate the target input files before performing a bac up operation# 0uple* the bac up set# Overwrite an e*isting bac up set or image copy# (ass control of the data transfer between storage devices and the data files on dis to the media management layer# &ncrypt the bac up files#
Copyright 2008, Oracle. All rights reserved.

$otes O&ly ,lide

3 - +8

Copyright 2008, Oracle. All rights reserved.

"ac ing Up Archived Redo /ogs


Online redo log file switch is automatic# Archived log failover is performed# 5ou can specify a range of archived redo logs to bac up# "ac up sets of archived redo log files cannot contain any other type of file#

RMAN> BACKUP 2> FORMAT '/d5$ 1/bac u!/a1#"/#"$#"!' 3> ARC=I<ELO@ FROM SE-UENCEE23% %> DELETE INPUT+

3 - +*

Copyright 2008, Oracle. All rights reserved.

-ac.i&g /p Archived "edo 0ogs (&otes o&ly slide)

3 - 20

Copyright 2008, Oracle. All rights reserved.

@hole 0atabase "ac up

RMAN> BACKUP DATABASE PLUS ARC=I<ELO@+

Archived log file copies

0ata file copies

!ontrol file

'(.%/&

3 - 2+

Copyright 2008, Oracle. All rights reserved.

RMAN "ac up $ypes


A full backup contains all used data file bloc s# A level 0 incremental backup is eAuivalent to a full bac up that has been mar ed as level B# A cumulative level 1 incremental backup contains only bloc s modified since the last level B incremental bac up# A differential level 1 incremental backup contains only bloc s modified since the last incremental bac up#
.ull, or Clevel B incremental bac upC

!umulative incremental bac up

0ifferential incremental bac up

3 - 22

Copyright 2008, Oracle. All rights reserved.

$otes O&ly ,lide

3 - 23

Copyright 2008, Oracle. All rights reserved.

0ifferential ?ersus !umulative


A differential incremental bac up contains all bloc s changed since the last incremental bac up# A cumulative incremental bac up contains all bloc s changed since the last level B incremental bac up#
/evel B /evel B

/vl B 0ay 'un


3 - 24

1c

1c

Mon

$ue

@ed

$hu

.ri

'at 'un

Copyright 2008, Oracle. All rights reserved.

"loc !hange $rac ing

!ommands BACKUP 4 "loc !#$# %nc# Update LIST REPORT DELETE

$he bac up process can be streamlined by enabling bloc change trac ing, which: Records changed bloc s in a change trac ing file %s used automatically by RMAN, if enabled Optimi8es incremental bac ups by avoiding full data file scans during bac up
/ist of changed bloc s Redo generation 1B11BB1B1B11B BBB111B1BB1B1 1B1B1B111BB11 !hange trac ing file Redo log

!$@R

'DA

3 - 25

Copyright 2008, Oracle. All rights reserved.

&nabling "loc !hange $rac ing


S-L> ALTER DATABASE ENABLE 2> BLOCK C=AN@E TRACKIN@ 3> USIN@ FILE '/32d51/13a9#c4a980#/1ac BA' %> REUSE+

3-2

Copyright 2008, Oracle. All rights reserved.

%ncrementally Updating "ac ups

!ommands BACKUP "loc !#$# 4 %nc# Update LIST REPORT DELETE

%mage copy of data file

%ncremental bac up files

RMAN> RECO<ER COPC OF 2> DATAFILE {9F'A5.0#9a30'; 3> GIT= TA@ '59c1#u!d#dA1'+ %mage copy of data file updated to a more recent state Recovered data file
3 - 2! Copyright 2008, Oracle. All rights reserved.

LIST !ommand
/ist bac up sets and copies of data files:

!ommands BACKUP "loc !#$# %nc# Update 4 LIST REPORT DELETE

RMAN> LIST BACKUP OF DATABASE+ RMAN> LIST BACKUP OF DATAFILE 2> H/db01/ORADATA/u03/u$01$01BdbAH+

/ist bac up sets and copies of any data file for a specified tablespace: /ist bac up sets and copies containing archive logs for a specified range:

RMAN> LIST COPC OF TABLESPACE HSCSTEMH+

RMAN> LIST COPC OF DATABASE ARC=I<ELO@ 2> FROM TIMEE'SCSDATEI:'+


3 - 28 Copyright 2008, Oracle. All rights reserved.

REPORT !ommand
(roduces a detailed analysis of the repository (roduces reports to answer:
@hat are the data files in the databaseE @hich files need a bac upE @hich bac ups can be deletedE @hich files are unrecoverableE

!ommands BACKUP "loc !#$# %nc# Update LIST 4 REPORT DELETE

3 - 2*

Copyright 2008, Oracle. All rights reserved.

REPORT NEED BACKUP !ommand


/ists all data files that reAuire a bac up Assumes that the most recent bac up is used during a restore (rovides four options:
%ncremental 0ays Redundancy Recovery window

Uses the current retention policy configuration if no options are specified

3 - 30

Copyright 2008, Oracle. All rights reserved.

REPORT NEED BACKUP: &*amples


.iles that need more than three incremental bac ups for recovery:
RMAN> REPORT NEED BACKUP 59c10309/a. 3+

.iles that have not been bac ed up for three days:


RMAN> REPORT NEED BACKUP da2$ 3+

"ac up needed if there are not two or more bac ups already:
RMAN> REPORT NEED BACKUP 10du9da9c2 2+

"ac up needed to recover to three days ago:

RMAN> REPORT NEED BACKUP 2> 10c76012 D59d7D 7A 3 da2$+


3 - 3+ Copyright 2008, Oracle. All rights reserved.

REPORT OBSOLETE and DELETE OBSOLETE

!ommands BACKUP "loc !#$# %nc# Update LIST REPORT 4 DELETE

.ind all recovery files that are deemed obsolete according to the current retention policy settings:
RMAN> REPORT OBSOLETE+

/ist the obsolete recovery files, if no more than two bac up copies are needed: 0elete the bac up set with a bac up set ey of 9: 0elete the recovery files considered obsolete, because they have more than two bac ups:

RMAN> REPORT OBSOLETE REDUNDANCC 2+

RMAN> DELETE BACKUPSET %+

RMAN> DELETE OBSOLETE REDUNDANCC 2+


3 - 32 Copyright 2008, Oracle. All rights reserved.

Managing "ac ups with &M

Navigation aid: 0atabase home page 4 Maintenance 4 Manage !urrent "ac ups
3 - 33 Copyright 2008, Oracle. All rights reserved.

RMAN 0ynamic ?iews


<JARC=I<ED#LO@ <JBACKUP#CORRUPTION <JBACKUP#DE<ICE <JBACKUP#FILES <JBACKUP#PIECE <JBACKUP#REDOLO@ <JBACKUP#SET <JBACKUP#SPFILE <JCOPC#CORRUPTION <JRMAN#CONFI@URATION

3 - 34

Copyright 2008, Oracle. All rights reserved.

$otes O&ly ,lide

3 - 35

Copyright 2008, Oracle. All rights reserved.

Monitoring RMAN "ac ups


!orrelate server sessions with channels by using the SET COMMAND ID command# Fuery <JPROCESS and <JSESSION to determine which sessions correspond to which RMAN channels# Fuery <JSESSION#LON@OPS to monitor the progress of bac ups and copies# Use an operating system utility to monitor the process or threads#

3-3

Copyright 2008, Oracle. All rights reserved.

$otes O&ly ,lide

3 - 3!

Copyright 2008, Oracle. All rights reserved.

'ummary
%n this lesson, you should have learned how to: Use the RMAN BACKUP command to create bac up sets and image copies /ist bac ups and image copies ta en with RMAN Report and delete obsolete RMAN bac ups

3 - 38

Copyright 2008, Oracle. All rights reserved.

(ractice Overview: "ac ing Up 5our 0atabase


$his practice covers the following topics: &nabling archival of redo logs for a database Using RMAN to display the database structure Using Recovery Manager to bac up data files and the control file Using Recovery Manager to ma e image copies of data files !reating a compressed bac up of a database 'cheduling a bac up job

3 - 3*

Copyright 2008, Oracle. All rights reserved.

3 - 40

Copyright 2008, Oracle. All rights reserved.

Das könnte Ihnen auch gefallen