Вы находитесь на странице: 1из 40

Configuring Recovery Manager

Copyright 2008, Oracle. All rights reserved.

Objectives
After completing this lesson, you should be able to do the following: Describe the RMA repository and recovery catalog Describe the Media Management !ibrary interface Configure database parameters that affect RMA operations Connect to the three different types of databases by using RMA Configure two types of retention policies Change RMA default settings with CONFIGURE

2-2

Copyright 2008, Oracle. All rights reserved.

"ac#up and Recovery: Review


$he major bac#up and recovery%related topics covered in the Database Administration & Course are: $ypes of failure that can happen
'tatement, session, instance, media, and so on

(ow to configure ARCHIVELOG mode (ow to automate bac#ups (ow to do incremental bac#ups (ow to perform and tune instance recovery

2-3

Copyright 2008, Oracle. All rights reserved.

)eatures of Recovery Manager


RMA provides a fle*ible way to: "ac# up the database including data files, control files, and archived redo logs Manage bac#up and recovery tas#s +erform incremental bloc#,level bac#up and bloc#, level media recovery Detect corrupted bloc#s during bac#up -se binary compression when creating bac#ups

2-4

Copyright 2008, Oracle. All rights reserved.

Recovery Manager )eatures .notes only slide/

2-5

Copyright 2008, Oracle. All rights reserved.

Recovery Manager Components


Recovery Manager .RMA /

$arget database

'erver session

0nterprise Manager 'erver session

Options Au*iliary database

Channel

Channel

Channel MM! Recovery catalog database

Dis#

)lash recovery area

2-

Copyright 2008, Oracle. All rights reserved.

"ecovery #a$ager Co%po$e$ts &$otes o$ly slide'

2-!

Copyright 2008, Oracle. All rights reserved.

'teps for Configuring RMA


12 Determine the repository location: control file or recovery catalog2 32 Define database and environment variables2 42 'tart RMA and connect to the target and, optionally, the recovery catalog databases2 52 Configure persistent settings2

2-8

Copyright 2008, Oracle. All rights reserved.

RMA Repository Data 'torage: Comparison of Options


Control file:
'impler administration Default

Recovery catalog:
Replicates control file data (as room for more data Can service many targets Can store RMA scripts

Metadata "ac#up set list &mage copy list 2 2 2

2-(

Copyright 2008, Oracle. All rights reserved.

"#A* "epository +ata ,torageCo%pariso$ o. Optio$s &$otes o$ly slide'

2 - )0

Copyright 2008, Oracle. All rights reserved.

"ac#up Destinations
"ac#ups can be written to: Dis# directory Media Management !ibrary .tape device/
$ypically used for disaster recovery, when dis# bac#ups are lost

)lash recovery area


$his is a dis# area set aside for bac#up and recovery and flashbac# database purposes2 6ou define the location and the si7e2 )iles are automatically named by using Oracle Managed )iles2 )iles are automatically retained and deleted as necessary2

2 - ))

Copyright 2008, Oracle. All rights reserved.

Media Management
Recovery Manager 'erver session .channel/

Oracle 'ecure "ac#up with built,in MM!

Or

Media management library Media management server software

2 - )2

Copyright 2008, Oracle. All rights reserved.

*otes O$ly ,lide

2 - )3

Copyright 2008, Oracle. All rights reserved.

-sing a )lash Recovery Area with RMA


6ou can configure RMA to use the flash recovery area2

RMA bac#up process Database area )lash recovery area

DB_RECOVERY_FILE_DEST = '/u01/oracl /!ra' DB_RECOVERY_FILE_DEST_SI"E = #G

2 - )4

Copyright 2008, Oracle. All rights reserved.

/si$g a 0lash "ecovery Area 1ith "#A* &$otes o$ly slide'

2 - )5

Copyright 2008, Oracle. All rights reserved.

Monitoring the )lash Recovery Area with 0M

2-)

Copyright 2008, Oracle. All rights reserved.

)lash Recovery Area 'pace -sage


Configure the retention policy to the minimum value appropriate for your database2 "ac# up the archive log files regularly and delete the files upon completion of the bac#up2 -se the RMA RE$ORT OBSOLETE and DELETE OBSOLETE commands to remove bac#ups and file copies that are not re8uired2

2 - )!

Copyright 2008, Oracle. All rights reserved.

V%FLASH_RECOVERY_AREA_USAGE
6ou can 8uery V%FLASH_RECOVERY_AREA_USAGE to view the flash recovery area dis# space usage2
S&L' # 0 3 4 SELECT !(l _)*+ , + rc -)_.+ac _u. / AS u. /, + rc -)_.+ac _r cla(1a2l AS r cla(1a2l , -u12 r_o!_!(l . AS -u12 r FRO5 6%!la.7_r co6 r*_ar a_u.a8 9

FILE_TY$E USED RECLAI5ABLE FILES ::::::::::::::::: ::::::::: ::::::::::: ::::::

2 - )8

Copyright 2008, Oracle. All rights reserved.

V%FLASH_RECOVERY_AREA_USAGE
Output from the V%FLASH_RECOVERY_AREA_USAGE 8uery
FILE_TY$E USED RECLAI5ABLE FILES :::::::::::: :::::::::: ::::::::::: :::::::::: CONTROLFILE 0 0 0 ONLINELOG 0 0 0 ARCHIVELOG ;<=10 0 4<0 BAC>U$$IECE 0 0 0 I5AGECO$Y 0 0 0 FLASHBAC>LOG 1=?? 0 0?

2 - )(

Copyright 2008, Oracle. All rights reserved.

"ac#ing -p the )lash Recovery Area

R5AN' BAC>U$ RECOVERY FILES9

2 - 20

Copyright 2008, Oracle. All rights reserved.

"enefits of -sing a )lash Recovery Area


-sing the flash recovery area for recovery,related files: 'implifies the location of database bac#ups Automatically manages the dis# space allocated for recovery files Does not re8uire changes to e*isting scripts +uts database bac#ups, archive logs, and control file bac#ups in the flash recovery area

2 - 2)

Copyright 2008, Oracle. All rights reserved.

'etting +arameters $hat Affect RMA


Database initiali7ation parameters
CONTROL_FILE_RECORD_>EE$_TI5E DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SI"E, if using the flash recovery area

0nvironment variables
NLS_DATE_FOR5AT NLS_LANG

2 - 22

Copyright 2008, Oracle. All rights reserved.

,etti$g 2ara%eters that A..ect "#A* &$otes o$ly slide'

2 - 23

Copyright 2008, Oracle. All rights reserved.

RMA -sage Considerations


Resources: 'hared memory, more processes +rivileges given to users:
Database: SYSDBA Operating system: Access to devices

Remote operations:
'et up the password file 0nsure that the password file is bac#ed up

2 - 24

Copyright 2008, Oracle. All rights reserved.

Connection $ypes with RMA

$arget database

Recovery catalog D"

Au*iliary database

Recovery Manager

2 - 25

Copyright 2008, Oracle. All rights reserved.

'tarting RMA
'tarting RMA locally
B+or) ORACLE_SID

UNI@A % ORACLE_SID=DB019 % r1a- )ar8 ) /

E(-/oC. NTA CAF' . ) ORACLE_SID=DB01 CAF' r1a- )ar8 ) /

'tarting RMA remotely


r1a- )ar8 ) .*./+a..Cor/DDB01

2-2

Copyright 2008, Oracle. All rights reserved.

Additional RMA Command,!ine Arguments


9riting RMA output to a log file

% r1a- TARGET .*./oracl LOG=%HO5E/ora/a)a/u00/r1a-=lo8 A$$END

0*ecuting a command file when RMA is invo#ed

% r1a- TARGET .*./oracl C5DFILE=%HO5E/.cr(+)./1*_r1a-_.cr(+)=rc6

0stablishing database connections on RMA startup

% r1a- TARGET SYS/.*._+C/Dorcl CATALOG r1a-/r1a-Drca)

2 - 2!

Copyright 2008, Oracle. All rights reserved.

Configuring +ersistent 'ettings for RMA


RMA is preset with default configuration settings -se the CONFIGURE command to:
Configure automatic channels 'pecify the bac#up retention policy 'pecify the number of bac#up copies to be created 'et the default bac#up type to BAC>U$SET or CO$Y !imit the si7e of bac#up sets 0*empt a tablespace from bac#up 0nable and disable bac#up optimi7ation Configure automatic bac#ups of control files

2 - 28

Copyright 2008, Oracle. All rights reserved.

Configuring RMA 'ettings by -sing 0M

2 - 2(

Copyright 2008, Oracle. All rights reserved.

Control )ile Autobac#ups

R5AN' CONFIGURE CONTROLFILE AUTOBAC>U$ ON9

"est practice: Oracle recommends that you enable control file autobac#up2

2 - 30

Copyright 2008, Oracle. All rights reserved.

Co$trol 0ile A3to4ac53ps &$otes o$ly page'

2 - 3)

Copyright 2008, Oracle. All rights reserved.

Retention +olicies
A retention policy describes which bac#ups will be #ept and for how long2 $here are two types of retention policies:
Recovery window: 0stablishes a period of time within which point,in,time recovery must be possible
)ile3 )ile3 needs to be bac#ed up: 'even,day retention )ile1 ow

Redundancy: 0stablishes a fi*ed number of bac#ups that must be #ept

2 - 32

$hese policies are mutually e*clusive and can be set with the CONFIGURE command2
Copyright 2008, Oracle. All rights reserved.

"ete$tio$ 2olicies &$otes o$ly page'

2 - 33

Copyright 2008, Oracle. All rights reserved.

Managing +ersistent 'ettings


-se the SHOE command to list current settings:

R5AN' SHOE CONTROLFILE AUTOBAC>U$ FOR5AT9 R5AN' SHOE E@CLUDE9 R5AN' SHOE ALL9

-se the CLEAR command to reset any persistent setting to its default value:

R5AN' CONFIGURE BAC>U$ O$TI5I"ATION CLEAR9 R5AN' CONFIGURE 5A@SETSI"E CLEAR9 R5AN' CONFIGURE DEFAULT DEVICE TY$E CLEAR9

2 - 34

Copyright 2008, Oracle. All rights reserved.

Channel Allocation

'erver session $arget database

Channel .D&':/

RMA

'erver session

Channel .'"$/

BAC>U$ RESTORE RECOVER

2 - 35

Copyright 2008, Oracle. All rights reserved.

Automatic and Manual Channel Allocation


An automatic channel is one that is preconfigured and used for subse8uent commands2 $o change the default device type for automatic channel allocation, use:
R5AN' CONFIGURE DEFAULT DEVICE TY$E TO .2)9

A manually allocated channel is one that overrides the automatic channel setting2 $his channel overrides the automatic channel for this run bloc#:
R5AN' RUN G #' ALLOCATE CHANNEL c1 DEVICE TY$E /(.H9 0' BAC>U$ DATAFILE '/u01/ora/a)a/u. r01=/2!'9 3' I

2-3

Copyright 2008, Oracle. All rights reserved.

Channel Control Options


Configure parallelism:

R5AN' CONFIGURE DEVICE TY$E DIS> $ARALLELIS5 09

'pecify the ma*imum bac#up piece si7e:

R5AN' CONFIGURE CHANNEL DEVICE TY$E DIS> #' 5A@$IECESI"E #G9

)ormat the name of generated bac#up files:

R5AN' RUN G #' ALLOCATE CHANNEL /1 DEVICE TY$E DIS> 0' FOR5AT '//(.H1/2acHu+./JU'9 3' BAC>U$ DATABASE $LUS ARCHIVELOG9 I

2 - 3!

Copyright 2008, Oracle. All rights reserved.

*otes O$ly 2age

2 - 38

Copyright 2008, Oracle. All rights reserved.

'ummary
&n this lesson, you should have learned how to: -se either the control file or a recovery catalog for the RMA repository Change RMA default settings with CONFIGURE -se the flash recovery area for RMA operations Monitor the flash recovery area by using 6% views and 0nterprise Manager &mplement recovery window and redundancy retention policies &mplement manual and automatic channel allocation

2 - 3(

Copyright 2008, Oracle. All rights reserved.

+ractice Overview: Configuring RMA


$his practice covers the following topics: -sing Recovery Manager to connect to a target database in default NOCATALOG mode Displaying the default RMA configuration settings Configuring control file autobac#ups Altering the bac#up retention policy for a database

2 - 40

Copyright 2008, Oracle. All rights reserved.

Вам также может понравиться