Backup in Oracle 5hysi!aloptions a!kups
Cold 6off-line7
/ull da'a ase only #e3uire do*n'i-e Do no' pro(ide fle,i ili'y for poin' in 'i-e re!o(ery 65iT#7
Differen' s!opes8 full da'a ase, 'a lespa!e6s7 or da'afile6s7 Do no' re3uire da'a ase do*n'i-e Can
e used 'o re!o(er full da'a ase, single2-ul'iple 'a lespa!e6s72da'afile6s7 or a !orrup'ed lo!k e re!o(ered 'o any poin' in 'i-e *i'hin assu-ed a!kup re'en'ion period
Da'a ase !an
Backup options in Oracle (2
Logi!al
a!kups
a!kup granulari'y
Logi!al !opy of da'a in 'he da'a ase :uppor' for differen' Can
e 'aken ei'her *i'h lega!y +,por'2.-por' 'ools or *i'h Da'a 5u-p 6;0g7
:'and y sys'e-s 6Da'a Guard7
5hysi!al and logi!al s'and y da'a ases
!ow hot "ackups are possi"le#
Server proc. DBWR
Db file Db file Db file
"ra!le :e!ure Ba!kup
@ery ne* and pro a ly no' ye' relia le enough
RMAN &onfiguration
#$%& !an
e pre!onfigured
Configura'ion is s'ored in 'he !on'rol file and in 'he re!o(ery
!a'alog 6if used7
Can fa!ili'a'e
a!kup au'o-a'ion
$os' useful se''ings8
Setting Retention policy Device type Default device type &ackup optimi'ation Channel device type Maxsetsi'e Default to redundancy disk parallelism to disk off none unlimited ### Recommended on to recovery !indo! of " days disk$sbt prallelism % ### to sbt off sbt parms()###* depends on your database si'e
Controlfile autobackup off
LCG 3D Workshop, Bologna, June 2007 - ;2
RMAN &onfiguration (2 +,a-ple8
configure RETENTION POLICY TO RECOVERY WINDOW OF 31 DAYS; configure DEFAULT DEVICE TYPE TO ' !"'; configure DEVICE TYPE ' !"' PARALLELIS# $; configure C%ANNEL DEVICE TYPE & !"' ()r* +'ENV+ ,TDPO-OPTFILE+.o("."i/o0i." *.c0ien".or)c0e.!in."1(o2o("3'; configure DEVICE TYPE DIS4 PARALLELIS# $; configure #A5SETSI6E TO $77 8; configure )rc9i/e0og !)c:u( co(ie for 1e/ice ";(e ' !"' "o 1;
configure con"ro0fi0e )u"o!)c:u( on;
The S%OW ALL !o--and lis's all #$%& !onfigura'ion se''ings To !lear a gi(en se''ings append CLEAR a' 'he end of 'he
CONFI8URE !o--and
RMAN "ackup strategies
#$%& allo*s -any 'ypes of .' possi le 'o
a!kup s'ra'egy8 le(el 0 a!kups A le(el ; a!kups 6!u-ula'i(e and2or differen'ial7 and ar!hi(elog a!kups in e'*een) a!kup as !opy of 'he *hole da'a ase A in!re-en'al a!kups used 'o upda'e 'he !opy A ar!hi(ed redo logs)
.n!re-en'ally upda'ed da'a ase !opy8 ;
Backup strategy used at Tier'
Bo'h "ra!le-re!o--ended s'ra'egies i-ple-en'ed for all
produ!'ion sys'e-s
Ba!kups go 'o 'apes Weekly or
.n!re-en'al
a!kup s'ra'egy8
i*eekly le(el 0 a!kups 6depending on 'he DB siBe7 a!kup in e'*een a!kups
Backup operations at Tier' Cen'ral -a!hine 'o s!hedule and run all 'he
a!kups
Cen'ral #$%& !a'alog e,por'ed on regular +,a-ples of #$%& !o--ands
asis
eing used8
run + crosscheck archivelog all, backup force tag )some_tag-.T/ incremental level . check logical database force format /0d-0T-01-lvl.T/ plus archivelog format /0d-0T-01-lvl.Tarch/, delete noprompt force archivelog all completed before 2sysdate 3 %4, 5 run + crosscheck archivelog all, backup tag )some_tag- D/ incremental level database format /0d-0T-01-lvl D/ plus archivelog format /0d-0T-01-lvl Darch/, delete noprompt force archivelog all completed before )sysdate 6 %*, 5
Backup operations at Tier' (2
run + backup tag )some_tag-AR/ archivelog all format /0d-0T-01-arch/, delete noprompt force archivelog all completed before )sysdate 3 %*, 5
run + backup maxsetsi'e %.789 tag / D&-Copy-tag/ device type disk incremental level for recover of copy !ith tag )D&-Copy-tag* database, recover device type disk copy of database !ith tag D&-Copy-tag until time )sysdate 3% ), delete force noprompt backupset device type disk tag D&-Copy-tag completed before )sysdate 3%*, 5
&o(plete data"ase recovery &eeded *hen8
%ll da'afiles are los' or 'he :C:T+$ 'a lespa!e da'afiles are los' %' leas' one -e- er of ea!h redo log group sur(i(ed
startup mount run + allocate channel c device type disk$sbt, allocate channel c% device type disk$sbt, restore database check readonly, recover database, alter database open, 5
&eeded *hen8 )ata"ase point%in%ti(e recovery
all da'afiles are los' %ll !opies of 'he !urren' !on'rol file are los' "r all online redo log group -e- ers are los'
The -os' 'ypi!al re!o(ery in !ase of sys'e-s i-ple-en'ing :%$+ approa!h .f done af'er a disas'er i' has 'o
1ard*are !onfigura'ion ": and "ra!le sof'*are ins'alla'ion #e-!rea'ion or res'ore fro- non-#$%&
e pre!eded y8
o'her i-por'an' !onfigura'ion files
a!kup of lis'ener)ora, 'nsna-es)ora and
%:$ ins'an!e and diskgroup !onfigura'ion 6if needed7 $$L ins'alla'ion and !onfigura'ion )))
set dbid(xxxxxxx startup nomount, run + allocate channel c device type disk$sbt, restore spfile to )some_location* from autobackup, recover database, alter database open resetlogs, 5 shutdo!n immediate, startup nomount, run + allocate channel c device type disk$sbt, restore controlfile from autobackup, alter database mount, 5 run + set until time ( 4to-date:/%73A193%..; ..<..<../=/dd3mon3yyyy hh%7<mi<ss/>4, allocate channel c device type disk$sbt, allocate channel c% device type disk$sbt, restore database check readonly, recover database, alter database open resetlogs, 5
Ta"lespace point%in%ti(e recovery
&eeded
$ainly 'o address a hu-an error
"ra!le -akes effor's 'o au'o-a'e i'
Can
e done *i'h fe* !li!ks in "+$
#e3uires
5oin' in 'i-e re!o(ery of 'he *hole da'a ase
6an au,iliary ins'an!e is !rea'ed7
+,por'2i-por' of sele!'ed 'a lespa!es s!he-as
or o Ee!'s
Block (edia &eeded *hen8 recovery
Da'a ase repor's ei'her single or -ul'i
lo!k !orrup'ion
Can
e done *i'h an open da'a ase lo!ks are no'
"nly 'he 'a le6s7 !on'aining !orrup'ed
a(aila le
Da'a ase !orrup'ions !an Corrup'ed
e dis!o(ered *i'h #$%& !)c:u( /)0i1)"e 1)")!) e !o--and lo!ks !an e found in @FD%T%B%:+GBL"C?GC"##05T."&
@RA3. A8B< @RACCD data block corrupted :file E ?= block E 77> @RA3. .< data file ?< )d<ForacleForadataFdataFmydb-maintbs-. #dbf* run + allocate channel c device type disk$sbt, blockrecover datafile ? block 77, 5
*ingle+(ultiple &eeded *hen datafile+ta"lespace recovery
:ingle2-ul'iple 'a lespa!es or da'afiles ha(e :C:T+$ 'a lespa!e is in'a!' Con'rolfiles and online redo logs are in'a!'
een los'
#e3uires
To pu' offline da'afiles and 'a lespa!es The da'a ase !an
eing re!o(ered
e open and a(aila le 'o users
run + sGl 2alter tablespace users offlineH, allocate channel c device type disk$sbt, restore tablespace users, recover tablespace users, sGl 2alter tablespace users onlineH, 5
More info Oracle Database 10g RMAN
Backup & Recovery ( y $a'he* 1ar' and #o er' G) /ree-an7
"ra!le Do!u-en'a'ion
Backup and Recovery Basics Backup and Recovery Advanced