Configuring Recovery Manager

2

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 . All rights reserved.notes only slide/ 2-5 Copyright © 2008. Oracle. .

Oracle.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. All rights reserved.

. Oracle."ecovery #a$ager Co%po$e$ts &$otes o$ly slide' 2-! Copyright © 2008. All rights reserved.

optionally. .'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. the recovery catalog databases2 52 Configure persistent settings2 2-8 Copyright © 2008. All rights reserved. Oracle.

Oracle. .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. All rights reserved.

All rights reserved.torageCo%pariso$ o. Optio$s &$otes o$ly slide' 2 . . Oracle.)0 Copyright © 2008."#A* "epository +ata .

tape device/ – $ypically used for disaster recovery. Oracle.)) Copyright © 2008."ac#up Destinations "ac#ups can be written to: • Dis# directory • Media Management !ibrary . All rights reserved. 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 . .

All rights reserved. .)2 Copyright © 2008.in MM! Or Media management library Media management server software 2 .channel/ Oracle 'ecure "ac#up with built.Media Management Recovery Manager 'erver session . Oracle.

lide 2 .*otes O$ly . All rights reserved.)3 Copyright © 2008. Oracle. .

-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 . . All rights reserved. Oracle.)4 Copyright © 2008.

All rights reserved. . Oracle./si$g a 0lash "ecovery Area 1ith "#A* &$otes o$ly slide' 2 .)5 Copyright © 2008.

Oracle.Monitoring the )lash Recovery Area with 0M 2-) Copyright © 2008. . All rights reserved.

)! Copyright © 2008. All rights reserved. Oracle. .)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 .

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 _)*+ . -u12 r_o!_!(l . . Oracle. AS -u12 r FRO5 6%!la. + rc -)_. + rc -)_.+ac _r cla(1a2l AS r cla(1a2l .)8 Copyright © 2008.a8 9 FILE_TY$E USED RECLAI5ABLE FILES ::::::::::::::::: ::::::::: ::::::::::: :::::: 2 . /. / AS u.+ac _u. All rights reserved.7_r co6 r*_ar a_u.

)( Copyright © 2008. .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 . Oracle.<=10 0 4<0 BAC>U$$IECE 0 0 0 I5AGECO$Y 0 0 0 FLASHBAC>LOG 1=?? 0 0? 2 . All rights reserved.

Oracle. All rights reserved."ac#ing -p the )lash Recovery Area R5AN' BAC>U$ RECOVERY FILES9 2 . .20 Copyright © 2008.

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.2) Copyright © 2008. ."enefits of -sing a )lash Recovery Area -sing the flash recovery area for recovery. Oracle. archive logs. and control file bac#ups in the flash recovery area 2 . 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 . Oracle. All rights reserved. .22 Copyright © 2008.

. Oracle.. All rights reserved.etti$g 2ara%eters that A.ect "#A* &$otes o$ly slide' 2 . .23 Copyright © 2008.

. 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 .RMA -sage Considerations • • Resources: 'hared memory.24 Copyright © 2008. All rights reserved. Oracle.

. Oracle. All rights reserved.Connection $ypes with RMA $arget database Recovery catalog D" Au*iliary database Recovery Manager 2 .25 Copyright © 2008.

)ar8 ) . All rights reserved. ) ORACLE_SID=DB01 CAF' r1a.)ar8 ) / E(-/oC. .'tarting RMA • 'tarting RMA locally B+or) ORACLE_SID UNI@A % ORACLE_SID=DB019 % r1a..)ar8 ) / • 'tarting RMA remotely r1a./+a.Cor/DDB01 2-2 Copyright © 2008. Oracle. NTA CAF' .*.

2! Copyright © 2008.cr(+)=rc6 • 0stablishing database connections on RMA startup % r1a.!ine Arguments • 9riting RMA output to a log file % r1a. Oracle./oracl C5DFILE=%HO5E/.cr(+).*./oracl LOG=%HO5E/ora/a)a/u00/r1a-=lo8 A$$END • 0*ecuting a command file when RMA is invo#ed % r1a.*./1*_r1a-_. ._+C/Dorcl CATALOG r1a-/r1a-Drca) 2 .TARGET .TARGET .Additional RMA Command. All rights reserved.*.TARGET SYS/.

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 . All rights reserved. Oracle. .28 Copyright © 2008.

Configuring RMA 'ettings by -sing 0M 2 .2( Copyright © 2008. . All rights reserved. Oracle.

30 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 .

3) Copyright © 2008. . Oracle.Co$trol 0ile A3to4ac53ps &$otes o$ly page' 2 . All rights reserved.

32 $hese policies are mutually e*clusive and can be set with the CONFIGURE command2 Copyright © 2008. All rights reserved. Oracle.day retention )ile1 ow – Redundancy: 0stablishes a fi*ed number of bac#ups that must be #ept • 2 .in. .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.time recovery must be possible )ile3 )ile3 needs to be bac#ed up: 'even.

All rights reserved."ete$tio$ 2olicies &$otes o$ly page' 2 .33 Copyright © 2008. . Oracle.

All rights reserved.34 Copyright © 2008. . Oracle.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 .

All rights reserved.'"$/ BAC>U$ RESTORE RECOVER 2 . .D&':/ RMA 'erver session Channel .Channel Allocation 'erver session $arget database Channel .35 Copyright © 2008. Oracle.

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. Oracle. . All rights reserved.H9 0' BAC>U$ DATAFILE '/u01/ora/a)a/u. r01=/2!'9 3' I 2-3 Copyright © 2008.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 /(. use: R5AN' CONFIGURE DEFAULT DEVICE TY$E TO .

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 '//(.3! Copyright © 2008. . Oracle.H1/2acHu+. All rights reserved./JU'9 3' BAC>U$ DATABASE $LUS ARCHIVELOG9 I 2 .

Oracle.38 Copyright © 2008. .*otes O$ly 2age 2 . All rights reserved.

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 .'ummary &n this lesson. .3( Copyright © 2008. Oracle. All rights reserved.

40 Copyright © 2008.+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 . Oracle. . All rights reserved.