Oracle RMAN Survival Guide Overview

This guide is a quick-reference guide for Recovery Manager (RMAN), Oracle's utility to anage all of the Oracle data!ase !acku" and recovery activities# This guide is not a co "rehensive !acku" and recovery !ook# $t contains an overvie% of RMAN architecture, sho%s !riefly ho% to !acku" and restore data!ases using RMAN, descri!es catalog setu" issues, and "rovides quick-reference synta& diagra s of RMAN co ands# The "ur"ose of this guide is to hel" you quickly find the synta& for, and use, RMAN co ands to !ack u", restore, and recover a data!ase# 'e also "oint out that the !atch ode e&a "les in this guide are scri"ted %ith (ni& shell scri"ts# Many of these e&a "les contain (ni& "aths that are a""ro"riate for our environ ent# $f you are develo"ing your o%n set of scri"ts, you %ill %ant to change the e&a "les to reflect your o%n environ ent# The real success of a !acku" de"ends on ho% effectively you can restore the data!ases fro these !acku"s# )evelo" recovery scri"ts and ake sure to test and "ractice the different recovery scenarios# After a ne% incarnation of a data!ase is created, ake sure to run a full !acku" of the data!ase# Also, ake sure to run a full e&"ort of the data!ase once the data!ase is recovered# $t %ill go through all the data!ase !locks and is a good %ay to check %hether there are still corru"t datafiles# Which Files must be backed up? All files in the grey area !elo% ust !e !acked u"#

o o o o o

)ata!ase *iles (%ith RMAN) +ontrol *iles (%ith RMAN) Offline Redolog *iles (%ith RMAN) $N$T#ORA ( anually) ,ass%ord *iles ( anually)

Note that the Online Redolog *iles are not !acked u" The "ara eter file $N$T#ORA and the "ass%ord file ust !e !acked u" anually#

RMAN Architecture
Recovery Manager (RMAN) is a utility that can anage all of your Oracle !acku" and recovery activities# ).As are often %ary of using RMAN !ecause of its "erceived co "le&ity and its control over "erfor ing critical tasks# The traditional !acku" and recovery ethods are tried-and-true# Thus, %hen your livelihood de"ends on your a!ility to !ack u" and recover the data!ase, %hy i "le ent a technology like RMAN/ The reason is that RMAN co es %ith several !enefits0 o o o o o o $ncre ental !acku"s that only co"y data !locks that have changed since the last !acku"# Tablespaces are not put in backup mode, thus there is no e&tra redo log generation during online !acku"s# )etection of corru"t !locks during !acku"s# ,aralleli1ation of $2O o"erations# Auto atic logging of all !acku" and recovery o"erations# .uilt-in re"orting and listing co ands#

RMAN's architecture is a co !ination of an e&ecuta!le "rogra (the RMAN utility) and !ackground "rocesses that interact %ith one or ore data!ases and %ith $2O devices# There are several key architectural co "onents to !e a%are of0 o o o o o o o RMAN e&ecuta!le 3erver "rocesses +hannels Target data!ase Recovery catalog data!ase (o"tional) Media anage ent layer (o"tional) .acku"s, !acku" sets, and !acku" "ieces

The follo%ing sections descri!e each of these co "onents#

RMAN !ecutable
The RMAN e&ecuta!le, usually na ed rman, is the "rogra that anages all !acku" and recovery o"erations# 4ou interact %ith the RMAN e&ecuta!le to s"ecify !acku" and recovery o"erations you %ant to "erfor # The e&ecuta!le then interacts %ith the target data!ase, starts the necessary server "rocesses, and "erfor s the o"erations that you requested# *inally, the RMAN e&ecuta!le records those o"erations in the target data!ase's control file and the recovery catalog data!ase, if you have one#

Server "rocesses
RMAN server "rocesses are !ackground "rocesses, started on the server, used to co unicate !et%een RMAN and the

and recovery o"erations# This is the data!ase that o%ns the datafiles. restore. either a disk or an s!t5ta"e Nu !er of "rocesses si ultaneously accessing an $2O device Ma&i u si1e of files created on $2O devices Ma&i u rate at %hich data!ase files are read Ma&i u nu !er of files o"en at a ti e Tar$et %atabase The target data!ase is the data!ase on %hich RMAN "erfor s !acku". a server "rocess is started on the target data!ase server# $t is through the allocation of channels that you govern $2O characteristics such as0 o o o o o Ty"e of $2O device !eing read or %ritten to. and a ty"ical !acku" or restore o"eration results in several server "rocesses !eing started# 3erver "rocesses are started under the follo%ing conditions0 o o o 'hen you start RMAN and connect to your target data!ase 'hen you connect to your catalog -. and archived redo files that are !acked u". and archived redo log files 3tored scri"ts containing frequently used sequences of RMAN co ands 'hy is the catalog o"tional/ 'hen RMAN "erfor s any !acku" o"eration.if you are using a recovery catalog data!ase 'hen you allocate and o"en an $2O channel during a !acku" or recovery o"eration #hannels A channel is an RMAN server "rocess started %hen there is a need to co unicate %ith an $2O device. or recovered# Note that RMAN does not back up the online redo lo$s o& the tar$et database # Recover' #atalo$ %atabase The recovery catalog data!ase is an o"tional re"ository used !y RMAN to record infor ation concerning !acku" and recovery activities "erfor ed on the target# The recovery catalog consists of three co "onents0 o o o A se"arate data!ase referred to as the catalog data!ase (fro the target data!ase) A sche a %ithin the catalog data!ase Ta!les (and su""orting o!6ects) %ithin the sche a that contain data "ertaining to RMAN !acku" and recovery o"erations "erfor ed on the target The catalog is ty"ically a data!ase that you !uild on a different host fro your target data!ase# The reason for this is that you don't %ant a failure on the target host to affect your a!ility to use the catalog# $f !oth the catalog and target are on the sa e !o&. restored. it writes in&ormation about that task to the tar$et database(s control &iles) Therefore. RMAN does not need a catalog to o"erate# $f you choose to i "le ent a . control files. a single edia failure can "ut you in a situation fro %hich you can't recover your target data!ase# $nside the catalog data!ase is a s"ecial sche a containing the ta!les that store infor ation a!out RMAN !acku" and recovery activities# This includes infor ation such as0 o o o )etails a!out the "hysical structure of the target data!ase A log of !acku" o"erations "erfor ed on the target data!ase's datafiles. or other $2O devices# RMAN server "rocesses do all the real %ork for a !acku" or restore o"!ases# They can also co unicate !et%een RMAN and any disk. ta"e. control files. such as a disk or a ta"e# A channel is %hat reads and %rites RMAN !acku" files# Any ti e you issue an RMAN allocate channel command.

you need to understand that the follo%ing ter s have s"ecific eanings0 RMAN backup A !acku" of all or "art of your data!ase# This results fro ore !acku" sets# +ackup set A logical grou"ing of !acku" files -. then RMAN %ill store additional infor ation a!out %hat %as !acked u" -. and "asses the !ack to RMAN8 RMAN then restores the data!ase file# +ackups.the !acku" "ieces -. and control files# 'hen RMAN constructs a !acku" "iece fro o datafiles. %hether to disk or ta"e# They contain !locks fro the target data!ase's datafiles. thus reducing your risk of losing !oth the target data!ase and !acku" files at the sa e ti e 'hen !acking u" files to ta"e. you can leverage this architecture to i "le ent RMAN !acku"s to ta"e# There are several reasons to !ack u" files to ta"e and thus require an MM70 o o The e&"ense of storing large !acku"s on disk is too costly# 4our require ent is to !ack u" files so e%here other than on the sa e server as the target data!ase. RMAN co unicates to the MM7 a list of the !acku" files that are required to restore the data!ase file# The MM7 then deter ines %hich ta"es contain the required !acku" files. +ackup Sets. retrieves the requested !acku" files.that are created %hen you issue an RMAN !acku" co and# A !acku" set is RMAN's na e for a collection of files associated %ith a !acku"# A !acku" set is co "osed of one or ore !acku" "ieces# +ackup piece A "hysical !inary file created !y RMAN during a !acku"# . RMAN creates !acku" sets.recovery catalog data!ase. archived redo log files. an MM7 kee"s track of %hich files %ere %ritten to %hich ta"es# $n the event that restoration of a data!ase file is required. and +ackup "ieces 'hen you issue an RMAN !acku" co and. you do not need an MM7# MM7 tools are often used !y 3yste Ad inistrators to !ack u" the host O23 filesyste s# $f your %ork environ ent already uses a MM7.acku" "ieces are %ritten to your !acku" ediu .in the catalog# etadata The "ri ary reason for i "le enting a catalog is that it ena!les the greatest fle&i!ility in !acku" and recovery scenarios# (sing a catalog gives you access to a longer history of !acku"s and allo%s you to anage all of your !acku" and recovery o"erations fro one re"ository# (tili1ing a catalog akes availa!le to you all the features of RMAN# *or reasons such as these. %e reco end using a catalog data!ase# Media Mana$ement *a'er The Media Manage ent 7ayer (MM7) is a third-"arty "iece of soft%are that anages the reading and %riting of files to and fro ta"e# An MM7 also kee"s track of %hich files have !een %ritten to %hich ta"es# $f you %ant to !ack u" your data!ase files to ta"e. there are a several rules that it follo%s0 issuing an RMAN !acku" co and# A !acku" consists of one or A datafile cannot s"an !acku" sets# . RMAN requires you to use an MM7# $f you "lan to use RMAN to !ack u" files only to disk. %hich are logical grou"ings of "hysical files# The "hysical files that RMAN creates on your !acku" edia are called !acku" "ieces# 'hen %orking %ith RMAN.often called -.

it can !e difficult to recover control files# 4ou can retain !acku" and recovery etadata for long "eriods of ti e# 4ou can centrali1e o"erations# RMAN !eco es ore fle&i!le in certain !acku" and recovery scenarios# A catalog ena!les you to recover your control files in the event that they are all corru"ted or lost# $f you are not using a catalog. there are a fe% "otential headaches that you should !e a%are of0 o o o ("grades and co "ati!ility can !e "ro!le atic# A catalog adds co "le&ity# (sing a catalog created "rior to Oracle =ersion 9#>#? %ith ulti"le versions of target data!ases can !e . you have greater fle&i!ility during certain recovery situations# *or e&a "le. you could find yourself in the unenvia!le "osition of not !eing a!le to recover your target# Another good reason to use a catalog is that infor ation "ertaining to your RMAN !acku" and recovery activities can !e stored for very long "eriods of ti e# $f for any reason you had to use a !acku" set that %as several onths old. and you haven't !acked u" your control files via an A7T:R )ATA. you can use "revious incarnations of the data!ase for recovery# #atalo$ disadvanta$es 'hile the advantages of the catalog are su!stantial. you get ore fle&i!ility and access to all the features of RMAN# The advantages of using a catalog accrue in the follo%ing areas0 o o o o $f you are using Oracle9i.A+. %hen using the catalog. RMAN can !e configured to store this infor ation in a se"arate data!ase kno%n as the catalog# The catalog consists collectively of a data!ase and a data!ase sche a# The sche a o!6ects hold the RMAN-s"ecific infor ation for each of your target data!ases# #atalo$ advanta$es 'hen you use a catalog re"ository. you can anage all of your !acku" and recovery activities fro one re"ository# The advantage of this is that if you have ulti"le data!ases to aintain.A3: . a catalog "rovides ore fle&i!ility to go !ack further in ti e than %ith the NO+ATA7O< o"tion# 'ith a catalog.o o o A datafile can s"an !acku" "ieces as long as it stays %ithin one !acku" set# )atafiles and control files can coe&ist in the sa e !acku" sets# Archived redo log files are never in the sa e !acku" set as datafiles or control files# RMAN is the only tool that can o"erate on !acku" "ieces# $f you need to restore a file fro an RMAN !acku". you're storing all of your !acku" and recovery etadata in one "lace# *inally. RMAN can !e thought of as an Oracle data!ase file !acku" and restoration utility# RMAN ust kee" track of any things# 'hen %as the last !acku" taken/ 'hich files %ere !acked u"/ 'hich !acku" sets contain %hich data!ase files/ The ans%ers to these questions can !e found in the target control files# O"tionally. +ONTRO7*$7: co and.(. you ust use RMAN to do it# There's no %ay for you to anually reconstruct data!ase files fro the !acku" "ieces# 4ou ust use RMAN to restore files fro a !acku" "iece# -nstallin$ a #atalo$ One i "ortant decision %hen using RMAN is deciding %hether to use a recovery catalog# This section covers the "ros and cons of a catalog and then details catalog i "le entation issues# What -s the #atalo$? $n any res"ects.

!ut you don't %ant the overhead of a catalog. and recover a data!ase %ithout setting u" a catalog# 4ou ay decide not to use a catalog !ecause you have li ited resources or !ecause you %ant a quick and easy !acku" and recovery echanis for your data!ases# This section "oints out the issues you need to !e a%are of if you choose this route0 $f you are using Oracle9i or an earlier version. you ay not !e a!le to recover your data!ase# $f you e&clusively use the target control files for the re"ository. Oracle reco ends that you use a catalog data!ase# @o%ever. restore. you ust "ut into "lace a echanis that !acks u" your control files# (This should !e a standard "ractice any%ay#) 4ou should also ulti"le& your control files to ulti"le disk drives# $f you do not use a catalog.sin$ RMAN without a catalo$ RMAN can !e used out of the !o& to !ack u". ensure that you take full or level A !acku"s of all your target data!ases as soon as "ossi!le# #old backup +old !acku"s are si "le to i "le ent !ut require do%nti e# $f your catalog data!ase is in archivelog cold !acku"s to do "oint-in-ti e recovery of your catalog if necessary# /ot backup @ot !acku"s are slightly ore co "le& to i "le ent than cold !acku"s !ut have the advantage of kee"ing the data!ase online during the !acku"# *or these reasons. this is our "referred ethod for !acking u" the catalog# ode. it then de ands the attention that you %ould give to any other i "ortant "roduction data!ase# As %ith any "roduction data!ase.A resources# $f you're !acking u" "roduction data!ases. you ay not !e a!le to recover your data!ase if you lose all of your control files# $f this ha""ens. you can use . there are various !acku" and recovery strategies0 o o o o o o *ull e&"ort +old !acku" @ot !acku" RMAN !acku" @ot stand!y Recreating catalog :ach ethod has its advantages and disadvantages that you should %eigh !ased on your !usiness require ents# 3o e of the significant issues related to each !acku" ethod are discussed ne&t# Full e!port A full e&"ort is one of the si "lest ethods to !ack u" a data!ase# The do%nside to a full e&"ort is that you can only recover your data!ase u" to the last ti e you took a full e&"ort# $f you have to restore your catalog fro a full e&"ort. if you have non"roduction data!ases for %hich you %ant to i "le ent RMAN functionality.o "ro!le atic# A catalog can increase your needs for hard%are and ). #atalo$ +ackup Strate$ies $f you i "le ent a catalog. and you %ant the ost fle&i!ility "ossi!le for any given !acku" and recovery scenario. you ay %ant to consider 6ust using the target control files# . ake sure that your control files are !acked u" via the0 ALTER DATABASE BACKUP CONTROLFILE command.

>) on gecko Target )ata!a!ase0 Oracle >A#>#A#C (A. ake sure that you have a se"arate echanis to !ack u" the control files# /ot standb' @ot stand!ys let you quickly !ring u" a stand!y data!ase if the "ri ary is do%n# @o%ever. follo% these ste"s0 ># +reate a s"ecific ta!les"ace to hold the catalog o!6ects# . hot stand!ys can !e co "le& to i "le ent and consu e ore resources# Recreatin$ a catalo$ $f you co "letely lose your catalog and have no usa!le !acku"s of it. sche a. after all. you 6eo"ardi1e !acku" and recovery o"erations.$>) on akira To create a recovery catalog. !ecause you ake it "ossi!le to lose !oth the catalog and target data!ases# The catalog can coe&ist in a data!ase used for other a""lications# The advantage to this is that you leverage e&isting resources# The disadvantage is that the "erfor ance and availa!ility of your catalog can !e affected !y other a""lications %ithin the sa e data!ase# 0ersion o& catalo$ 'hat version of Oracle should you use to create the catalog data!ase/ 'e suggest that the catalog data!ase !e created %ith the latest version of Oracle in your "roduction environ ent# This hel"s to ini i1e co "ati!ility issues and co "le&ity %hen you start to !ack u" your target data!ases# #reatin$ a #atalo$ The e&a "les in this section "rovide details for creating a catalog data!ase and registering a target data!ase %ithin the catalog# These e&a "les assu e that your catalog data!ase is on a different host than your target data!ase# +atalog )ata!ase0 Oracle B#C#A#D (<:. 6ust a data!ase. and o!6ects# @ere are so e issues you should consider0 o o o o 'here to "ut the data!ase that %ill host the catalog 'hich data!ase version to use for the catalog @o% to si1e the catalog @o% to anage ulti"le target data!ases "h'sical location o& the catalo$ 4ou should "lace the catalog data!ase on a different server than the target data!ase# $f you fail to do this.RMAN backup RMAN can !e used to !ack u" your catalog either %ith another catalog or %ith the NO+ATA7O< o"tion# +reating another catalog to !ack u" your catalog adds co "le&ity to your architecture# $f you use RMAN %ith no catalog. if you lose a target data!ase and its control files you ay not !e a!le to recover the # #atalo$ -ssues The creation of the catalog data!ase is fairly straightfor%ard# $t is. you can recreate it and then reregister and !ack u" your targets# The risk of this ethod is that during this "eriod.

the ne&t logical ste" is to register a target data!ase# 4ou %on't !e a!le to !ack u" the target %ith the catalog unless the target is registered# On the !o& that hosts the target data!ase.0.0 .0 . connected to target data+ase: A.PORAR0 TABLESPACE t mp 1UOTA UNLI.2./-.0. and issue the create catalog co and# $f you don't s"ecify a ta!les"ace %ith the create catalog co and.1. invoke RMAN.01&&))&1020% connected to recovery catalog data+ase RMAN> # "5st # data*as / .rod!ction "o#yright $c% 1&&'( 200)( *racle.-1 $.ITED ON #man'cat/ . and issue the register data!ase co and# $n this e&a "le %e are registering a target data!ase identified as A. connect to !oth the target and the catalog.E -). lets the sche a anage its catalog o!6ects# %RANT # co2 #y'catalo"'o3n # TO #mancat/ %RANT CREATE T0PE to #mancat/ 4ou can no% create the catalog o!6ects %ithin your ne% sche a# $n order to "erfor this ste".$>0 oracle@akira:~> #man ta#" t ! catalo" #mancat!#mancat$%EK& Recovery Manager: Release 10. you can create the sche a0 CREATE USER #mancat IDENTIFIED B0 #mancat DEFAULT TABLESPACE #man'cat TE.2.rod!ction "o#yright $c% 1&&'(200)( *racle./ No% that you have a ta!les"ace to store your sche a o!6ects. you need to grant s"ecial "rivileges to your ne% sche a# These "rivileges. connect to your ne%ly created catalog sche a. connected to recovery catalog data+ase recovery catalog is not installed RMAN> c# at catalo"/ recovery catalog created RMAN> 45t At this "oint.1. All rights reserved.d*+( SI. granted through the R:+O=:R45+ATA7O<5O'N:R role. you no% have an o"erational RMAN catalog# Re$isterin$ a Tar$et %atabase After creating a catalog. invoke RMAN. the catalog o!6ects are created in the default ta!les"ace assigned to the catalog o%ner# oracle@akira:~> #man catalo" #mancat!#mancat$%EK& Recovery Manager: Release 10. All rights reserved.C# +reate a catalog sche a# E# $ssue a""ro"riate grants# D# +reate the sche a o!6ects# oracle@akira:~> sqlplus syst m!mana" #$%EK& CREATE TABLESPACE #man'cat DATAFILE (!u)&!o#acl !d*!%EK&!cat!#man'cat')&.efore you can create the catalog o!6ects.

-@.7 * 9-M->A9-*N *N= "*N5-67R8 . 8 .7 *N= "*N5-67R8 "*N9R*:5-:8 A79*/A".8?-"8 9.I.ATION ON/ RMAN> S:O= ALL/ RMAN con3ig!ration #arameters are: "*N5-67R8 R898N9-*N *:-". 9* R8.acku"s to !e stored on disk in the 4!014oracle4d+4A.7 @89= "*N5-67R8 .7N.-@.7 9.8?-"8 9. ARA::8:-@M 2 /A".7 "* -8@ 5*R .AT FOR DE7ICE T0PE DISK TO (!u)&!o#acl !d*!AKI&!*c.AN".-14+ck directory C server "rocesses to do !acku"2restore o"erations in "arallel (se the ne% controlfile auto!acku" feature 3et !acku" o"ti i1ation on $f 4!014oracle4d+4A.!o#a'c+<F(/ RMAN> CONFI%URE BACKUP OPTI.85A7:9 .-14+ck does not e&ist "lease create is no%# 6 #man ta#" t ! catalo" #mancat!#mancat$%EK& RMAN> RMAN> RMAN> RMAN> CONFI%URE DEFAULT DE7ICE T0PE TO DISK/ CONFI%URE RETENTION POLIC0 TO REDUNDANC0 8/ CONFI%URE DE7ICE T0PE DISK PARALLELIS. 9* 1= D de3a!lt .A9A5-:8 /A".-14+ck4oraBc3C5A= "*N5-67R8 .!o#a'd+<t's<s's<p(/ RMAN> CONFI%URE CONTROLFILE AUTOBACKUP ON/ RMAN> CONFI%URE CONTROLFILE AUTOBACKUP FOR.8?-"8 9. <= "*N5-67R8 /A". 8 9* . 8 .8?-"8 9.= "*N5-67R8 "*N9R*:5-:8 A79*/A". 8 9* /A". 8 .-@. 9/ CONFI%URE C:ANNEL DE7ICE T0PE DISK FOR.AT (!u)&!o#acl !d*!AKI&!*c.R #ommand 4ou can configure "ersistent settings in the RMAN environ ent# The configuration setting is done once. 9* A4!014oracle4d+4A.-@.7 5*RMA9 5*R . and used !y RMAN to "erfor all su!sequent o"erations# )is"lay the "reconfigured settings !y ty"ing the co and 3@O' A77# There are various "ara eters that can !e used to configure RMAN o"erations to suit your needs# 3o e of the things that you can configure are0 o o o Required nu !er of !acku"s of each datafile Nu !er of server "rocesses that %ill do !acku"2restore o"erations in "arallel )irectory %here on-disk !acku"s %ill !e stored and to its default setting !y running the co and %ith the +7:AR o"tion# 4ou can return any +ON*$<(R: co 4ou %ill no% configure the follo%ing "ara eters0 o o o o o E !acku"s of each datafile .data+ase registered in recovery catalog starting 3!ll resync o3 recovery catalog 3!ll resync com#lete RMAN> 45t #on&i$urin$ the RMAN nvironment #ONF-G.

you set u" a (ni& grou". 9* N*N8= D de3a!lt @NA @E*9 "*N9R*:5-:8 NAM8 9* A4o#t4oracle4#rod!ct410. 8 .A "rivilege0 o o 7ocally via O23 authentication Re otely via "ass%ord file O23 authentication is esta!lished %hen you install the Oracle !inaries# At that ti e.A "rivileges# Often the (ni& account used to install the Oracle !inaries is na ed oracle# This account is usually set u" to !elong to the d!a grou".1. you then need access to an O23 account or a data!ase sche a that has 343).-@.8?-"8 9. you ust ensure that the standard (ni& environ ent varia!les are esta!lished# These varia!les include0 ORA+7:53$).od 8na+led 4!014oracle4d+4A. 9* 1= D de3a!lt "EANN8: ..7 "* -8@ 5*R .efore you connect to your target data!ase.AT@."*N5-67R8 "*N5-67R8 "*N5-67R8 "*N5-67R8 "*N5-67R8 de3a!lt AR"E-?8:*6 /A". ho% to connect to a target data!ase !oth %ith and %ithout using a recovery catalog# Tar$et "rere1uisites $f you already have your target data!ase environ ent set u".-14arc 12H< 12H2 12H2 Workin$ with RMAN This section e&"lains so e of the "rerequisites that ust !e in "lace !efore you can use RMAN# $t then sho%s you ho% to invoke RMAN and finally.ata+ase log mode A!tomatic archival Archive destination *ldest online log seG!ence NeIt log seG!ence to archive "!rrent log seG!ence alt # data*as op n/ A#c?52 . the "ath to the RMAN e&ecuta!le8 and the !ehavior of !acku". and re"orting co ands# 'hen using RMAN. and s"ecify this as the O23 grou" %ith 343). it lets you start RMAN and .A "rivilege !efore you can connect to the target data!ase using RMAN# There are t%o ethods of ad inistering the 343). 5*RMA9 A4!014oracle4d+4A.-14+ck4oraBd3CtBsCsBsC#A= MAF@89@->8 9* 7N:-M-98.8:89-*N *:-". and consequently.A "rivileges# 4ou ust have access to the 343).3A= D 0eri&' that the %atabase is in AR#/-0 *OG Mode sqlplus >sys!mana" # as sysd*a> s?utdo3n 5mm d5at / sta#tup mount/ alt # data*as a#c?52 lo"/ a#c?52 lo" l5st/ .= D de3a!lt AR"E-?8:*6 . you ay encounter "ro!le s %hen issuing . R:3TOR:. you can ski" this section# $f not. and N735)AT:5*ORMAT# They govern the na e of the instance. ORA+7:5@OM:. . and R:+O=:R co ands# Once you have the a""ro"riate environ ent varia!les set.A "rivileges# .-1. N7357AN<.8?-"8 9.-@. restore. N7357AN< should !e set to the character set that your data!ase %as created %ith# $f you do not set N7357AN<. 8 .04d+s4sna#c3BA.(. often na ed dba. there are a fe% things you need to have in "lace !efore instructing RMAN to connect to the target0 o o A""ro"riate target environ ent varia!les ust !e esta!lished# 4ou ust have access to an O23 account or a sche a that has 343).A+.

+ to the re ote data!ase as 343 %ith 343). that you %ant the "ass%ord to !e goofi.A "rivileges# 3etting u" a "ass%ord file is the other ethod !y %hich you can ad inister the 343).A "rivilege# n0 The a&i u nu !er of sche as allo%ed in the "ass%ord files# e !er of the d!a grou0 *or e&a "le. as the Oracle soft%are o%ner or as a J cd J*RA":8BE*M84d+s J ora#Kd 3ile0sidname #assKord0password entries0n There are three user-"rovided varia!les in this e&a "le0 o o o sidname0 The 3$) of the target instance password0 The "ass%ord to !e used %hen you connect a user 343 %ith 343). you need to do the follo%ing0 o o +reate a "ass%ord file :na!le re ote logins for "ass%ord file users #reate a "assword File &or Tar$et To create the "ass%ord file. if you're in an environ ent %here you %ant to !ack u" all of your target data!ases fro one "lace and not have to log on to each host and !ack u" the data!ase. try to connect fro a .connect to the target data!ase# O23 authentication is %hat "er its you to connect locally %ithout having to s"ecify the A3 343). set the instance's R:MOT:57O<$N5. as sho%n0 remoteBloginB#assKord3ile 0 eIcl!sive 3etting this "ara eter to e&clusive signifies that only one data!ase can use the "ass%ord file and that users other than sys and internal can reside in it# 2ou can now use a network connection to connect to 'our tar$et database as S2S%+A) Test the connection. RMAN auto atically connects you to the target data!ase %ith 343).A33'OR)*$7: initiali1ation "ara eter to e&clusive. you need to ena!le re ote logins# To do this.A "rivilege# There are t%o good reasons to use RMAN %ith a "ass%ord file0 o o Oracle has de"recated the use of +ONN:+T $NT:RNA7 and 3erver Manager# 4ou ay %ant to ad inister RMAN re otely through a net%ork connection# *or e&a "le. you ust do it via a net%ork connection# To re otely ad inister RMAN through a net%ork connection. say that you have an instance na ed AKI1.A o"tion# *or local connections.-1 #assKord0goo3i entries0<0 The resulting "ass%ord file is na ed orapwAKI1 and is in the $ORACLE_HOME/dbs directory# After you create a "ass%ord file.A "rivileges0 . and that you %ant at the ost EA entries in the "ass%ord file0 J cd J*RA":8BE*M84d+s J ora#Kd 3ile0ora#KA.

M-N 9R78 5A:@8 -nvokin$ the RMAN !ecutable $n order to use RMAN./ @. you need to connect as an account that has the 343). that user can !e queried in the =F.ANAD.A "rivilege is granted to a s"ecified user. @M:> s l ct @ +#om 26p3+5l 'us #s 3? # us #nam A(R.----.2.----RMANA. the 343).A "rivilege# 'hen you connect re otely to a target data!ase.1.IN(/ 7@8RNAM8 @.0. issue the r an co RMAN "ro "t0 J #man Recovery Manager: Release 10.'*$7:5(3:R3 vie%# *or e&a "le0 @M:> "#ant S0SDBA to #manadm5n/ 6rant s!cceeded.A "rivilege is ena!led through the "ass%ord file# This is unlike a connection to the catalog. in the !in directory of your Oracle installation# To invoke the RMAN e&ecuta!le.J sGl#l!s Lsys4goo3i@A.@* -----------------------------. you have to invoke the e&ecuta!le# Once you've invoked the e&ecuta!le.0 rod!ction and fro your O23 co and "ro "t# 4ou are "resented %ith an .A is not required. you get an RMAN "ro "t.-1 as sysd+aL Note that you have to create a "ass%ord file only for the target data!ase and not for the catalog# This is !ecause %hen you connect to the target. !ecause you log in as the o%ner of the catalog sche a# 'hen the 343). for %hich 343). fro %hich you can e&ecute RMAN co ands# The e&ecuta!le for RMAN is located %ith all of the other Oracle e&ecuta!les.@.

01&&))&1020% !sing target data+ase control3ile instead o3 recovery catalog 4ou can use O23 authentication only fro "assword &ile authentication $f you are connecting to the target data!ase via a net%ork connection./-. connected to target data+ase: A.1.2. you need to use a connect string# *or this to %ork. you should have a "ass%ord file in "lace for your target data!ase# The follo%ing e&a "le connects to the target A.$> using the sys account# client-#c> #man ta#" t sys!"oo+5$AKI& nocatalo" an O23 account on the data!ase server# and0 /idin$ the password 3u""lying userna es and "ass%ords on the co and line is convenient# (nfortunately. All rights reserved. this "ractice "oses a serious .0.RMAN> *ro here you can use RMAN's co and-line interface language to "erfor !acku" and recovery tasks# #onnectin$ to a Tar$et with No #atalo$ The si "lest %ay to use RMAN is to connect to a target data!ase %ithout a recovery catalog# 4ou do this using the nocatalog co and-line o"tion# O3S authentication $f you %ant to connect to a target data!ase using O23 authentication. use the follo%ing co J #man ta#" t ! nocatalo" Recovery Manager: Release 10.0 .-1 $.rod!ction "o#yright $c% 1&&'( 200)( *racle.

you %ill ty"ically connect to the target and the catalog at the sa e ti e# This is !ecause %hen you're "erfor ing !acku" and recovery o"erations !oth the target and the catalog need to !e a%are of your activities# $f you're logged on to the target data!ase host. All rights reserved. !ut connect after an RMAN session as !een initiated# *or e&a "le0 +onnecting to the data!ase after RMAN has !een invoked "revents any "ass%ord infor ation fro list# sho%ing u" in a "rocess #onnectin$ to +oth a Tar$et and a #atalo$ $f you're using a catalog.0.01&&))&1020% connected to recovery catalog data+ase This connects you to the target and catalog data!ase at the sa e ti e# Alternatively. and you ay not !e a!le to recover your target data!ase# O3S authentication The follo%ing e&a "le assu es you're logged onto the target host as the oracle user or a that a recovery catalog is in "lace# J #man ta#" t ! catalo" #mancat!#mancat$%EK& Recovery Manager: Release risk# 'ith (ni&. your connection to the catalog usually %ill !e through a net%ork connection# This is !ecause in a "roduction environ ent your catalog data!ase should never reside on the sa e host as your target data!ase# $f your target and catalog are on the sa e host. you can invoke RMAN first and then ./-. your co and line ay !e visi!le to other users on the syste via the "s co and# *ortunately. and "o#yright $c% 1&&'( 200)( *racle. connected to target data+ase: A.2.-1 $. you have a single "oint of failure.1.0 rod!ction e !er of the d!a grou". there is a %ay around having your "ass%ord sho% u" in the "rocess status out"ut# )on't s"ecify connection infor ation %hile at the O23 "ro "t.

control files.issue connect co ands for the target and catalog./-.0. All rights reserved.01&&))&1020% connected to recovery catalog data+ase $t doesn't atter %hether you connect to the target or the catalog first. res"ectively0 J #man RMAN> conn ct catalo" #mancat!#mancat$%EK& RMAN> conn ct ta#" t ! $ssuing connect co ands fro users can vie% the # "assword authentication $f you are using a "ass%ord file. and !acku" "ieces# RMAN does not !ack u" the online redo logs# .1. the net%ork connection to the target is use of a net service na e for !oth connections# ade as sho%n in the follo%ing e&a "le# Note the %ithin RMAN "revents any "ass%ords fro a""earing in the "rocess list %here other O23 client-#c> #man ta#" t sys!"oo+5$AKI& catalo" #mancat!#mancat$%EK& Recovery Manager: Release 10. as long as you connect to !oth !efore issuing any other RMAN co ands# +ackups This section "rovides a series of RMAN and korn shell scri"ts that illustrate !acking u" a data!ase and its se"arate co "onents# RMAN can !ack u" datafiles.-1 $. connected to target data+ase: A. archived redo files.0 rod!ction "o#yright $c% 1&&'( 200)( *racle.2.

"erfor s verification checks.5+ORR(.A+.45+ORR(.RMAN. as "art of its default !acku" !ehavior.T$ON vie%s# *or a data!ase to !e !acked u" it must be in mount or open mode# The data!ase needs to at least !e in !ecause RMAN needs to access the target data!ase control file !efore "erfor ing a !acku"# ount ode. and then logs any detected corru"tion# 4ou can onitor "otential corru"tion !y querying the =F.T$ON and =F+O. the data!ase needs to !e shut do%n and restarted in ount ode# The data!ase does not have to !e . touches each datafile !lock. Full %atabase O&&line +ackup *or offline !acku"s.(.

!o#a'd+<t's<s's<p(/ F alter data+ase o#en= 8*5 eIit 'e've used the for at "ara eter in !oth e&a "les to "rovide a s"ecific location and unique na e for the !acku" "ieces# $f the for at "ara eter is not archivelog ode# ounts it.up data*as +o#mat (!u)&!o#acl !d*!AKI&!*c.1 oracle d+a <)&111&20 oraBd3'<1&1'H'2Bs<&Bs1 -rK-r----.!o#a'd+<t's<s's<p(/ alt # data*as op n/ EOF 45t 6 . BC!*5n!*as? #man ta#" t ! catalo" #mancat!#mancat$%EK& DDEOF s?utdo3n 5mm d5at / sta#tup mount/ *ac.1 OO8*5 sh!tdoKn immediate= start!# mo!nt= #un E allocat c?ann l d& typ d5s.!#man'o++l5n . the !acku" "ieces %ill !e directed to FORA+7:5@OM:2d!s# Full %atabase Online +ackup *or online !acku"s.-14+ck> J ls -l -rK-r----. the data!ase is o"en for use and can !e fairly si "le0 BC!*5n!*as? #man ta#" t ! catalo" #mancat!#mancat$%EK& DDEOF *ac.!o#a'd+<t's<s's<p(/ EOF ust !e in archivelog ode# $f you're using Oracle4356.up data*as +o#mat (!u)&!o#acl !d*!AKI&!*c. and o"ens it0 @ere's a shell scri"t for an Oracle4356 data!ase that shuts do%n the data!ase. !acks it u"./ *ac.1 oracle d+a 1012<'2 oraBc3c-1&&))&1020-200)0&21-02 -rK-r----. the synta& .*as? The follo%ing files are created0 J cd 4!014oracle4d+4A.1 oracle d+a 1<21222H) oraBd3'<1&1'H'2Bs)0Bs1 @ere's the shell scri"t for Oracle7 DN4+in4+ash rman target 4 catalog rmancat4rmancat@68.up data*as +o#mat (!u)&!o#acl !d*!AKI&!*c.

the synta& can !e fairly si "le0 RMAN> *ac.up ta*l spac syst mG us #s 5nclud cu## nt cont#ol+5l +o#mat (!u)&!o#acl !d*!AKI&!*c. RMAN does not "ut ta!les"aces in !acku" ode# No e&tra redo is generated# *or high-transaction data!ases.A+.!o#a'd+<t's<s's<p(/ and0 Once again.up data*as +o#mat (!u)&!o#acl !d*!AKI&!*c. the synta& is a !it different %ith res"ect to the runGH co #un E allocat c?ann l d& typ d5s. note that %ith Oracle9i.45t (nlike traditional online (hot) !acku"s./ *ac. note that %ith Oracle7i. this can lead to significant resource savings# Again.up ta*l spac syst m +o#mat (!u)&!o#acl !d*!AKI&!*c.p #ontrol Files A nice feature of OracleBi is its a!ility to configure the control file to !e !acked u" auto atically %henever you issue a !acku" co and# 4ou can do this !y using the configure co and as follo%s0 Reset to )efaults RMAN> CONFI%URE CONTROLFILE AUTOBACKUP FOR.!o#a'd+<t's<s's<p(/ F 8*5 eIit +ackin$ . on0 RMAN> CONFI%URE CONTROLFILE AUTOBACKUP ON/ old RMAN con3ig!ration #arameters: "*N5-67R8 "*N9R*:5-:8 A79*/A"./ *ac.7 *55= neK RMAN con3ig!ration #arameters: CONFI%URE CONTROLFILE AUTOBACKUP ON/ neK RMAN con3ig!ration #arameters are s!ccess3!lly stored starting 3!ll resync o3 recovery catalog .p a Tablespace The a!ility to s"ecify only a su!set of ta!les"aces in a !acku" o"eration can add fle&i!ility to your !acku" strategy# *or OracleBi.!o#a'd+<t's<s's<p(/ F +ackin$ .1 OO8*5 #un E allocat c?ann l d& typ d5s. the synta& is a !it different %ith res"ect to the runGH co DN4+in4+ash and0 rman target 4 catalog rmancat4rmancat@68.AT FOR DE7ICE T0PE DISK CLEAR/ con3ig!ration #arameters are s!ccess3!lly reset to de3a!lt val!e 3et +ONTRO7*$7: A(TO.(.

up a#c?52 lo" all/ Another OracleBi technique is to use the !acku" co and's "lus archivelog clause to include the archive redo log files as "art of a !acku"# This creates at least t%o !acku" "ieces. this is called compression# $f there are unused or un odified !locks in a datafile. you should allo% RMAN to re ove the necessary# -ncremental +ackups One of the ost i "ressive features of RMAN is its a!ility to "erfor incre ental !acku"s# Recall that %ith traditional file!ased !acku"s -.p Archived Redo *o$ Files 'ith OracleBi. 9* A4!014oracle4d+4A.!o#a'c+<F.-14+ck4o#a'c+cH&IIJJIK)L)H9))J)I9KH)K.7 5*RMA9 5*R .AT FOR DE7ICE T0PE DISK TO (!u)&!o#acl !d*!AKI&!*c.-14+ck4oraBc3C5. the control files or the o"tional recovery catalog %ill not !e a%are that they are no longer accessi!le# +onsequently.up data*as plus a#c?52 lo"/ $f you have a non-RMAN "rocess re ove the redo log files.conA= neK RMAN con3ig!ration #arameters are s!ccess3!lly stored starting 3!ll resync o3 recovery catalog 3!ll resync com#lete No% !acku" a ta!les"ace and %atch the logging out"ut for the saved controlfile RMAN> +ack!# ta+les#ace !sers 3ormat A4!014oracle4d+4A. the synta& for !acking u" archived redo log files is fairly si "le0 RMAN> *ac.8?-"8 9. 8 .all !locks in a data!ase datafile are co"ied.-14+ck4rmanBCsBCtBCd. %hether they have !een used or not# RMAN has the a!ility to detect %hich !locks in a datafile have changed since the last !acku" and %ill co"y only those odified !locks# 'hen RMAN co"ies only the odified !locks during a !acku". RMAN %ill ski" those !locks# 3ki""ing un odified !locks gives RMAN a !ig advantage over file-!ased !acku"s in that the resources required to do a .+ckA= @tarting "ontrol 5ile A!to+ack!# at 21-@8 -0) #iece handle04!014oracle4d+4A.-@. and one for the archived redo log files0 RMAN> *ac.con(/ neK RMAN con3ig!ration #arameters: "*N5-67R8 "*N9R*:5-:8 A79*/A". you %ould have to "eriodically issue the co and0 RMAN> c?an" a#c?52 lo" all 2al5dat / fro the filesyste %hen they are no longer Therefore.such as hot or cold -.3!ll resync com#lete RMAN> CONFI%URE CONTROLFILE AUTOBACKUP FOR. one for the datafiles.con comment0N*N8 5inished "ontrol 5ile A!to+ack!# at 21-@8 -0) +ackin$ .

and not necessarily to the si1e of the data!ase# *or very large data!ases. this eans that the !acku" ti e and ta"e2disk s"ace required correlates to the nu !er of changes ade to the data!ase. you %ill !ack u" !locks that have changed since the "revious level > !acku"# )ifferential !acku"s are the default incre ental !acku" ode# $f you take an incre ental !acku" higher than level A. if you take a level > cu ulative !acku". RMAN auto atically creates a level A !acku"# A cu ulative incre ental !acku" instructs RMAN to !ack u" !locks that have changed since level n-> or lo%er# *or e&a "le. and no "rior level A e&ists. if you take a level > differential !acku". this alone can necessitate the use of RMAN# Much of the no enclature around incre ental !acku"s contains the ter level# The !asic idea !ehind RMAN level-!ased !acku"s is to !ack u" only !locks that have !een odified since the "revious !acku"# $ncre ental !acku"s can !e a""lied to the data!ase. and therefore. they cannot !e used as a !asis %hen a""lying incre ental !acku"s during a recovery o"eration# A full!acku" is the default !acku" ty"e if no incre ental level is s"ecified# 'hy all the choices/ A differential !acku" takes less s"ace and ti e to "erfor !ut requires ore ti e to restore# $t follo%s that a cu ulative !acku" takes ore s"ace and ti e to "erfor !ut less ti e to restore# 3o it !eco es a tradeoff issue8 do you %ant to ini i1e your !acku" ti e or ini i1e your restore ti e/ 'e "refer to ini i1e our restore ti e. ta!les"aces.acku" RMAN> *ac.differential and cu ulative# A differential incre ental !acku" tells RMAN to !ack u" !locks that have changed since level n or lo%er# *or e&a "le.up 5nc# m ntal l 2 l J cumulat52 data*as / odified since 0alidatin$ backups One nice feature of RMAN is the a!ility to re"ort on the status of !acku"s# The si "lest %ay to vie% !acku" infor ation is via the list !acku" co and# 0iew +ackup -n&ormation .up 5nc# m ntal l 2 l ) data*as / @ere's an OracleBi cu ulative !acku" e&a "le in %hich you tell RMAN to !ack u" all !locks that have !een the ost recent level E or lo%er !acku"# RMAN> *ac. RMAN %ill !ack u" !locks that have changed since the ost recent level A !acku"# A full !acku" !acks u" the e&act sa e !locks as alevel A# The difference !et%een a full !acku" and a level !acku" is that a full!acku" is not kno%n to any su!sequent incre ental !acku"s# Therefore. or datafiles# Oracle refers to this usage of levels as a ultilevel incre ental !acku"# These levels can range fro level A to a a&i u of level D# There are t%o flavors of incre ental !acku"s -. %e reco end daily RMAN level A !acku"s# 7evel A . %e use cu ulative !acku"s# *or s all data!ases.!acku" or restore can !e considera!ly less# Additionally.

up 2al5dat data*as a#c?52 lo" all/ R/ segs ------.------------1 21&200 @.d+3 Recover' Methods .-14sys4A.RMAN> l5st *ac.---------.d+3 4!014oracle4d+4A.@A7F ) 10<0) 7@8R@ ' 21&2H) 9A/ H 21&2H) -.d+3 4!014oracle4d+4A.@98M 2 20)200 7N.-1B!ndo1.-14sys4A.-1Bta+.-1Bsys1.-14idI4A.d+3 4!014oracle4d+4A.d+3 4!014oracle4d+4A.-+ytes 9a+les#ace ---.-1B!sers1.-1Bsysa!I1.F -s +ackup restorable ? RMAN also has a %ay to verify %hether the !acku" files are restora!le# 4ou acco "lish this !y issuing the restore data!ase validate co and# This co and doesn't actually restore any datafiles.ata3ile Name ------------------4!014oracle4d+4A. it 6ust validates that the contents of the !acku" sets can !e restored if necessary# The follo%ing e&a "le %orks %ith !oth Oracle9i and OracleBi0 RMAN> #un E allocat c?ann l d& typ d5s.d+3 4!014oracle4d+4A.up/ 0iew Schema RMAN> # po#t sc? ma/ Re#ort o3 data+ase schema 5ile .-1BidI1.* < 21&200 @.-14sys4A.8@ N* N* N* N* .-14!sr4A.-14ta+4A.8@ ./ # sto# data*as 2al5dat / F 0alidate +ackup 4ou can run a test RMAN !acku" that does not generate any out"ut# The test checks datafiles for "hysical and logical corru"tion and that all data!ase files e&ist and are in the correct locations# *or e&a "le0 RMAN> *ac.

$n general there are three ste"s involved in restoring files0 .

you have to recover it first# $ssue the 3TART(. or 3erver Manager (Oracle9i only)# Restorin$ and Recoverin$ All %ata&iles $n this scenario. !ecause RMAN needs to !e a!le to access the control file to deter ine %hich !acku" sets are necessary to recover the data!ase# $f the control file isn't availa!le. done for e&a "le %ith +ack!# data+ase #l!s archivelog= 4our first ste" is to ake sure that the target data!ase is shut do%n0 @M:> conn ct sys!. it is assu ed that your control files are still accessi!le# 4ou have a !acku". MO(NT co and sho%n in the follo%ing e&a "le to ount the data!ase0 @M:> sta#tup mount/ *racle instance started. this %ill !e ount ode# $f datafiles that don't !elong to the 343T:M ta!les"ace are da aged.. this %ill !e no ount ode# $f the entire data!ase needs to !e restored. as S0SDBA/ @M:> s?utdo3n a*o#t/ *RA":8 instance sh!t doKn. . 3I7J. you connect to the target data!ase0 ust use RMAN to restore the datafiles# To use RMAN.># :nsure that the target data!ase is started in the a""ro"riate ode for the restoration o"eration# *or lost control files. you have the o"tion of kee"ing the data!ase o"en and taking only the ta!les"ace(s)2datafile(s) that needs to !e restored offline# C# 3tart RMAN and connect to the target and recovery catalog if one is !eing used# E# Run the a""ro"riate RMAN R:3TOR: co and to !ring !ack required files# The requested files and the a""ro"riate archived redo log files %ill !e restored# Once the necessary files are restored. you need to start u" your target data!ase in ount ode# RMAN cannot restore datafiles unless the data!ase is at least in ount ode. 3ince !acku" set files are created in an RMAN-s"ecific for at.lus.. you need to recover your data!ase and o"en it for use# 4ou can recover the data!ase fro either RMAN. Ne&t.

you can use 3I7J. done for e&a "le %ith +ack!# data+ase #l!s archivelog= ./A= @M:> recover data+ase= @M:> alter data+ase o#en= ands need to !e enclosed !y the runGH co and0 ode0 Restorin$ Speci&ic Tablespaces3%ata&iles $n this scenario. as @.J #man ta#" t ! catalo" #mancat!#mancat$%EK& The re ainder of this e&a "le sho%s ho% to restore all of the datafiles of the target data!ase# RMAN %ill go to its last good !acku" set and restore the datafiles to the state they %ere in %hen that !acku" set %as created# 'hen restoring data!ase files %ith OracleBi.lus to recover the data!ase and o"en it for use0 J sGl#l!s 4nolog @M:> connect sys4. R:3TOR:. it is assu ed that your control files are still accessi!le# 4ou have a !acku". you can use the default channel RMAN> # sto# data*as / RMAN> # co2 # data*as / RMAN> alt # data*as op n/ *or Oracle7i. and R:+O=:R co RMAN> r!n P allocate channel d1 ty#e disk= restore data+ase= recover data+ase= Q alter data+ase o#en= Or alternatively. the A77O+AT:.@. RMAN reads the datafile header and akes the deter ination as to %hether the file needs to !e restored# The recovery is done !y allocating a channel for $2O and then issuing the RMAN restore data!ase co and# 'ith Oracle4i.. once RMAN has restored the datafiles. you don't need to allocate a channel e&"licitly# $nstead..

-14ta+4A.d+3A RMAN> recover data3ile A4!014oracle4d+4A. and !ring the ta!les"ace2datafile online# $f you cannot take the ta!les"ace2datafile offline.-1Bta+.-1Bta+. it is assu ed that your control files are !acked u"# 4ou have a !acku". done for e&a "le %ith +ack!# data+ase #l!s archivelog= . recover the ta!les"ace2datafile. then shutdo%n a!ort the data!ase and restore in ount ode# *irst try to take the Ta!les"ace offline8 sGl#l!s Lsys4managase as sysd+aL @M:> alter ta+les#ace ta+ o33line= J #man ta#" t ! catalo" #mancat!#mancat$%EK& RMAN> # sto# ta*l spac ta*/ RMAN> # co2 # ta*l spac ta*/ @M:> alt # ta*l spac ta* op n/ $f this fails0 @M:> conn ct sys!..d+3A Restorin$ #ontrol Files $n this scenario. restore the ta!les"ace2datafile. as S0SDBA/ @M:> s?utdo3n a*o#t/ @M:> sta#tup mount/ J #man ta#" t ! catalo" #mancat!#mancat$%EK& RMAN> # sto# ta*l spac ta*/ RMAN> # co2 # ta*l spac ta*/ @M:> alt # data*as op n/ $nstead of a ta!les"ace. you can restore and recover a s"ecific datafile0 RMAN> restore data3ile A4!014oracle4d+4A.-14ta+4A.Take the ta!les"ace2datafile that needs recovery offline..

if you are not using a catalog. as S0SDBA/ @M:> s?utdo3n a*o#t/ @M:> sta#tup nomount/ J #man ta#" t ! catalo" #mancat!#mancat$%EK& RMAN> # sto# cont#ol+5l / RMAN> alt # data*as mount/ RMAN> alt # data*as op n/ $f this fails %ith ### RMAN-00'11: 00000000000000000000000000000000000000000000000000000000000 RMAN-00'H&: 000000000000000 8RR*R M8@@A68 @9A". and you lose all control files.ut if so ething catastro"hic ha""ens. 5*::*R@ 000000000000000 RMAN-00'11: 00000000000000000000000000000000000000000000000000000000000 RMAN-0<002: 3ail!re o3 alter d+ command at 0&4224200) 10:<1:'2 *RA-01'2&: m!st !se R8@89:*6@ or N*R8@89:*6@ o#tion 3or data+ase o#en ### then you ust "erfor a recover data!ase0 @M:> s?utdo3n a*o#t/ @M:> sta#tup mount/ J #man ta#" t ! catalo" #mancat!#mancat$%EK& RMAN> # co2 # data*as / . here's the si "lest OracleBi synta& for restoring a control file0 @M:> conn ct sys!. here are the ste"s for getting the !ack0 'ith OracleBi. you can still restore the control file if you have used RMAN's auto!acku" feature to !ack it u" %ith each !acku" that you do# The follo%ing e&a "les assu e that you are using a catalog# *irst..$n an ideal %orld you'll never use RMAN to restore a control file# ..

done for e&a "le %ith !acku" data!ase "lus archivelog8 sGl#l!s Lsys4manager as sysd+aL @M:> s?utdo3n a*o#t/ @M:> sta#tup nomount/ J #man ta#" t ! catalo" #mancat!#mancat$%EK& RMAN> # sto# cont#ol+5l / RMAN> alt # data*as mount/ RMAN> # sto# data*as / RMAM> # co2 # data*as / RMAN-00'11: RMAN-00'H&: RMAN-00'11: RMAN-0<002: RMAN-0H0'): 00000000000000000000000000000000000000000000000000000000000 000000000000000 8RR*R M8@@A68 @9A". "erfor Time8+ased or #han$e8+ased -ncomplete Recover' $nco "lete recovery uses a !acku" to "roduce a noncurrent version of the data!ase# $n other %ords. you do not a""ly all of the redo records generated after the ost recent !acku"# .RMAN> alt # data*as op n # s tlo"s/ a full !ack as soon as "ossi!le# Note. that all offline archivelogs are no% useless. "erfor Restorin$ Online Redolo$s $n this scenario. that all offline archivelogs are no% useless. it is assu ed that your control files are !acked u"# 4ou have a !acku". co "lete recovery is not "ossi!le# O"en the data!ase %ith resetlogs to continue# RMAN> alt # data*as op n # s tlo"s/ a full !ack as soon as "ossi!le# Note. 5*::*R@ 000000000000000 00000000000000000000000000000000000000000000000000000000000 3ail!re o3 recover command at 0&4224200) 11:0<:2< media recovery reG!esting !nknoKn log: thread 1 seG 1 loKscn 2))2)1) 3ince the online logs %ere lost.

up/ ands. sho%n ne&t# 'hat files require a !acku" no% )eter ines %hether a !acku" set and its related "ieces still e&ist on edia# $f a !acku" "iece e&ists in the location recorded in the control file of the target data!ase or in the o"tional recovery catalog. for e&a "le. @M:> alt # data*as op n # s tlo"s/ Maintenance #ommands RMAN has a fe% RMAN> # po#t n aintenance co d *ac. *ac. a data!ase %ith a ne% strea of log sequence nu !ers starting %ith log sequence ># sGl#l!s Lsys4manager as sysd+aL @M:> s?utdo3n a*o#t/ @M:> sta#tup mount/ J #man ta#" t ! catalo" #mancat!#mancat$%EK& RMAN> # sto# data*as / @M:> # co2 # data*as unt5l t5m (9))JH)IH9IM&)M8-M))(/ media recovery com#lete. you ust restore all datafiles fro !acku"s created "rior to the ti e to %hich you %ant to recover and then o"en the data!ase %ith the R:3:T7O<3 o"tion %hen recovery co "letes# The R:3:T7O<3 o"eration creates a ne% incarnation of the data!ase8 in other %ords.up/ . its status RMAN> c#ossc? c. a user inadvertently dro"s a ta!le# 4ou cannot "erfor co "lete recovery !ecause an archived redo log is issing# 4ou lose your current control file and ust use a !acku" control file to o"en the data!ase# To "erfor inco "lete edia recovery.4ou usually "erfor o o o o inco "lete recovery of the %hole data!ase in the follo%ing situations0 Media failure destroys so e or all of the online redo logs# A user error causes data loss.

%ould require a""lication of t%o days (or ore) %orth of archived redo log files0 To generate the sa e re"ort !ut only for 343T:M ta!les"ace datafiles0 To list !acku"s considered o!solete Re"orts on all unrecovera!le datafiles RMAN> c# at catalo"/ RMAN> d#op catalo"/ RMAN> # po#t n data*as / d *ac. !acku"s are flagged as :K. this co and deletes the "hysical files *ac. if restored. it is arked as :K. and re oves their infor ation fro the o"tional recovery catalog (if one is used)# $n Oracle9i and OracleBi.$R:) !acku"s re oves their infor ation fro the control file and fro the o"tional recovery catalog (if one is used)# +reate Recovery +atalog# )ro"s all o!6ects associated %ith the recovery catalog sche a# To re"ort on those datafiles that.up days 9 ta*l spac syst m/ RMAN> # po#t o*sol t / RMAN> # po#t un# co2 #a*l / .7:# $f it is not at the s"ecified location.$R:) if they cannot !e found at their recorded location# )eletion of arked as A=A$7A.up o+ data*as / *or OracleBi. u"dates their status in the control file.up days 9 RMAN> # po#t n d *ac.$R:)# RMAN> d l t RMAN> d l t 4p5# d *ac.up o+ data*as / associated %ith !acku" sets and datafile co"ies.