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

Oracle Database 11g:

Administration Workshop II
Volume III Student Guide
D50079GC20
Edition 2.0
September 2010
D62545
Oracle Internal & Oracle cadem! "#e Onl!
Copyright !"1"# Oracle and$or its a%%iliates& All rights reser'ed&
Disclaimer
$%i# doc&ment contain# proprietar! in'ormation and i# protected b! cop!ri(%t and
ot%er intellect&al propert! la)#. *o& ma! cop! and print t%i# doc&ment #olel! 'or !o&r
o)n &#e in an Oracle trainin( co&r#e. $%e doc&ment ma! not be modi'ied or altered in
an! )a!. E+cept )%ere !o&r &#e con#tit&te# ,'air &#e, &nder cop!ri(%t la)- !o& ma!
not &#e- #%are- do)nload- &pload- cop!- print- di#pla!- per'orm- reprod&ce- p&bli#%-
licen#e- po#t- tran#mit- or di#trib&te t%i# doc&ment in )%ole or in part )it%o&t t%e
e+pre## a&t%ori.ation o' Oracle.
$%e in'ormation contained in t%i# doc&ment i# #&b/ect to c%an(e )it%o&t notice. I' !o&
'ind an! problem# in t%e doc&ment- plea#e report t%em in )ritin( to0 Oracle "ni1er#it!-
500 Oracle 2ar3)a!- 4ed)ood S%ore#- Cali'ornia 94065 "S. $%i# doc&ment i# not
)arranted to be error5'ree.
(estricted (ights )otice
I' t%i# doc&mentation i# deli1ered to t%e "nited State# Go1ernment or an!one &#in(
t%e doc&mentation on be%al' o' t%e "nited State# Go1ernment- t%e 'ollo)in( notice i#
applicable0
".S. GO6E478E7$ 4IG9$S
$%e ".S. Go1ernment:# ri(%t# to &#e- modi'!- reprod&ce- relea#e- per'orm- di#pla!- or
di#clo#e t%e#e trainin( material# are re#tricted b! t%e term# o' t%e applicable Oracle
licen#e a(reement and;or t%e applicable ".S. Go1ernment contract.
*rademark )otice
Oracle and <a1a are re(i#tered trademar3# o' Oracle and;or it# a''iliate#. Ot%er name#
ma! be trademar3# o' t%eir re#pecti1e o)ner#.
Author
Maria Billings
Technical Contributors
and Reviewers
Christian Bauwens
Yanti Chang
Timothy Chien
Joe Fong
Andy Fortunak
Gerlinde Frenzen
Mark Fuller
Peter Fusek
Joel Goodman
Vimala Jaco
!omini"ue Jeunot
Pete Jones
Fukue #awae
!onna #eesling
$ean #im
Achiel %angers
Gwen %azeny
Jerry %ee
!eidre Matishak
Bill Millar
%akshmi &ara'arreddi
(ra $inger
)anir $ingh
James $'iller
Matt Taylor
Branisla* Valny
Jean+Francois Verrier
Editors
&ita Pa*itran
)a, #umar
Graphic Designer
$atish Bettegowda
Publisher
Jayanthy #esha*amurthy
Oracle Internal & Oracle cadem! "#e Onl!
iii
Contents
I Introduction
Co&r#e Ob/ecti1e# I52
S&((e#ted Sc%ed&le I5=
Oracle Databa#e 11g0 >g? Stand# 'or Grid I54
Grid In'ra#tr&ct&re 'or Sin(le5In#tance I56
Co&r#e E+ample#0 94 Sample Sc%ema I5@
1 Core Concepts and *ools o% the Oracle Database
Ob/ecti1e# 152
7amin( t%e Core Component# o' an Oracle Databa#e Ser1er 15=
Oracle Databa#e Ser1er rc%itect&re O1er1ie) 154
In#tance5Databa#e Con'i(&ration# 156
7amin( t%e 8emor! Str&ct&re# o' an Oracle Databa#e In#tance 157
Oracle Databa#e 8emor! Str&ct&re# 15@
2roce## rc%itect&re 1510
2roce## Str&ct&re# 1511
ddin( 2roce## 7ame# 151=
2roce## Start&p SeA&ence 1514
Databa#e Stora(e rc%itect&re 1515
Bo(ical and 2%!#ical Databa#e Str&ct&re# 1517
&tomatic Stora(e 8ana(ement 1519
S8 Stora(e Component# 1520
S8 In#tance 1521
DC Con'i(&ration $ool# 152=
8ana(ement Drame)or3 and 4elated DC $ool# 1525
Dacilitatin( Databa#e 8ana(ement )it% Oracle 4e#tart 1526
7ote#0 Dacilitatin( Databa#e 8ana(ement )it% Oracle 4e#tart 1527
E&i. 152@
S&mmar! 1529
! Con%iguring %or (eco'erability
Ob/ecti1e# 252
2&rpo#e o' Cac3&p and 4eco1er! D&nctionalit! 25=
$!pical Cac3&p and 4eco1er! $a#3# 254
Oracle Cac3&p and 4eco1er! Sol&tion# 255
Oracle Internal & Oracle cadem! "#e Onl!
i'
Oracle Cac3&p Sol&tion# 256
$erminolo(! 4e1ie) 257
F%at *o& lread! Gno)0 Oracle5S&((e#ted Cac3&p 259
"#in( 4eco1er! 8ana(er 2510
$!pe# o' 487 Command# 2511
<ob Command#0 E+ample 2512
Con'i(&rin( *o&r Databa#e 'or Cac3&p and 4eco1er! Operation# 251=
ARCHIVELOG 8ode 2514
Con'i(&rin( ARCHIVELOG 8ode 2515
Con'i(&rin( rc%i1e Bo( De#tination# 2516
G&aranteein( rc%i1e Bo( S&cce## 2517
Speci'!in( a 4etention 2olic! 2519
4eco1er! Findo) 4etention 2olic!0 E+ample 2521
"#in( a Da#t 4eco1er! rea 2522
De'inin( a Da#t 4eco1er! rea 2524
Da#t 4eco1er! rea Space 8ana(ement 2525
Da#t 4eco1er! rea Space "#a(e 2527
F%at I# Done &tomaticall! 'or *o& 2529
8onitorin( t%e D4 25=0
Cene'it# o' "#in( a Da#t 4eco1er! rea 25=1
E&i. 25=2
S&mmar! 25=4
2ractice 2 O1er1ie)0 Con'i(&rin( 'or 4eco1erabilit! 25=5
+ ,sing the (-A) (eco'ery Catalog
Ob/ecti1e# =52
487 4epo#itor! Data Stora(e0 Compari#on o' Option# =5=
Storin( In'ormation in t%e 4eco1er! Catalo( =54
4ea#on# to "#e a 4eco1er! Catalo( =55
Creatin( t%e 4eco1er! Catalo(0 $%ree Step# =56
Con'i(&rin( t%e 4eco1er! Catalo( Databa#e =57
Creatin( t%e 4eco1er! Catalo( O)ner =5@
Creatin( t%e 4eco1er! Catalo( =59
8ana(in( $ar(et Databa#e 4ecord# in t%e 4eco1er! Catalo( =510
4e(i#terin( a Databa#e in t%e 4eco1er! Catalo( =511
"#in( Enterpri#e 8ana(er to 4e(i#ter a Databa#e =512
"nre(i#terin( a $ar(et Databa#e 'rom t%e 4eco1er! Catalo( =51=
Catalo(in( dditional Cac3&p Dile# =514
4eco1er! Catalo( 4e#!nc%roni.ation0 Concept# =516
8an&all! 4e#!nc%roni.in( t%e 4eco1er! Catalo( =517
"#in( 487 Stored Script# =51@
Oracle Internal & Oracle cadem! "#e Onl!
'
E+ec&tin( 487 Stored Script# =519
8aintainin( 487 Stored Script# =520
Cac3in( "p t%e 4eco1er! Catalo( =521
4e5Creatin( an "nreco1erable 4eco1er! Catalo( =522
E+portin( and Importin( t%e 4eco1er! Catalo( =52=
"p(radin( and Droppin( t%e 4eco1er! Catalo( =524
IMPORT CATALOG Command =525
Creatin( and "#in( 6irt&al 2ri1ate Catalo(# =527
"#in( 487 6irt&al 2ri1ate Catalo(# =52@
4eco1er! Catalo(# S&mmar! =5=0
E&i. =5=2
S&mmar! =5=4
2ractice = O1er1ie)0 "#in( t%e 487 4eco1er! Catalo( =5=5
. Con%iguring /ackup Settings
Ob/ecti1e# 452
Con'i(&rin( 2er#i#tent Settin(# 'or 487 45=
6ie)in( 2er#i#tent Settin(# 454
Control Dile &tobac3&p# 455
8ana(in( 2er#i#tent Settin(# 457
"#in( a 8edia 8ana(er 45@
Speci'!in( a Cac3&p De#tination 4510
Con'i(&rin( and llocatin( C%annel# 4511
Creatin( D&ple+ed Cac3&p Set# 4512
Creatin( D&ple+ed Cac3&p Set# "#in( CONFIGURE BACKUP COPIES 451=
Cac3&p Optimi.ation 4514
Sa1in( Cac3&p Space )it% "n&#ed Cloc3 Compre##ion 4516
Compre##in( Cac3&p# 4517
"#in( 487 Cac3&p Compre##ion 451@
Encr!ptin( Cac3&p# 4519
E&i. 4520
S&mmar! 4522
2ractice 4 O1er1ie)0 Con'i(&rin( Cac3&p Speci'ication# 452=
0 Creating /ackups 1ith (-A)
Ob/ecti1e# 552
Creatin( Cac3&p Set# 55=
Creatin( Ima(e Copie# 554
Creatin( a F%ole Databa#e Cac3&p 556
487 Cac3&p $!pe# 55@
Da#t Incremental Cac3&p 5510
Oracle Internal & Oracle cadem! "#e Onl!
'i
Enablin( Da#t Incremental Cac3&p 5511
8onitorin( Cloc3 C%an(e $rac3in( 5512
2er'ormin( 2ro+! Copie# 551=
Creatin( D&ple+ed Cac3&p Set# "#in( BACKUP COPIES 5514
Creatin( Cac3&p# o' Cac3&p Set# 5515
Cac3in( "p 4ead5Onl! $able#pace# 5516
Con'i(&rin( Cac3&p and 4e#tore 'or 6er! Bar(e Dile# 5517
Creatin( 487 8&lti#ection Cac3&p# 551@
rc%i1al Cac3&p#0 Concept# 5519
Creatin( rc%i1al Cac3&p# )it% E8 5521
Creatin( rc%i1al Cac3&p# )it% 487 5522
8ana(in( rc%i1al Databa#e Cac3&p# 552=
Cac3in( "p 4eco1er! Dile# 5524
8ana(in( Cac3&p#0 4eportin( 5525
8ana(in( Cac3&p#0 D!namic 2er'ormance 6ie)# 5527
"#in( Enterpri#e 8ana(er to 6ie) Cac3&p 4eport# 552@
8ana(in( Cac3&p#0 Cro##5C%ec3in( and Deletin( 5529
E&i. 55=0
S&mmar! 55=2
2ractice 5 O1er1ie)0 Creatin( Cac3&p# 55==
2 (estore and (eco'ery *asks
Ob/ecti1e# 652
4e#torin( and 4eco1erin( 65=
Ca&#e# o' Dile Bo## 654
Critical 6er#&# 7oncritical 655
&tomatic $emp'ile 4eco1er! 656
Bo( Gro&p Stat&#0 4e1ie) 657
4eco1erin( 'rom t%e Bo## o' a 4edo Bo( Gro&p 65@
Clearin( a Bo( Dile 659
4eco1erin( 'rom a Bo#t Inde+ $able#pace 6510
4e5Creatin( Inde+e# 6511
&t%entication 8et%od# 'or Databa#e dmini#trator# 651=
4e5creatin( a 2a##)ord &t%entication Dile 6514
Comparin( Complete and Incomplete 4eco1er! 6516
Complete 4eco1er! 2roce## 6517
2oint5in5$ime 4eco1er! 2roce## 651@
4eco1erin( a 4ead5Onl! $able#pace 6520
4eco1erin( NOLOGGING Databa#e Ob/ect# 6521
4eco1erin( 'rom t%e Bo## o' ll Control Dile Copie#0 O1er1ie) 6522
4eco1erin( t%e Control Dile to t%e De'a&lt Bocation 652=
Oracle Internal & Oracle cadem! "#e Onl!
'ii
E&i. 6524
S&mmar! 6526
3 ,sing (-A) to 4er%orm (eco'ery
Ob/ecti1e# 752
"#in( 487 4ES$O4E and 4ECO6E4 Command# 75=
2er'ormin( Complete 4eco1er!0 Bo## o' a 7oncritical Data Dile in ARCHIVELOG
8ode 754
2er'ormin( Complete 4eco1er!0 Bo## o' a S!#tem5Critical Data Dile in ARCHIVELOG
8ode 755
4eco1erin( Ima(e Copie# 756
4eco1erin( Ima(e Copie#0 E+ample 757
2er'ormin( a Da#t S)itc% to Ima(e Copie# 75@
"#in( SET NEWNAME 'or S)itc%in( Dile# 759
S&b#tit&tion 6ariable# 'or SET NEWNAME 7510
2er'ormin( 4e#tore and 4eco1er! o' a Databa#e in NOARCHIVELOG 8ode 7511
"#in( 4e#tore 2oint# 7512
2er'ormin( 2oint5in5$ime 4eco1er! 751=
2er'ormin( 4eco1er! )it% a Cac3&p Control Dile 7515
4eco1er! 'rom Bo## o' Ser1er 2arameter Dile 7516
4e#torin( t%e Ser1er 2arameter Dile 'rom t%e Control Dile &tobac3&p 7517
4e#torin( t%e Control Dile 'rom &tobac3&p 751@
"#in( Incremental Cac3&p# to 4eco1er a Databa#e in NOARCHIVELOG 8ode 7520
4e#torin( and 4eco1erin( t%e Databa#e on a 7e) 9o#t 7521
2reparin( to 4e#tore t%e Databa#e to a 7e) 9o#t 7522
4e#torin( t%e Databa#e to a 7e) 9o#t 752=
2er'ormin( Di#a#ter 4eco1er! 7527
E&i. 7529
S&mmar! 75=1
2ractice 7 O1er1ie)0 "#in( 487 to 2er'orm 4eco1er! 75=2
5 -onitoring and *uning (-A)
Ob/ecti1e# @52
2aralleli.ation o' Cac3&p Set# @5=
8onitorin( 487 Se##ion# @55
8onitorin( 487 <ob 2ro(re## @57
Interpretin( 487 8e##a(e O&tp&t @59
"#in( t%e DEBUG Option @510
Interpretin( 487 Error Stac3# @511
$&nin( 487 @512
Oracle Internal & Oracle cadem! "#e Onl!
'iii
487 8&ltiple+in( @514
llocatin( Di#3 C&''er#0 E+ample @515
llocatin( $ape C&''er# @516
Comparin( S!nc%rono&# and #!nc%rono&# I;O @51@
8onitorin( 487 <ob 2er'ormance @520
#!nc%rono&# I;O Cottlenec3# @521
S!nc%rono&# I;O Cottlenec3# @522
C%annel $&nin( @52=
$&nin( t%e BACKUP Command @525
$&nin( 487 Cac3&p 2er'ormance @527
Settin( LARGE_POOL_SIZE @52@
$&nin( 487 $ape Streamin( 2er'ormance Cottlenec3# @529
E&i. @5=1
S&mmar! @5==
2ractice @ O1er1ie)0 8onitorin( and $&nin( 487 @5=4
6 Diagnosing the Database
Ob/ecti1e# 952
Data 4eco1er! d1i#or 95=
Data Dail&re# 956
Data Dail&re0 E+ample# 957
Data 4eco1er! d1i#or 487 Command5Bine Inter'ace 95@
Bi#tin( Data Dail&re# 959
d1i#in( on 4epair 9511
E+ec&tin( 4epair# 9512
Cla##i'!in( Hand Clo#in(I Dail&re# 951=
Data 4eco1er! d1i#or 6ie)# 9514
Ce#t 2ractice0 2roacti1e C%ec3# 9515
F%at I# Cloc3 Corr&ptionJ 9516
Cloc3 Corr&ption S!mptom#0 ORA-01578 9517
9o) to 9andle Corr&ption 951@
Settin( 2arameter# to Detect Corr&ption 9519
Cloc3 8edia 4eco1er! 9521
2rereA&i#ite# 'or Cloc3 8edia 4eco1er! 9522
$%e RECOVER...BLOCK Command 952=
&tomatic Dia(no#tic For3'lo) 9524
&tomatic Dia(no#tic 4epo#itor! 9525
$%e D4 Command5Bine $ool HD4CII 9526
$%e VDIAG_INFO 6ie) 9527
Bocation 'or Dia(no#tic $race# 952@
Oracle Internal & Oracle cadem! "#e Onl!
i7
9ealt% 8onitor0 O1er1ie) 9529
4&nnin( 9ealt% C%ec3# 8an&all!0 2B;SEB E+ample 95=0
6ie)in( 98 4eport# "#in( t%e D4CI "tilit! 95=1
E&i. 95=2
S&mmar! 95=6
2ractice 9 O1er1ie)0 Dia(no#in( t%e Databa#e 95=7
1" ,sing 8lashback *echnology I
Ob/ecti1e# 1052
Dla#%bac3 $ec%nolo(! 105=
$ran#action# and "ndo 1054
G&aranteein( "ndo 4etention 1055
2reparin( *o&r Databa#e 'or Dla#%bac3 1056
"#in( Dla#%bac3 $ec%nolo(! to E&er! Data 105@
Dla#%bac3 E&er! 1059
Dla#%bac3 E&er!0 E+ample 10510
Dla#%bac3 6er#ion E&er! 10511
Dla#%bac3 6er#ion E&er!0 Con#ideration# 10512
E&i. 1051=
Dla#%bac3 $able0 O1er1ie) 10515
Dla#%bac3 $able 10516
Enablin( 4o) 8o1ement on a $able 10517
2er'ormin( Dla#%bac3 $able 1051@
Dla#%bac3 $able0 Con#ideration# 10519
E&i. 10520
Dla#%bac3 $ran#action E&er! 10521
"#in( Enterpri#e 8ana(er to 2er'orm Dla#%bac3 $ran#action E&er! 10522
Dla#%bac3 $ran#action E&er!0 Con#ideration# 1052=
Dla#%bac3 $ran#action 10524
2rereA&i#ite# 10525
Dla#%in( Cac3 a $ran#action 10526
2o##ible For3'lo) 10527
Dla#%bac3 $ran#action Fi.ard 1052@
C%oo#in( Ot%er Cac35o&t Option# 10529
Dinal Step# Fit%o&t E8 105=1
E&i. 105=2
S&mmar! 105==
2ractice 10 O1er1ie)0 2er'ormin( Dla#%bac3 $ran#action Cac3o&t 105=4
Oracle Internal & Oracle cadem! "#e Onl!
7
11 ,sing 8lashback *echnology II
Ob/ecti1e# 1152
Oracle $otal 4ecall O1er1ie) 115=
Set&p 2roce## 1154
9o) $otal 4ecall For3# 1155
Oracle $otal 4ecall Scenario 1156
$ran#parent Sc%ema E1ol&tion 115@
D&ll Sc%ema E1ol&tion 1159
4e#triction# 11510
G&ideline# 11511
6ie)in( Dla#%bac3 Data rc%i1e# 11512
E&i. 1151=
Dla#%bac3 Drop and t%e 4ec!cle Cin 11515
4ec!cle Cin 11516
4e#torin( $able# 'rom t%e 4ec!cle Cin 1151@
4ec!cle Cin0 &tomatic Space 4eclamation 11519
4ec!cle Cin0 8an&al Space 4eclamation 11520
C!pa##in( t%e 4ec!cle Cin 11521
E&er!in( t%e 4ec!cle Cin 11522
E&i. 1152=
S&mmar! 11524
2ractice 11 O1er1ie)0 "#in( Dla#%bac3 $ec%nolo(! 11525
1! 4er%orming 8lashback Database
Ob/ecti1e# 1252
Dla#%bac3 Databa#e 125=
Dla#%bac3 Databa#e rc%itect&re 1254
Con'i(&rin( Dla#%bac3 Databa#e 1255
F%at *o& 7eed to Do 1256
Dla#%bac3 Databa#e0 E+ample# 1257
Dla#%bac3 Databa#e Con#ideration# 125@
8onitorin( Dla#%bac3 Databa#e 1259
8onitorin( Dla#%bac3 Databa#e )it% E8 12511
G&aranteed 4e#tore 2oint# 12512
Dla#%bac3 Databa#e and G&aranteed 4e#tore 2oint# 1251=
E&i. 12515
S&mmar! 12517
2ractice 12 O1er1ie)0 For3in( )it% Dla#%bac3 Databa#e 1251@
Oracle Internal & Oracle cadem! "#e Onl!
7i
1+ -anaging -emory
Ob/ecti1e# 1=52
8emor! 8ana(ement0 O1er1ie) 1=5=
4e1ie)in( Oracle Databa#e 8emor! Str&ct&re# 1=54
C&''er Cac%e 1=56
"#in( 8&ltiple C&''er 2ool# 1=5@
S%ared 2ool 1=510
Bar(e 2ool 1=511
<a1a 2ool and Stream# 2ool 1=512
4edo Bo( C&''er 1=51=
&tomatic 8emor! 8ana(ement0 O1er1ie) 1=514
Oracle Databa#e 8emor! 2arameter# 1=515
8onitorin( &tomatic 8emor! 8ana(ement 1=516
E''icient 8emor! "#a(e0 G&ideline# 1=51@
8emor! $&nin( G&ideline# 'or t%e Bibrar! Cac%e 1=520
&tomatic S%ared 8emor! 8ana(ement0 O1er1ie) 1=522
9o) S88 For3# 1=52=
Enablin( &tomatic S%ared 8emor! 8ana(ement 1=524
Di#ablin( S88 1=525
2ro(ram Global rea H2GI 1=526
"#in( t%e VPARAMETER 6ie) 1=52@
E&i. 1=529
S&mmar! 1=5=0
2ractice 1= O1er1ie)0 "#in( 88 to Correct a 8emor! llocation 2roblem 1=5=1
1. -anaging Database 4er%ormance
Ob/ecti1e# 1452
$&nin( cti1itie# 145=
2er'ormance 2lannin( 1454
In#tance $&nin( 1456
2er'ormance $&nin( 8et%odolo(! 1457
2er'ormance 8onitorin( 145@
2er'ormance $&nin( Data 1459
Optimi.er Stati#tic# Collection 14510
Stati#tic 2re'erence#0 O1er1ie) 14512
"#in( Stati#tic 2re'erence# 1451=
Settin( Global 2re'erence# )it% Enterpri#e 8ana(er 14514
Oracle Fait E1ent# 14515
In#tance Stati#tic# 14516
8onitorin( Se##ion 2er'ormance 1451@
Di#pla!in( Se##ion54elated Stati#tic# 14519
Oracle Internal & Oracle cadem! "#e Onl!
7ii
Di#pla!in( Ser1ice54elated Stati#tic# 14520
$ro&ble#%ootin( and $&nin( 6ie)# 14521
Dictionar! 6ie)# 14522
&tomatic For3load 4epo#itor! 1452=
"#in( &tomatic For3load 4epo#itor! 6ie)# 14525
4eal pplication $e#tin( O1er1ie)0 Databa#e 4epla! 14526
$%e Ci( 2ict&re 14527
E&i. 1452@
S&mmar! 14529
2ractice 14 O1er1ie)0 8onitorin( In#tance 2er'ormance 145=0
10 -anaging 4er%ormance by S9: *uning
Ob/ecti1e# 1552
SEB $&nin( 155=
SEB d1i#or# 1554
&tomatic SEB $&nin( 4e#&lt# 1555
Implement &tomatic $&nin( 4ecommendation# 1556
SEB $&nin( d1i#or0 O1er1ie) 1557
"#in( t%e SEB $&nin( d1i#or 155@
SEB $&nin( d1i#or Option# 1559
SEB $&nin( d1i#or 4ecommendation# 15510
"#in( t%e SEB $&nin( d1i#or0 E+ample 15511
D&plicate SEB 15512
SEB cce## d1i#or0 O1er1ie) 1551=
$!pical SEB cce## d1i#or Se##ion 15514
For3load So&rce 15515
4ecommendation Option# 15516
4e1ie)in( 4ecommendation# 1551@
SEB 2er'ormance nal!.er0 O1er1ie) 15519
SEB 2er'ormance nal!.er0 "#e Ca#e# 15520
"#in( SEB 2er'ormance nal!.er 15521
E&i. 15522
S&mmar! 15526
2ractice 15 O1er1ie)0 8ana(in( 2er'ormance b! SEB $&nin( 15527
12 -anaging (esources
Ob/ecti1e# 1652
Databa#e 4e#o&rce 8ana(er0 O1er1ie) 165=
Databa#e 4e#o&rce 8ana(er0 Concept# 1654
F%! "#e 4e#o&rce 8ana(er 1655
De'a&lt 8aintenance 4e#o&rce 8ana(er 2lan 1657
Oracle Internal & Oracle cadem! "#e Onl!
7iii
E+ample0 DEFAULT_PLAN 165@
2otential For3 Dlo) 1659
Speci'!in( 4e#o&rce 2lan Directi1e# 16511
4e#o&rce llocation 8et%od# 'or 4e#o&rce 2lan# 16512
Compari#on o' EMPHASIS and RATIO 1651=
cti1e Se##ion 2ool 8ec%ani#m 16515
Settin( t%e cti1e Se##ion 2ool 16516
Speci'!in( $%re#%old# 1651@
Settin( Idle $imeo&t# 16519
Bimitin( C2" "tili.ation at t%e Databa#e Be1el 16520
Bimitin( C2" "tili.ation at t%e Ser1er Be1el0 In#tance Ca(in( 16522
In#tance Ca(in( E+ample# 1652=
8onitorin( In#tance Ca(in( 16524
4e#o&rce Con#&mer Gro&p 8appin( 16525
cti1atin( a 4e#o&rce 2lan 16527
Databa#e 4e#o&rce 8ana(er In'ormation 1652@
8onitorin( t%e 4e#o&rce 8ana(er 16529
E&i. 165=2
S&mmar! 165==
2ractice 16 O1er1ie)0 "#in( t%e 4e#o&rce 8ana(er 165=4
13 Automating *asks 1ith the Scheduler
Ob/ecti1e# 1752
Simpli'!in( 8ana(ement $a#3# 175=
Core Component# 1754
*o&r Ca#ic For3 Dlo) 1755
E&i. 1757
2er#i#tent Bi(%t)ei(%t <ob# 175@
"#in( a $ime5Ca#ed or E1ent5Ca#ed Sc%ed&le 1759
Creatin( a $ime5Ca#ed <ob 17510
Creatin( an E1ent5Ca#ed Sc%ed&le 17512
Creatin( E1ent5Ca#ed Sc%ed&le# )it% Enterpri#e 8ana(er 1751=
Creatin( an E1ent5Ca#ed <ob 17514
E1ent5Ca#ed Sc%ed&lin( 17515
Creatin( Comple+ Sc%ed&le# 17517
E&i. 1751@
"#in( Email 7oti'ication 17519
ddin( and 4emo1in( Email 7oti'ication# 17520
Creatin( <ob C%ain# 17521
E+ample o' a C%ain 1752=
d1anced Sc%ed&ler Concept# 17524
Oracle Internal & Oracle cadem! "#e Onl!
7i'
<ob Cla##e# 17525
Findo)# 17527
2rioriti.in( <ob# Fit%in a Findo) 1752@
Creatin( a <ob rra! 17529
E&i. 175=1
Creatin( a Dile Fatc%er and an E1ent5Ca#ed <ob 175=2
Enablin( Dile rri1al E1ent# 'rom 4emote S!#tem# 175=4
Sc%ed&lin( 4emote Databa#e <ob# 175=5
Creatin( 4emote Databa#e <ob# 175=6
Sc%ed&lin( 8&ltiple De#tination <ob# 175=7
6ie)in( Sc%ed&ler 8eta Data 175=@
E&i. 17540
S&mmar! 17541
2ractice 17 O1er1ie)0 &tomatin( $a#3# )it% t%e Sc%ed&ler 17542
15 -anaging Space
Ob/ecti1e# 1@52
Space 8ana(ement0 O1er1ie) 1@5=
Cloc3 Space 8ana(ement 1@54
4o) C%ainin( and 8i(ration 1@55
E&i. 1@57
Dree Space 8ana(ement Fit%in Se(ment# 1@5@
$!pe# o' Se(ment# 1@59
llocatin( E+tent# 1@510
llocatin( Space 1@511
Creatin( $able# Fit%o&t Se(ment# 1@512
Controllin( De'erred Se(ment Creation 1@51=
4e#triction# and E+ception# 1@514
dditional &tomatic D&nctionalit! 1@515
E&i. 1@516
$able Compre##ion0 O1er1ie) 1@517
Compre##ion 'or Direct52at% In#ert Operation# 1@51@
OB$2 Compre##ion 'or D8B Operation# 1@520
Speci'!in( $able Compre##ion 1@521
"#in( t%e Compre##ion d1i#or 1@522
"#in( t%e DBMS_COMPRESSION 2ac3a(e 1@52=
Compre##in( $able Data 1@524
2roacti1e $able#pace 8onitorin( 1@525
$%re#%old# and 4e#ol1in( Space 2roblem# 1@526
8onitorin( $able#pace Space "#a(e 1@527
S%rin3in( Se(ment# 1@52@
Oracle Internal & Oracle cadem! "#e Onl!
7'
4e#&lt# o' S%rin3 Operation 1@529
4eclaimin( Space Fit%in SS8 Se(ment# 1@5=0
Se(ment d1i#or0 O1er1ie) 1@5=1
Se(ment d1i#or 1@5=2
Implementin( 4ecommendation# 1@5==
&tomatic Se(ment d1i#or 1@5=4
8an&al Se(ment S%rin3 "#in( E8 1@5=5
S%rin3in( Se(ment# "#in( SEB 1@5=6
8ana(in( 4e#&mable Space llocation 1@5=7
"#in( 4e#&mable Space llocation 1@5=@
4e#&min( S&#pended Statement# 1@540
F%at Operation# re 4e#&mableJ 1@542
E&i. 1@54=
S&mmar! 1@544
2ractice 1@ O1er1ie)0 8ana(in( Stora(e 1@545
16 -anaging Space %or the Database
Ob/ecti1e# 1952
Databa#e Stora(e 195=
S&pportin( 45GC Sector Di#3# 1954
"#in( 45GC Sector Di#3# 1955
Speci'!in( t%e Di#3 Sector Si.e 1956
E&i. 1957
$ran#portin( $able#pace# 19510
Concept0 8inim&m Compatibilit! Be1el 19511
8inim&m Compatibilit! Be1el 19512
$ran#portable $able#pace 2roced&re 1951=
Determinin( t%e Endian Dormat o' a 2lat'orm 19514
"#in( t%e 487 CONVERT Command 19516
$ran#portable $able#pace# )it% Enterpri#e 8ana(er 19517
$ran#portin( Databa#e# 19520
Databa#e $ran#portation 2roced&re0 So&rce S!#tem Con1er#ion 19521
Databa#e $ran#portation 2roced&re0 $ar(et S!#tem Con1er#ion 19522
Databa#e $ran#portation0 Con#ideration# 1952=
E&i. 19524
S&mmar! 19525
2ractice 19 O1er1ie)0 8ana(in( Space 'or t%e Databa#e 19526
Oracle Internal & Oracle cadem! "#e Onl!
7'i
!" Duplicating a Database
Ob/ecti1e# 2052
"#in( a D&plicate Databa#e 205=
C%oo#in( Databa#e D&plication $ec%niA&e# 2054
D&plicatin( an cti1e Databa#e 2055
D&plicatin( a Databa#e )it% a $ar(et Connection 2056
D&plicatin( a Databa#e )it% 4eco1er! Catalo( Fit%o&t $ar(et Connection 2057
D&plicatin( a Databa#e Fit%o&t 4eco1er! Catalo( or $ar(et Connection 205@
Creatin( a Cac3&p5Ca#ed D&plicate Databa#e 2059
Creatin( an Initiali.ation 2arameter Dile 'or t%e &+iliar! In#tance 20510
Speci'!in( 7e) 7ame# 'or *o&r De#tination 20511
"#in( t%e SET NEWNAME Cla&#e# 20512
S&b#tit&tion 6ariable# 'or SET NEWNAME 2051=
Speci'!in( 2arameter# 'or Dile 7amin( 20514
Startin( t%e In#tance in NOMOUNT 8ode 20516
En#&rin( $%at Cac3&p# and rc%i1ed 4edo Bo( Dile# re 1ailable 20517
llocatin( &+iliar! C%annel# 2051@
"nder#tandin( t%e 487 D&plication Operation 20519
Speci'!in( Option# 'or t%e DUPLICATE Command 20521
"#in( dditional DUPLICATE Command Option# 20522
"#in( E8 to Clone a Databa#e 2052=
E&i. 20524
S&mmar! 20525
2ractice 20 O1er1ie)0 D&plicatin( a Databa#e 20526
Appendi7 A: 4ractices and Solutions
Appendi7 /: 4er%orming *ablespace 4oint;in;*ime (eco'ery
Ob/ecti1e# C52
$able#pace 2oint5in5$ime 4eco1er! H$S2I$4I0 Concept# C5=
$able#pace 2oint5in5$ime 4eco1er! H$S2I$4I0 $erminolo(! C54
$able#pace 2oint5in5$ime 4eco1er!0 rc%itect&re C55
F%en to "#e $S2I$4 C57
2reparin( 'or $S2I$4 C5@
Determinin( t%e Correct $ar(et $ime C59
Determinin( t%e $able#pace# 'or t%e 4eco1er! Set C510
Identi'!in( 4elation#%ip# $%at Span 4eco1er! Set Co&ndarie# C511
Identi'!in( Ob/ect# $%at Fill Ce Bo#t C512
2er'ormin( Ca#ic 487 $S2I$4 C51=
2er'ormin( D&ll! &tomated $S2I$4 C514
Oracle Internal & Oracle cadem! "#e Onl!
7'ii
"#in( Ima(e Copie# 'or Da#ter $S2I$4 2er'ormance C515
"#in( Enterpri#e 8ana(er to 2er'orm $S2I$4 C516
487 $S2I$4 2roce##in( C517
2er'ormin( 487 $S2I$4 )it% an 48758ana(ed &+iliar! In#tance C519
2er'ormin( 487 $S2I$4 "#in( *o&r O)n &+iliar! In#tance C520
$ro&ble#%ootin( 487 $S2I$4 C521
S&mmar! C522
Appendi7 C: 4er%orming ,ser;-anaged /ackup and (eco'ery
Ob/ecti1e# C52
$!pe# o' Cac3&p and 4eco1er! 2ractice# C5=
2er'ormin( a "#er58ana(ed Cac3&p o' t%e Databa#e C54
$%e 7eed 'or Cac3&p 8ode C55
Identi'!in( Dile# to 8an&all! Cac3&p C56
8an&all! Cac3in( "p a NOARCHIVELOG Databa#e C57
8an&all! Cac3in( "p an ARCHIVELOG Databa#e C5@
Cac3in( "p t%e Control Dile C59
2er'ormin( "#er58ana(ed Complete Databa#e 4eco1er!0 O1er1ie) C510
2er'ormin( Complete Clo#ed Databa#e 4eco1er!0 O1er1ie) C511
Identi'!in( 4eco1er!54elated Dile# C512
4e#torin( 4eco1er!54elated Dile# C51=
ppl!in( 4edo Data C515
2er'ormin( Complete Open Databa#e 4eco1er! C516
2er'ormin( "#er58ana(ed Incomplete 4eco1er!0 O1er1ie) C51@
C%oo#in( an Incomplete 4eco1er! 8et%od C519
2er'ormin( "#er58ana(ed Incomplete 4eco1er! C520
2er'ormin( "#er58ana(ed Incomplete 4eco1er!0 Step# C522
"#er58ana(ed $ime5Ca#ed 4eco1er!0 E+ample C52=
"#er58ana(ed Cancel5Ca#ed 4eco1er!0 E+ample C525
S&mmar! C527
Appendi7 D: -anaging the AS- Instance
Ob/ecti1e# D52
S8 Cene'it# 'or dmini#trator# D5=
S8 In#tance D54
S8 Component#0 S8 In#tanceK2rimar! 2roce##e# D56
S8 In#tance Initiali.ation 2arameter# D57
Interaction Cet)een Databa#e In#tance# and S8 D59
S8 In#tance0 D!namic 2er'ormance 6ie)# D510
S8 S!#tem 2ri1ile(e# D511
"#in( Enterpri#e 8ana(er to 8ana(e S8 "#er# D512
Oracle Internal & Oracle cadem! "#e Onl!
7'iii
Startin( and Stoppin( S8 In#tance# "#in( SEBL2l&# D51=
Startin( and Stoppin( S8 In#tance# "#in( !"#$%& D515
Startin( and Stoppin( S8 In#tance# "#in( '!($() D516
Di#3 Gro&p O1er1ie) D517
S8 Di#3# D51@
llocation "nit# D519
S8 Dile# D520
E+tent 8ap# D521
Stripin( Gran&larit! D522
Dine Grained Stripin( D52=
S8 Dail&re Gro&p# D525
Stripe and 8irror E+ample D526
Dail&re E+ample D527
8ana(in( Di#3 Gro&p# D52@
Creatin( and Droppin( Di#3 Gro&p# "#in( SEBL2l&# D529
ddin( Di#3# to Di#3 Gro&p# D5=0
8i#cellaneo&# ALTER Command# D5=1
S8 8ana(ement "#in( Enterpri#e 8ana(er D5=2
S8 Di#3 Gro&p Compatibilit! D5==
S8 Di#3 Gro&p ttrib&te# D5=5
"#in( Enterpri#e 8ana(er to Edit Di#3 Gro&p ttrib&te# D5=6
4etrie1in( S8 8etadata D5=7
S8 Da#t 8irror 4e#!nc O1er1ie) D5=@
S&mmar! D5=9
Oracle Internal & Oracle cadem! "#e Onl!
Appendi7 A
4ractices and Solutions
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; !
*able o% Contents
Practices -or %esson . ///////////////////////////////////////////////////////////////////////////////////////////////////////// 0
Practice .+12 )e*iewing the !ataase Architecture /////////////////////////////////////////////// 3
Practices -or %esson 1 ///////////////////////////////////////////////////////////////////////////////////////////////////////// 4
Practice 1+.2 Con-iguring A)C5(V6%7G Mode ////////////////////////////////////////////////// 4
Practice 1+12 )esizing the Flash )eco*ery Area ///////////////////////////////////////////////////// 8
Practice 1+92 Veri-ying the Backu' !estination /////////////////////////////////////////////////// .1
Practice 1+02 Con-iguring the )etention Policy //////////////////////////////////////////////////// .3
Practices -or %esson 9 /////////////////////////////////////////////////////////////////////////////////////////////////////// .4
Practice 9+.2 Creating a )eco*ery Catalog /////////////////////////////////////////////////////////// .4
Practice 9+12 Creating the )eco*ery Catalog 7wner //////////////////////////////////////////// 10
Practice 9+92 Creating the )eco*ery Catalog //////////////////////////////////////////////////////// 13
Practice 9+02 )egistering a !ataase in the )eco*ery Catalog ///////////////////////////// 14
Practice 9+32 Backing u' the )eco*ery Catalog /////////////////////////////////////////////////// 1:
Practices -or %esson 0 /////////////////////////////////////////////////////////////////////////////////////////////////////// 99
Practice 0+.2 $etting the !ate and Time Format -or )MA& //////////////////////////////// 99
Practice 0+12 6naling Control File Autoacku' ////////////////////////////////////////////////// 93
Practice 0+92 Con-iguring !e*ices -or Backu' ///////////////////////////////////////////////////// 9;
Practices -or %esson 3 /////////////////////////////////////////////////////////////////////////////////////////////////////// 9:
Practice 3+.2 Creating Fast (ncremental Backu's ///////////////////////////////////////////////// 9:
Practice 3+12 Cross+Checking Backu's ///////////////////////////////////////////////////////////////// 01
Practice 3+92 %isting Backu' Files and Creating Archi*al Backu' ////////////////////// 0;
Practices -or %esson 4 /////////////////////////////////////////////////////////////////////////////////////////////////////// 38
Practice 4+.2 Backing u' the !ataase ///////////////////////////////////////////////////////////////// 38
Practice 4+12 )eco*ering -rom the %oss o- a !ata File ///////////////////////////////////////// 4.
Practice 4+92 )eco*ering -rom the %oss o- all Control Files //////////////////////////////// 44
Practice 4+02 )eco*ering -rom the %oss o- a )edo %og Grou' //////////////////////////// ;.
Practices -or %esson ; /////////////////////////////////////////////////////////////////////////////////////////////////////// ;3
Practice ;+.2 )eco*ering (mage Co'ies //////////////////////////////////////////////////////////////// ;3
Practice ;+12 Per-orming Fast )eco*ery /////////////////////////////////////////////////////////////// 89
Practices -or %esson 8 /////////////////////////////////////////////////////////////////////////////////////////////////////// :<
Practice 8+.2 Monitoring )MA& Jos ////////////////////////////////////////////////////////////////// :<
Practices -or %esson : /////////////////////////////////////////////////////////////////////////////////////////////////////// :9
Practice :+.2 !iagnostic $cenario ///////////////////////////////////////////////////////////////////////// :0
Practice :+12 )e'airing Block Corru'tion ////////////////////////////////////////////////////////// .<:
Practices -or %esson .< /////////////////////////////////////////////////////////////////////////////////////////////////// ..4
Practice .<+.2 Flashack Transaction Backout /////////////////////////////////////////////////// ..;
Practices -or %esson .. /////////////////////////////////////////////////////////////////////////////////////////////////// ..8
Practice ..+.2 =sing Flashack !ata Archi*e //////////////////////////////////////////////////// ..:
Practice ..+12 =sing the )ecycle Bin ///////////////////////////////////////////////////////////////// .99
Practices -or %esson .1 /////////////////////////////////////////////////////////////////////////////////////////////////// .98
Practice .1+.2 Flashack !ataase ///////////////////////////////////////////////////////////////////// .9:
Practices -or %esson .9 /////////////////////////////////////////////////////////////////////////////////////////////////// .04
Practice .9+.2 =sing Automatic Memory Management ///////////////////////////////////// .0;
Practices -or %esson .0 /////////////////////////////////////////////////////////////////////////////////////////////////// .44
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; +
Practice .0+.2 Monitoring $er*ices //////////////////////////////////////////////////////////////////// .44
Practices -or %esson .3 /////////////////////////////////////////////////////////////////////////////////////////////////// .;0
Practice .3+.2 =sing Automatic $>% Tuning ///////////////////////////////////////////////////// .;3
Practices -or %esson .4 /////////////////////////////////////////////////////////////////////////////////////////////////// .:3
Practice .4+.2 Managing )esources //////////////////////////////////////////////////////////////////// .:4
Practices -or %esson .; /////////////////////////////////////////////////////////////////////////////////////////////////// 1.9
Practice .;+.2 Creating $cheduler Com'onents ///////////////////////////////////////////////// 1.0
Practice .;+12 Creating %ightweight $cheduler Jos ////////////////////////////////////////// 11;
Practice .;+92 Monitoring the $cheduler //////////////////////////////////////////////////////////// 191
Practices -or %esson .8 /////////////////////////////////////////////////////////////////////////////////////////////////// 10<
Practice .8+.2 Managing $torage //////////////////////////////////////////////////////////////////////// 10.
Practices -or %esson .: /////////////////////////////////////////////////////////////////////////////////////////////////// 13:
Practice .:+.2 Managing $'ace -or the !ataase /////////////////////////////////////////////// 14<
Practices -or %esson 1< /////////////////////////////////////////////////////////////////////////////////////////////////// 14.
Practice 1<+.2 !u'licating a !ataase //////////////////////////////////////////////////////////////// 141
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; .
4ractices %or :esson 1
The 'a'er 'ractices -or this lesson are emedded in the lesson itsel-? to -acilitate
re*iewing the dataase architecture -or yoursel- and in class/ Below are 'ossile answers/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 0
Practice 1-1: Reviewing the Database Architecture
For 'age .+92 Naming the Core Components of an racle Database !erver
.@ The two main com'onents o- a asic 7racle !ataase system2 instance and dataase/
1@ The (nstance consists o- memory structures and ackground 'rocesses/
9@ The three ma,or structures in 7racle !ataase ser*er architecture are2 memory
structures? 'rocess structures and storage structures/
0@ A session is a connection etween the user login and the dataase instance/
3@ The gra'hic on slide .+0 is the answer to the task on slide .+9
For 'age .+;2 Naming the "emor# !tructures of an racle Database
.@ Ahich are the com'onents o- the PGA2 stack s'ace and user gloal area/
1@ &ame the main com'onents o- the $GA2
+ $hared 'ool
+ !ataase u--er cache
+ )edo log u--er
+ %arge 'ool
+ Ja*a 'ool
+ $treams 'ool
+ #ee' u--er 'ool
+ )ecycle u--er 'ool
+ n# u--er 'ool
9@ The gra'hic on slide .+8 is the answer to the task on slide .+;/
For 'age .+.02 Adding Process Names
.@ The !BAn 'rocess writes the dirty u--ers to the data -iles/
1@ The %GA) 'rocess writes the redo entries to the online redo log -iles/
9@ The C#PT 'rocess writes check'oint in-ormation in the control -ile and each data -ile
header/
0@ The $M7& 'rocess 'er-orms reco*ery on instance startu'/
3@ The PM7& 'rocess 'er-orms 'rocess reco*ery when a user 'rocess -ails/
4@ The )6C7 'rocess resol*es in+dout distriuted transactions/
;@ The A)Cn 'rocesses co'y redo log -iles to a designated storage de*ice/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 2
4ractices %or :esson !
General Practice Note2 To reduce clutter in the out'ut? 'roduct anners? s'ace lines and
other re'eating in-ormation is only shown when they -irst a''ear/ %ater? they are
remo*ed to not distract -rom the essence o- a 'ractice/
Practice 2-1: Configuring ARCHIVELOG Mode
(n this 'ractice? you con-igure your dataase to archi*e redo logs e-ore reusing them/
.@ $et u' the en*ironment -or the ORCL dataase? using the oraenv scri't? and enter
orcl when 'rom'ted -or ORACLE_SID/ (- it is already set u' -or orcl Bthat is? you
see orcl in the rackets@? 'ress 6nter/
Note$ This command is a 'eriod? -ollowed y a s'ace? and then the oraenv scri't
name/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
The Oracle base for
ORACLE_HOME=!"#a$$oracle$ro%!c&##'('"%bho)e_# *s
!"#a$$oracle
1@ =se labs as your working directory/ =nless otherwise indicated? always work -rom
that directory/
$ cd ~/labs
9@ !etermine the archi*e mode your dataase is running in now/
$ sqlplus / as sysdba
S+L,-l!s. Release ##'('"'#'" -ro%!c&*on on T!e /!l (# #0.1(.(2
(""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle' All r*4h&s reserve%'
Connec&e% &o.
Oracle Da&abase ##4 En&er$r*se E%*&*on Release ##'('"'#'" 9
-ro%!c&*on
:*&h &he -ar&*&*on*n48 A!&o)a&*c S&ora4e Mana4e)en&8 OLA-8
Da&a M*n*n4 an% Real A$$l*ca&*on Tes&*n4 o$&*ons
S+L; archive log list
Da&abase lo4 )o%e <o Arch*ve Mo%e
A!&o)a&*c arch*val D*sable%
Arch*ve %es&*na&*on =SE_D>_RECO?ER@_AILE_DEST
Ol%es& onl*ne lo4 seB!ence C
C!rren& lo4 seB!ence 7
S+L;
&ote that it is running in <OARCHI?ELOD mode/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 2-1: Configuring ARCHIV!"# Mode $continued%
Oracle Database 11g: Administration Workshop II A ; 3
0@ Because you can change the ARCHI?ELOD mode only when the dataase is
mounted? shut down the dataase/
S+L; shutdown immediate
Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
3@ Mount the dataase/
S+L; startup mount
ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 07#(F2F(" b3&es
A*Ge% S*He #11I1(0 b3&es
?ar*able S*He 112I0"C2( b3&es
Da&abase >!ffers #10(#II(7 b3&es
Re%o >!ffers F2C1IIC b3&es
Da&abase )o!n&e%'
S+L;
4@ Alter the dataase to use ARCHI?ELOD mode/
S+L; alter database archivelog;
Da&abase al&ere%'
S+L;
;@ 7'en the dataase/
S+L; alter database open;
Da&abase al&ere%'
S+L;
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 5
Practice 2-2: Resi&ing the '(ash Recover) Area
(n this 'ractice? you enlarge the Flash )eco*ery Area/
.@ !etermine how ig the Flash )eco*ery Area is now/
S+L; show parameter recovery_file_dest_size
<AME T@-E ?AL=E
999999999999999999999999999999999999 99999999999 9999999999999
%b_recover3_f*le_%es&_s*He b*4 *n&e4er 0"C(M
S+L;
&ote that it is 0<41 MB or 0 GB in size/
1@ 5ow ig could the Flash )eco*ery Area eC
a@ !etermine where the Flash )eco*ery Area is located/
S+L; show parameter recovery_file_dest
<AME T@-E ?AL=E
999999999999999999999999999999999999 99999999999 9999999999999
%b_recover3_f*le_%es& s&r*n4 JARA
%b_recover3_f*le_%es&_s*He b*4 *n&e4er 0"C(
S+L;
&ote that the Flash )eco*ery Area is in the ARA disk grou'/
!o not eDit -rom your $>%EPlus session/
9@ =se the h&&$s.Khos&na)e;.##F7e) =)% to log into 6nter'rise Manager?
as the S@S user with the oracle_0= 'assword? and connect as S@SD>A/
Note$ The -irst time that you are using a newly con-igured machine? you may e asked to
add a security eDce'tion/ The eDact -ormulation and numer o- 'ages de'ends on your
we rowser/ Follow the 'rom'ts and add the eDce'tion in the training en*ironment/
Note %$ Also i- 6nter'rise Manager shows? that the dataase is down? wait a minute and
re-resh the 'age/ BThis can occur due to the time inter*als in which the dataase agent
works/@
0@ 7n the dataase home 'age? click the FA$MGHhostnameI link/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 2-2: Resi&ing the '(ash Recover) Area $continued%
Oracle Database 11g: Administration Workshop II A ; 6
3@ Click the !isk Grou's ta/
4@ (- 'rom'ted -or A$M login credentials? enter s3s as username and oracle_0= as
'assword/ Connect as S@SASM? click J$a*e as Pre-erred CredentialK? and then click
%ogin/
;@ Ahen the disk grou' list a''ears? note the =sale Free column -or the ARA disk
grou'/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 2-2: Resi&ing the '(ash Recover) Area $continued%
Oracle Database 11g: Administration Workshop II A ; 1"
&ote that the ARA disk grou' has enough usale -ree s'ace to enlarge the Flash
)eco*ery Area consideraly? although your dis'layed *alues may e a little di--erent/
8@ Change the Flash )eco*ery Area size to 4 GB/
a@ &a*igate to !ataase I A*ailaility I )eco*ery $ettings and change the Flash
)eco*ery Area $ize to 4 GB/
@ Click $how $>%? and note the $>% that will e run/ This is im'ortant to know
ecause i- the Flash )eco*ery Area is ha*ing sizing 'rolems? you may not e
ale to run 6nter'rise Manager to change it/
ALTER S@STEM SET %b_recover3_f*le_%es&_s*He = C00(0F"200 SCO-E=>OTH
c@ Click )eturn? and then click A''ly/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 2-2: Resi&ing the '(ash Recover) Area $continued%
Oracle Database 11g: Administration Workshop II A ; 11
:@ Veri-y the size o- the Flash )eco*ery Area y using $>%EPlus/ Then eDit your
$>%EPlus session/
S+L; show parameter recovery_file_dest_size
<AME T@-E ?AL=E
999999999999999999999999999999999999 99999999999 9999999999999
%b_recover3_f*le_%es&_s*He b*4 *n&e4er CD
S+L; exit
D*sconnec&e% fro) Oracle Da&abase ##4 En&er$r*se E%*&*on
Release ##'('"'#'" 9 -ro%!c&*on
:*&h &he -ar&*&*on*n48 A!&o)a&*c S&ora4e Mana4e)en&8 OLA-8
Da&a M*n*n4
an% Real A$$l*ca&*on Tes&*n4 o$&*ons
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 1!
Practice 2-*: Verif)ing the +ac,u- Destination
(n this 'ractice? you test the acku' destination to see where acku's are written/
=se the oraenv scri't to ensure you are still using the orcl instance in your terminal
session/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
.@ $tart )MA&/
$ rman target /
Recover3 Mana4er. Release ##'('"'#'" 9 -ro%!c&*on on T!e /!l
(# #0.F(.(" (""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle an%or *&s aff*l*a&es' All
r*4h&s reserve%'
connec&e% &o &ar4e& %a&abase. ORCL 5D>ID=#(("F1F07"6
RMA<;
1@ $ee i- the control -iles are automatically acked u'/
RMA<; show C!"#$%&$' ()"*(C+),;
!s*n4 &ar4e& %a&abase con&rol f*le *ns&ea% of recover3 ca&alo4
RMA< conf*4!ra&*on $ara)e&ers for %a&abase E*&h %b_!n*B!e_na)e
ORCL are.
CO<AID=RE CO<TROLAILE A=TO>ACL=- OAAM N %efa!l&
RMA<;
&ote that automatic acku' is not enaled/
9@ Con-igure )MA& to automatically ack u' the control -ile when any acku's are
done/
RMA<; configure controlfile autobac-up on;
neE RMA< conf*4!ra&*on $ara)e&ers.
CO<AID=RE CO<TROLAILE A=TO>ACL=- O<M
neE RMA< conf*4!ra&*on $ara)e&ers are s!ccessf!ll3 s&ore%
RMA<;
0@ %ist the dataase -iles in your schema? to understand which -ile you ack u' in the
neDt task/
RMA<; report schema;
Re$or& of %a&abase sche)a for %a&abase E*&h %b_!n*B!e_na)e
ORCL
L*s& of -er)anen& Da&af*les
Oracle Internal & Oracle cadem! "#e Onl!
Practice 2-*: Verif)ing the +ac,u- Destination $continued%
Oracle Database 11g: Administration Workshop II A ; 1+
===========================
A*le S*He5M>6 Tables$ace R> se4s Da&af*le <a)e
9999 99999999 99999999999999999999 9999999 9999999999999999999
99999
# C7" S@STEM @ES
JDATAorcl%a&af*les3s&e)'(FC'C2(IF0FFI
( F2" S@SA=O <O
JDATAorcl%a&af*les3sa!G'(FI'C2(IF0FF2
1 #"" =<DOT>S# @ES
JDATAorcl%a&af*le!n%o&bs#'(F7'C2(IF0FC#
0 F =SERS <O
JDATAorcl%a&af*le!sers'(F2'C2(IF0FC#
F #"" EOAM-LE <O
JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
L*s& of Te)$orar3 A*les
=======================
A*le S*He5M>6 Tables$ace MaGs*He5M>6 Te)$f*le <a)e
9999 99999999 99999999999999 99999999999 999999999999999999999
# (7 TEM- 1(ICI JDATAorcl&e)$"#'%bf
RMA<;
Note$ (- you are not connected to the reco*ery catalog? the R> se4s column contains
,,, as a *alue/ (t contains the @ES and <O *alues when you are connected to the
reco*ery catalog/
3@ Ahich tales'ace is stored in -ile 3C
Answer2 The EOAM-LE tales'ace
4@ Take a acku' o- data -ile 3? and note where the acku' is written? then eDit/
RMA<; bac-up datafile .;
S&ar&*n4 bacP!$ a& (#9/=L9"2
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=FF %ev*ce &3$e=DISL
channel ORA_DISL_#. s&ar&*n4 f!ll %a&af*le bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""F
na)e=JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (#9/=L9"2
channel ORA_DISL_#. f*n*she% $*ece # a& (#9/=L9"2
$*ece
han%le=JARAorclbacP!$se&(""2_"I_(#nnn%f"_&a4(""2"I(#&#0F1F
7_"'(C"'C2(7"7712 &a4=TAD(""2"I(#T#0F1F7 co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e.
""."".#F
Oracle Internal & Oracle cadem! "#e Onl!
Practice 2-*: Verif)ing the +ac,u- Destination $continued%
Oracle Database 11g: Administration Workshop II A ; 1.
A*n*she% bacP!$ a& (#9/=L9"2
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (#9/=L9"2
$*ece
han%le=JARAorcla!&obacP!$(""2_"I_(#s_C2(7"77F0'(C#'C2(7"77
FI co))en&=<O<E
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (#9/=L9"2
RMA<;
RMA<; exit
&ote that the acku' -ile is written to the F)A/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 10
Practice 2-.: Configuring the Retention Po(ic)
(n this 'ractice? you change the retention 'olicy -or acku's/
&ote that the de-ault retention 'olicy in 7racle !ataase ..g )elease 1 is already set to
redundancy ./ $o this 'ractice is -or training 'ur'oses only/
.@ =se the oraenv scri't to ensure that you are still using the ORCL instance in your
terminal session/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
1@ )eturn to the )MA& session Bor i- you closed it? start a new one@ and show the
current retention 'olicy setting/
$ rman target /
RMA<; show retention policy;
RMA< conf*4!ra&*on $ara)e&ers for %a&abase E*&h %b_!n*B!e_na)e
ORCL are.
CO<AID=RE RETE<TIO< -OLIC@ TO RED=<DA<C@ #M N %efa!l&
RMA<;
9@ (- your redundancy is .? go to ste' 3 and eDit/ (- your redundancy had another *alue?
change it to ensure that one co'y o- each -ile is acked u'/
RMA<; configure retention policy to redundancy /;
ol% RMA< conf*4!ra&*on $ara)e&ers.
CO<AID=RE RETE<TIO< -OLIC@ TO <O<EM
neE RMA< conf*4!ra&*on $ara)e&ers.
CO<AID=RE RETE<TIO< -OLIC@ TO RED=<DA<C@ #M
neE RMA< conf*4!ra&*on $ara)e&ers are s!ccessf!ll3 s&ore%
RMA<;
0@ Check the retention 'olicy setting again/
RMA<; show retention policy;
RMA< conf*4!ra&*on $ara)e&ers for %a&abase E*&h %b_!n*B!e_na)e
ORCL are.
CO<AID=RE RETE<TIO< -OLIC@ TO RED=<DA<C@ #M
3@ 6Dit )MA&/
RMA<; exit
Recover3 Mana4er co)$le&e'
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 12
4ractices %or :esson +
Practice *-1: Creating a Recover) Cata(og
(n this 'ractice? you create a reco*ery catalog/
.@ =se !BCA to start the 'rocess o- creating a reco*ery catalog dataase/
$ dbca
1@ 7n the Aelcome 'age? click &eDt/
9@ 7n the 7'erations 'age? select the Create a !ataase o'tion? and then click &eDt/
0@ 7n the !ataase Tem'lates 'age? lea*e the de-ault o- General Pur'ose or Transaction
Processing? and then click &eDt/
3@ 7n the !ataase (denti-ication 'age? enter the name o- the reco*ery catalog dataase/
=se rcat.example.com as the Gloal !ataase &ame/ Then click &eDt/
4@ 7n the Management 7'tions 'age? deselect the Con-igure 6nter'rise Manager o'tion?
and then click the Automatic Maintenance Tasks ta/
;@ 7n the Automatic Maintenance Tasks 'age? deselect J6nale automatic maintenance
tasksK and then click &eDt/
Oracle Internal & Oracle cadem! "#e Onl!
Practice *-1: Creating a Recover) Cata(og $continued%
Oracle Database 11g: Administration Workshop II A ; 13
8@ 7n the !ataase Credentials 'age? select the o'tion =se the $ame Administrati*e
Password -or All Accounts/ Then enter oracle_4U in the 'assword -ields and click
&eDt/
:@ 7n the !ataase File %ocations Page? select Automatic !torage "anagement
&A!"' as $torage Ty'e/ Click =se Common %ocation -or All !ataase Files and
then use the Browse utton to select the FDATA disk grou'? and click 7#/
Oracle Internal & Oracle cadem! "#e Onl!
Practice *-1: Creating a Recover) Cata(og $continued%
Oracle Database 11g: Administration Workshop II A ; 15
.<@ Then click &eDt/
..@ 7n the )eco*ery Con-iguration 'age? select !pecif# (lash Recover# Area? use the
Browse utton to select the )(RA diskgrou' Bclick 7#@ and ensure that the Flash
)eco*ery Area $ize is *+,% " -#tes/ Then click &eDt/
.1@ 7n the !ataase Content 'age? con-irm that the $am'le $chemas o'tion is not
selected? and then click &eDt/
Oracle Internal & Oracle cadem! "#e Onl!
Practice *-1: Creating a Recover) Cata(og $continued%
Oracle Database 11g: Administration Workshop II A ; 16
.9@ 7n the (nitialization Parameter 'age? set the memory size to .+. "-? click /se
Automatic "emor# "anagement? and then click the Character $ets ta/
.0@ Click /se /nicode &A0.%/T(1' and then click &eDt/
Oracle Internal & Oracle cadem! "#e Onl!
Practice *-1: Creating a Recover) Cata(og $continued%
Oracle Database 11g: Administration Workshop II A ; !"
.3@ (- the $ecurity $ettings 'age a''ears? kee' the de-aults? and then click &eDt/
.4@ 7n the !ataase $torage 'age? re*iew the con-iguration? and then click &eDt/
.;@ 7n the Creation 7'tions 'age? make sure that Create !ataase is the only o'tion
selected? and then click Finish/
Oracle Internal & Oracle cadem! "#e Onl!
Practice *-1: Creating a Recover) Cata(og $continued%
Oracle Database 11g: Administration Workshop II A ; !1
.8@ )e*iew the Con-irmation 'age? and then click 7# to start the dataase creation
'rocess/
Oracle Internal & Oracle cadem! "#e Onl!
Practice *-1: Creating a Recover) Cata(og $continued%
Oracle Database 11g: Administration Workshop II A ; !!
.:@ The !ataase Creation Assistant now creates the dataase/
Oracle Internal & Oracle cadem! "#e Onl!
Practice *-1: Creating a Recover) Cata(og $continued%
Oracle Database 11g: Administration Workshop II A ; !+
1<@ Ahen the !ataase Con-iguration Assistant -inishes running? *iew the -inal 'age? and
then click 6Dit/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; !.
Practice *-2: Creating the Recover) Cata(og "wner
(n this 'ractice? you con-igure the reco*ery catalog dataase with a user (! and
a''ro'riate 'ri*ileges? and register a dataase/
.@ =se $>%EPlus to con-igure the reco*ery catalog dataase/ Connect to it as SYS to the
RCAT dataase/
$ sqlplus sys as sysdba
Enter password: oracle_4U@rcat <<<not displayed
SQL>
1@ C
SQL> C#'("' "(*$'0,(C' rcat 1("(%&$' 231("(/rcat4/.dbf2 0&5' /.6;
reate a tales'ace named )CAT to hold the re'ository data/ Make it .3 MB in size/
Tablespace created.
SQL>
9@ Create a user who will own the reco*ery catalog data/ &ame the user RCATOWNER/
The de-ault tales'ace should e the RCAT tales'ace? and the user should ha*e
unlimited "uota on that tales'ace/
SQL> C#'("' )0'# rcatowner &1'!"&%&'1 *7 8oracle_9)8
( 1'%()$" "(*$'0,(C' rcat :)"( unlimited on rcat;
User created.
SQL>
0@ Grant the RECO?ER@_CATALOD_O:<ER role to the RCATO:<ER
SQL> ;#(!" recovery_catalog_owner to rcatowner;
user/
Grant succeeded.
S+L;
/
exit
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; !0
Practice *-*: Creating the Recover) Cata(og
(n this 'ractice? you create the reco*ery catalog inside the reco*ery catalog dataase you
ha*e 're'ared/
.@ Connect to the reco*ery catalog dataase using )MA&/ %og in as the reco*ery
catalog owner you ,ust created/
$ rman catalog rcatowner<rcat
Recover3 Mana4er. Release ##'('"'#'" 9 -ro%!c&*on on Ar* /!l
#" #2.F0."0 (""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle an%or *&s aff*l*a&es' All
r*4h&s reserve%'
recover3 ca&alo4 %a&abase -assEor%.oracle_9) <<<not displayed
connec&e% &o recover3 ca&alo4 %a&abase
RMA<;
1@ Create the reco*ery catalog/ This command may take se*eral minutes to com'lete/
RMA<; create catalog;
recover3 ca&alo4 crea&e%
RMA<; exit
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; !2
Practice *-.: Registering a Database in the Recover) Cata(og
(n this 'ractice? you register the ORCL dataase in the reco*ery catalog that you ha*e ,ust
created/
.@ $et u' the en*ironment -or the ORCL dataase/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
1@ Connect to the target dataase Bto e registered@ and the reco*ery catalog dataase
using )MA&/
$ rman target / catalog rcatowner<rcat
Recover3 Mana4er. Release ##'('"'#'" 9 -ro%!c&*on on T!e /!l
(# #F.1".1( (""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle an%or *&s aff*l*a&es' All
r*4h&s reserve%'
connec&e% &o &ar4e& %a&abase. ORCL 5D>ID=#(("F1F07"6
recover3 ca&alo4 %a&abase -assEor%.oracle_9) <<<not displayed
connec&e% &o recover3 ca&alo4 %a&abase
RMA<;
9@ )egister the dataase in the catalog/
RMA<; register database;
%a&abase re4*s&ere% *n recover3 ca&alo4
s&ar&*n4 f!ll res3nc of recover3 ca&alo4
f!ll res3nc co)$le&e
RMA<; exit
0@ )egister the reco*ery catalog to e used y 6nter'rise Manager/
a@ (n 6M? na*igate to A*ailaility I )eco*ery Catalog $ettings/
@ Click Add )eco*ery Catalog/
c@ 6nter the -ollowing in-ormation? then click &eDt2
Oracle Internal & Oracle cadem! "#e Onl!
Practice *-.: Registering a Database in the Recover) Cata(og
$continued%
Oracle Database 11g: Administration Workshop II A ; !3
5ost2 2your_hostname3
Port2 /.=/
$(!2 rcat
)eco*ery Catalog =sername2 rcatowner
)eco*ery Catalog Password2 oracle_9)
d@ 7n the )e*iew 'age? click Finish/
e@ Back on the )eco*ery Catalog $ettings 'age? select =se )eco*ery Catalog/ Make
sure that the reco*ery catalog you ,ust registered is selected in the dro'+down list?
and enter the -ollowing *alues2
)eco*ery Catalog =sername2 rcatowner
)eco*ery Catalog Password2 oracle_9)
=sername2 oracle
Password2 oracle
Oracle Internal & Oracle cadem! "#e Onl!
Practice *-.: Registering a Database in the Recover) Cata(og
$continued%
Oracle Database 11g: Administration Workshop II A ; !5
-@ Click $a*e as Pre-erred Credential and then click 7#/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; !6
Practice *-/: +ac,ing u- the Recover) Cata(og
(n this 'ractice? you con-igure the retention 'olicy -or the reco*ery catalog and ack u'
your reco*ery catalog itsel-/
.@ $et u' the en*ironment -or the ORCL dataase/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
1@ $tart )MA&? use the reco*ery catalog dataase as the target? with no catalog
s'eci-ied/
$ rman target sys<rcat
&ar4e& %a&abase -assEor%. oracle_9) <<< not displayed
connec&e% &o &ar4e& %a&abase. RCAT 5D>ID= 0C02F2I2F6
RMA<;
9@ Make sure that the retention 'olicy -or the reco*ery catalog is set to redundancy
greater than ./ (- it is not? set it to at least 1/
RMA<; show retention policy;
!s*n4 &ar4e& %a&abase con&rol f*le *ns&ea% of recover3 ca&alo4
RMA< conf*4!ra&*on $ara)e&ers for %a&abase E*&h %b_!n*B!e_na)e
RCAT are.
CO<AID=RE RETE<TIO< -OLIC@ TO RED=<DA<C@ #M N %efa!l&
RMA<; configure retention policy to redundancy =;
neE RMA< conf*4!ra&*on $ara)e&ers.
CO<AID=RE RETE<TIO< -OLIC@ TO RED=<DA<C@ (M
neE RMA< conf*4!ra&*on $ara)e&ers are s!ccessf!ll3 s&ore%
RMA<;
0@ Try to ack u' the dataase/
RMA<; bac-up database;
S&ar&*n4 bacP!$ a& #79/=L9"I
ORACLE error fro) &ar4e& %a&abase.
ORA9""(F7. )an!al arch*v*n4 *n <OARCHI?ELOD )o%e )!s& *%en&*f3
lo4
!s*n4 &ar4e& %a&abase con&rol f*le *ns&ea% of recover3 ca&alo4
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=#1I %ev*ce &3$e=DISL
s$ec*f*ca&*on %oes no& )a&ch an3 arch*ve% lo4 *n &he recover3
ca&alo4
bacP!$ cancelle% beca!se all f*les Eere sP*$$e%
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; +"
Practice *-/: +ac,ing u- the Recover) Cata(og $continued%
A*n*she% bacP!$ a& #79/=L9"I
S&ar&*n4 bacP!$ a& #79/=L9"I
!s*n4 channel ORA_DISL_#
channel ORA_DISL_#. s&ar&*n4 f!ll %a&af*le bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
RMA<9""FI#.
===========================================================
RMA<9""FC2. =============== ERROR MESSADE STACL AOLLO:S
===============
RMA<9""FI#.
===========================================================
RMA<9"1""(. fa*l!re of bacP!$ $l!s arch*velo4 co))an% a&
"I#7(""I ((.FF.0F
ORA9#2C"(. canno& bacP!$ or co$3 ac&*ve f*le *n <OARCHI?ELOD
)o%e
RMA<;
&ote that you cannot ack u' an o'en dataase that is not in ARCHI?ELOD mode/
The reco*ery catalog dataase should e run in ARCHI?ELOD mode -or maDimum
a*ailaility/
3@ 6Dit )MA&/
RMA<; exit
4@ First? set u' the en*ironment -or the RCAT dataase and then run the
rca&_&o_arch*velo4'sh scri't to change the reco*ery catalog dataase to
run in ARCHI?ELOD mode/
$ . oraenv
ORACLE_SID = [orcl] ? rcat
$ cd ~/labs
$ ./rcat_to_archivelog.sh
Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area (C1C12"0" b3&es
A*Ge% S*He #(22#C0 b3&es
?ar*able S*He (1"C2""70 b3&es
Da&abase >!ffers (F#CF7(0 b3&es
Re%o >!ffers C0712C7 b3&es
Da&abase )o!n&e%'
Da&abase al&ere%'
Da&abase al&ere%'
$
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; +1
Practice *-/: +ac,ing u- the Recover) Cata(og $continued%
;@ $et u' the en*ironment -or the ORCL dataase/
$ . oraenv
ORACLE_SID = [rca&] ? orcl
8@ %og in to )MA& again? as in the 'receding ste'/
$ rman target sys<rcat
&ar4e& %a&abase -assEor%. oracle_9) <<< not displayed
connec&e% &o &ar4e& %a&abase. RCAT 5D>ID= 0C02F2I2F6
RMA<;
:@ Back u' the reco*ery catalog dataase/ This time the o'eration should e
success-ul/
RMA<; bac-up database;
S&ar&*n4 bacP!$ a& (#9/=L9"2
!s*n4 &ar4e& %a&abase con&rol f*le *ns&ea% of recover3 ca&alo4
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=0" %ev*ce &3$e=DISL
channel ORA_DISL_#. s&ar&*n4 f!ll %a&af*le bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""# na)e=JDATArca&s3s&e)"#'%bf
*n$!& %a&af*le f*le n!)ber=""""( na)e=JDATArca&s3sa!G"#'%bf
*n$!& %a&af*le f*le n!)ber=""""1 na)e=JDATArca&!n%o&bs"#'%bf
*n$!& %a&af*le f*le n!)ber=""""F na)e=JDATArca&"#'%bf
*n$!& %a&af*le f*le n!)ber=""""0 na)e=JDATArca&!sers"#'%bf
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (#9/=L9"2
channel ORA_DISL_#. f*n*she% $*ece # a& (#9/=L9"2
$*ece
han%le=JARArca&bacP!$se&(""2_"I_(#nnn%f"_&a4(""2"I(#&#FF1(
F_"'(C1'C2(7#(0"F &a4=TAD(""2"I(#T#FF1(F co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e.
""."(.1I
channel ORA_DISL_#. s&ar&*n4 f!ll %a&af*le bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*ncl!%*n4 c!rren& con&rol f*le *n bacP!$ se&
*ncl!%*n4 c!rren& S-AILE *n bacP!$ se&
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (#9/=L9"2
channel ORA_DISL_#. f*n*she% $*ece # a& (#9/=L9"2
$*ece
han%le=JARArca&bacP!$se&(""2_"I_(#ncsnf"_&a4(""2"I(#&#FF1(
F_"'(C0'C2(7#(FC2 &a4=TAD(""2"I(#T#FF1(F co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e.
"".""."1
A*n*she% bacP!$ a& (#9/=L9"2
RMA<; exit
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; +!
Practice *-/: +ac,ing u- the Recover) Cata(og $continued%
.<@ )un the %*sable_as3nch_*o'sh scri't to disale asynchronous in'utLout'ut
B(L7@/ A-ter altering the system? the dataase is restarted/ This im'ro*es
'er-ormance on the -ollowing las2
$ ~/labs/disable_asynch_io.sh
Se&&*n4 !$ ORCL env*ron)en&'
ORACLE_SID = [orcl] ? The Oracle base for
ORACLE_HOME=!"#a$$oracle$ro%!c&##'('"%bho)e_# *s
!"#a$$oracle
S+L,-l!s. Release ##'('"'#'" -ro%!c&*on on T!e /!l (# #F.F7.F#
(""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle' All r*4h&s reserve%'
Connec&e% &o.
Oracle Da&abase ##4 En&er$r*se E%*&*on Release ##'('"'#'" 9
-ro%!c&*on
:*&h &he -ar&*&*on*n48 A!&o)a&*c S&ora4e Mana4e)en&8 OLA-8
Da&a M*n*n4
an% Real A$$l*ca&*on Tes&*n4 o$&*ons
S+L;
S3s&e) al&ere%'
S+L;
S3s&e) al&ere%'
S+L; Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
S+L; ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 07#(F2F(" b3&es
A*Ge% S*He #11I1(0 b3&es
?ar*able S*He 1C"I#((#( b3&es
Da&abase >!ffers ##1(0C("7 b3&es
Re%o >!ffers F2C1IIC b3&es
Da&abase )o!n&e%'
Da&abase o$ene%'
S+L; D*sconnec&e% fro) Oracle Da&abase ##4 En&er$r*se E%*&*on
Release ##'('"'#'" 9 -ro%!c&*on
:*&h &he -ar&*&*on*n48 A!&o)a&*c S&ora4e Mana4e)en&8 OLA-8
Da&a M*n*n4
an% Real A$$l*ca&*on Tes&*n4 o$&*ons
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; ++
4ractices %or :esson .
Practice .-1: 0etting the Date and 1i2e 'or2at for RMA3
(n this 'ractice? you set the dateLtime -ormat that )MA& uses -or dis'laying timestam's/
.@ $et the <LS_LA<D and <LS_DATE_AORMAT *ariales such that )MA& includes
time in-ormation in any timestam' *alues/ Add the -ollowing two lines to the
Qoracle'bashrc -ile/ Then eDit all o- your terminal windows/ This ensures that
when you create new ones? these settings will e in e--ect/
export !$0_$(!;>american_america.al?=utf@
export !$0_1("'_%#6(">8yyyyAmmAddBhh=9BmiBss8
1@ $tart a new terminal window? and *eri-y the settings y starting )MA& and listing
the acku's o- the reco*ery catalog dataase/
a@ $et u' the en*ironment -or the ORCL dataase/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
@ %og in to )MA&/
$ rman target sys<rcat
&ar4e& %a&abase -assEor%. oracle_9) <<< not displayed
connec&e% &o &ar4e& %a&abase. RCAT 5D>ID= 0C02F2I2F6
c@ %ist the acku's? and note the timestam' -ormat/
RMA<; list bac-up;
!s*n4 &ar4e& %a&abase con&rol f*le *ns&ea% of recover3 ca&alo4
L*s& of >acP!$ Se&s
===================
>S Le3 T3$e L? S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on
T*)e
9999999 9999 99 9999999999 99999999999 999999999999 9999999999
999999999
# A!ll 2'1CM DISL "".""."C (""29"I9
(#.#F.0(."F
>- Le3. # S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#F0#F2
-*ece <a)e.
JARArca&bacP!$se&(""2_"I_(#ncsnf"_&a4(""2"I(#&#F0#F2_"'(C(
'C2(7##I(#
S-AILE Incl!%e%. Mo%*f*ca&*on &*)e. (""29"I9(#.#F.1(.0I
S-AILE %b_!n*B!e_na)e. RCAT
Oracle Internal & Oracle cadem! "#e Onl!
Practice .-1: 0etting the Date and 1i2e 'or2at for RMA3
$continued%
Oracle Database 11g: Administration Workshop II A ; +.
Con&rol A*le Incl!%e%. CP$ SC<. 7"1II" CP$ &*)e. (""29
"I9(#.#F.0#.F2
'
'
'
RMA<;
Note$ Because the out'ut o- the )MA& commands can e "uite long? consider using the
)MA& S-OOL LOD command to direct the out'ut to your s'eci-ied -ile/ Oracle Internal
&
Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; +0
Practice .-2: nab(ing Contro( 'i(e Autobac,u-
(n this 'ractice? you con-igure )MA& to ack u' the control -ile and $PF(%6 each time it
takes a acku' o- anything in the RCAT dataase/
.@ (n the same reco*ery catalog )MA& session? make sure that control -ile autoacku'
is enaled/
RMA<; show controlfile autobac-up;
RMA< conf*4!ra&*on $ara)e&ers for %a&abase E*&h %b_!n*B!e_na)e
RCAT are.
CO<AID=RE CO<TROLAILE A=TO>ACL=- OAAM N %efa!l&
RMA<;
1@ 6nale control -ile autoacku'/
RMA<; configure controlfile autobac-up on;
neE RMA< conf*4!ra&*on $ara)e&ers.
CO<AID=RE CO<TROLAILE A=TO>ACL=- O<M
neE RMA< conf*4!ra&*on $ara)e&ers are s!ccessf!ll3 s&ore%
RMA<;
9@ Veri-y that it is enaled y acking u' the archi*e logs -or the reco*ery catalog/ Then
eDit )MA&/
RMA<; bac-up archivelog all;
S&ar&*n4 bacP!$ a& (""29"I9(#.#C.((.#"
c!rren& lo4 arch*ve%
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=0I %ev*ce &3$e=DISL
channel ORA_DISL_#. s&ar&*n4 arch*ve% lo4 bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 arch*ve% lo45s6 *n bacP!$ se&
*n$!& arch*ve% lo4 &hrea%=# seB!ence=F RECID=# STAM-=C2(7#0#1F
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (""29"I9(#.#C.((.#7
channel ORA_DISL_#. f*n*she% $*ece # a& (""29"I9(#.#C.((.(#
$*ece
han%le=JARArca&bacP!$se&(""2_"I_(#annnf"_&a4(""2"I(#&#C((#
C_"'(CC'C2(7#0#12 &a4=TAD(""2"I(#T#C((#C co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e.
"".""."0
A*n*she% bacP!$ a& (""29"I9(#.#C.((.(#
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"I9
(#.#C.((.(#
$*ece
han%le=JARArca&a!&obacP!$(""2_"I_(#s_C2(7#0#0#'(CI'C2(7#0#
0F co))en&=<O<E
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"I9
(#.#C.((.(7
Oracle Internal & Oracle cadem! "#e Onl!
Practice .-2: nab(ing Contro( 'i(e Autobac,u- $continued%
Oracle Database 11g: Administration Workshop II A ; +2
RMA<; exit
&ote that the control -ile and $PF(%6 are automatically acked u' now/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; +3
Practice .-*: Configuring Devices for +ac,u-
(n this 'ractice? you con-igure a ta'e de*ice -or use in making acku's/
Note$ This channel de-inition is used in the )MA& monitoring and tuning 'ractice/
There-ore? ste's .+0 are mandatoryM ste' 3 B'er-orming a acku'@ is recommended? ut
o'tional/
.@ Make sure the $(! *ariale is set to ORCL/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
1@ $tart )MA& y connecting to the ORCL as the target dataase and using the reco*ery
catalog dataase/
$ rman target / catalog rcatowner<rcat
recover3 ca&alo4 %a&abase -assEor%. oracle_9) <<<not displayed
RMA<;
9@ $how all con-iguration settings to see whether there are any ta'e de*ices de-ined/
RMA<; show all;
RMA< conf*4!ra&*on $ara)e&ers for %a&abase E*&h %b_!n*B!e_na)e
ORCL are.
CO<AID=RE RETE<TIO< -OLIC@ TO RED=<DA<C@ #M N %efa!l&
CO<AID=RE >ACL=- O-TIMIRATIO< OAAM N %efa!l&
CO<AID=RE DEAA=LT DE?ICE T@-E TO DISLM N %efa!l&
CO<AID=RE CO<TROLAILE A=TO>ACL=- O<M
CO<AID=RE CO<TROLAILE A=TO>ACL=- AORMAT AOR DE?ICE T@-E DISL
TO STASM N %efa!l&
CO<AID=RE DE?ICE T@-E DISL -ARALLELISM # >ACL=- T@-E TO
>ACL=-SETM N %efa!l&
CO<AID=RE DATAAILE >ACL=- CO-IES AOR DE?ICE T@-E DISL TO #M N
%efa!l&
CO<AID=RE ARCHI?ELOD >ACL=- CO-IES AOR DE?ICE T@-E DISL TO #M
N %efa!l&
CO<AID=RE MAOSETSIRE TO =<LIMITEDM N %efa!l&
CO<AID=RE E<CR@-TIO< AOR DATA>ASE OAAM N %efa!l&
CO<AID=RE E<CR@-TIO< ALDORITHM SAES#(7SM N %efa!l&
CO<AID=RE COM-RESSIO< ALDORITHM S>ASICS AS OA RELEASE
SDEAA=LTS O-TIMIRE AOR LOAD TR=E M N %efa!l&
CO<AID=RE ARCHI?ELOD DELETIO< -OLIC@ TO <O<EM N %efa!l&
CO<AID=RE S<A-SHOT CO<TROLAILE <AME TO
S!"#a$$oracle$ro%!c&##'('"%bho)e_#%bssna$cf_orcl'fSM N
%efa!l&
RMA<;
&ote that there are no ta'e de*ices/
0@ !e-ine a channel -or a ta'e de*ice that uses the test inter-ace/ This actually writes to
disk in the &a$e directory/
Oracle Internal & Oracle cadem! "#e Onl!
Practice .-*: Configuring Devices for +ac,u- $continued%
Oracle Database 11g: Administration Workshop II A ; +5
RMA<; configure channel device type sbt
(; parms>20*"_$&*#(#7>oracle.dis-sbtC'!D>E*(C+),_1&#>/tapeF2;
neE RMA< conf*4!ra&*on $ara)e&ers.
CO<AID=RE CHA<<EL DE?ICE T@-E SS>T_TA-ES -ARMS
SS>T_LI>RAR@=oracle'%*sPsb&8E<?=5>ACL=-_DIR=&a$e6SM
neE RMA< conf*4!ra&*on $ara)e&ers are s!ccessf!ll3 s&ore%
s&ar&*n4 f!ll res3nc of recover3 ca&alo4
f!ll res3nc co)$le&e
RMA<;
3@ Per-orm a acku' to the ta'e de*ice to make sure it works/ Back u' the =SERS
tales'ace/ Then eDit )MA&/
RMA<; bac-up device type sbt tablespace users;
S&ar&*n4 bacP!$ a& (""29"I9(#.#C.1(."2
alloca&e% channel. ORA_S>T_TA-E_#
channel ORA_S>T_TA-E_#. SID=F1 %ev*ce &3$e=S>T_TA-E
channel ORA_S>T_TA-E_#. :AR<I<D. Oracle Tes& D*sP A-I
channel ORA_S>T_TA-E_#. s&ar&*n4 f!ll %a&af*le bacP!$ se&
channel ORA_S>T_TA-E_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""0
na)e=JDATAorcl%a&af*le!sers'(F2'C2(IF0FC#
channel ORA_S>T_TA-E_#. s&ar&*n4 $*ece # a& (""29"I9
(#.#C.1(.#"
channel ORA_S>T_TA-E_#. f*n*she% $*ece # a& (""29"I9
(#.#C.1(.##
$*ece han%le="FPPn"sa_#_# &a4=TAD(""2"I(#T#C1(#" co))en&=A-I
?ers*on ('"8MMS ?ers*on 7'#'1'"
channel ORA_S>T_TA-E_#. bacP!$ se& co)$le&e8 ela$se% &*)e.
"".""."#
A*n*she% bacP!$ a& (""29"I9(#.#C.1(.##
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"I9
(#.#C.1(.##
$*ece han%le=c9#(("F1F07"9(""2"I(#9"( co))en&=A-I ?ers*on
('"8MMS ?ers*on 7'#'1'"
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"I9
(#.#C.1(.#C
RMA<; exit
&ote that it uses a channel called ORA_S>T_TA-E_# to 'er-orm the acku'/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; +6
4ractices %or :esson 0
Practice /-1: Creating 'ast Incre2enta( +ac,u-s
(n this 'ractice? you enale lock change tracking so that you can make incremental
acku's more "uickly/
.@ =se 6nter'rise Manager !ataase Control to con-igure acku' o'timization and
enale lock change tracking/ Allow a de-ault lock change tracking -ile to e used/
a@ From the !ataase home 'age o- 6M? na*igate to A*ailaility I Backu' $ettings
I Policy? and enale acku' o'timization and lock change tracking/
@ Click 7#/
c@ (- you see the -ollowing error? you ha*e not entered the o'erating system
credentials/ Continue with the -ollowing ste's i- that is the case/
d@ $croll to the ottom o- the 'age? and enter oracle as username and oracle as
'assword/ Also? select the o'tion to sa*e this as the 're-erred credential/
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-1: Creating 'ast Incre2enta( +ac,u-s $continued%
Oracle Database 11g: Administration Workshop II A ; ."
e@ Click 7#/
1@ Make sure that the ORACLE_SID *ariale is set to ORCL/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
9@ %og in to )MA& and create an incremental le*el < acku'/
$ rman target / catalog rcatowner<rcat
recover3 ca&alo4 %a&abase -assEor%. oracle_9) <<<not displayed
RMA<; bac-up incremental level 4 database plus archivelog;
s&ar&*n4 f!ll res3nc of recover3 ca&alo4
f!ll res3nc co)$le&e
'
'
'
$*ece
han%le=JARAorclbacP!$se&(""2_"I_(#annnf"_&a4(""2"I(#&#2"FF
I_"'(I1'C2(7(12FI &a4=TAD(""2"I(#T#2"FFI co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e.
"".""."1
A*n*she% bacP!$ a& (#9/=L9"2
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (#9/=L9"2
$*ece
han%le=JARAorcla!&obacP!$(""2_"I_(#s_C2(7(12C('(I0'C2(7(12
CF co))en&=<O<E
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (#9/=L9"2
RMA<;
0@ &ow that you ha*e a le*el < incremental acku'? you can take ad*antage o- lock
change tracking to make -ast incremental acku's/ Take a le*el . incremental acku'/
RMA<; bac-up incremental level / database plus archivelog;
S&ar&*n4 bacP!$ a& (#9/=L9"2
c!rren& lo4 arch*ve%
!s*n4 channel ORA_DISL_#
'
'
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-1: Creating 'ast Incre2enta( +ac,u-s $continued%
Oracle Database 11g: Administration Workshop II A ; .1
'
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (#9/=L9"2
RMA<;
3@ (n another terminal window? make sure you are at the Qlabs directory/
$ cd ~/labs
4@ )e*iew and eDecute the B!er3_blocP_co!n&'sh scri't to "uery
?$>ACL=-_DATAAILE to see how many o- the locks were read -or creating the
le*el . incremental acku'/
$ cat query_bloc-_count.sh
eG$or& ORACLE_SID=orcl
sBl$l!s as s3s%ba KK9EOI
selec& f*leN8 av45%a&af*le_blocPs68
av45blocPs_rea%68
av45blocPs_rea%%a&af*le_blocPs6 , #"" as
-CT_READ_AOR_>ACL=-8
av45blocPs6
fro) vU$bacP!$_%a&af*le
Ehere !se%_chan4e_&racP*n4 = S@ESS
an% *ncre)en&al_level ; "
4ro!$ b3 f*leNM
B!*&
EOI
$./query_bloc-_count.sh
S+L; ( 1 0 F C I 7
AILEN A?D5DATAAILE_>LOCLS6 A?D5>LOCLS_READ6
-CT_READ_AOR_>ACL=- A?D5>LOCLS6
9999999999 99999999999999999999 9999999999999999 9999999999999
999999 99999999999
# 7I"0" #I1
'#27IF2#2# 10
( IFF(" 2FI
#'(CI(#127 100
F #(7"" #
'""I7#(F #
0 C0" #
'#FC(F #
1 #(7"" 1##
('0(2C7IF 2C
$
&ote that the 'ercentage o- locks read -or making the acku' is *ery low in most cases?
and sometimes *ery close to zero/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; .!
Practice /-2: Cross-Chec,ing +ac,u-s
(n this 'ractice? you cross+check acku's against the reco*ery catalog? identi-ying and
deleting any acku's that are osolete/
.@ Make sure that you are at the Qlabs directory? and that the ORACLE_SID *ariale
is set to ORCL/
$ cd ~/labs
$ . oraenv
ORACLE_SID = [orcl] ? orcl
1@ =se the )MA& session -rom the 're*ious 'ractice or start )MA&/ Make sure that
you connect to oth your target dataase and the reco*ery catalog dataase/
$ rman target / catalog rcatowner<rcat
connec&e% &o &ar4e& %a&abase. ORCL 5D>ID=#(("F1F07"6
recover3 ca&alo4 %a&abase -assEor%. oracle_9) <<<not displayed
connec&e% &o recover3 ca&alo4 %a&abase
RMA<;
9@ %ist acku's o- data -ile 3? noting the entry corres'onding to the eGa)$le data -ile/
RMA<; list bac-up of datafile .;
>S Le3 T3$e L? S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on T*)e
9999999 9999 99 9999999999 99999999999 999999999999 9999999999999999999
1I A!ll C7'22M DISL ""."".#1 (""29"I9(#.#0.F0.##
>- Le3. 0" S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#0F1F7
-*ece <a)e.
JARAorclbacP!$se&(""2_"I_(#nnn%f"_&a4(""2"I(#&#0F1F7_"'(C"'C2(7"7712
L*s& of Da&af*les *n bacP!$ se& 1I
A*le L? T3$e CP$ SC< CP$ T*)e <a)e
9999 99 9999 9999999999 9999999999999999999 9999
F A!ll 2"7F2F (""29"I9(#.#0.F1.F2
JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
>S Le3 T3$e L? S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on T*)e
9999999 9999 99 9999999999 99999999999 999999999999 9999999999999999999
#I( Incr " #'"ID DISL ""."(.0I (""29"I9(#.#2."F.00
>- Le3. #IC S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#2"(FF
-*ece <a)e.
JARAorclbacP!$se&(""2_"I_(#nnn%n"_&a4(""2"I(#&#2"(FF_"'(I#'C2(7(1III
L*s& of Da&af*les *n bacP!$ se& #I(
A*le L? T3$e CP$ SC< CP$ T*)e <a)e
9999 99 9999 9999999999 9999999999999999999 9999
F " Incr 2(0#F( (""29"I9(#.#2."(.FI
JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
>S Le3 T3$e L? S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on T*)e
9999999 9999 99 9999999999 99999999999 999999999999 9999999999999999999
(1I Incr # 1'I0M DISL "".""."( (""29"I9(#.#2.#".1F
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-2: Cross-Chec,ing +ac,u-s $continued%
Oracle Database 11g: Administration Workshop II A ; .+
>- Le3. (0# S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#2#"1#
-*ece <a)e.
JARAorclbacP!$se&(""2_"I_(#nnn%n#_&a4(""2"I(#&#2#"1#_"'(II'C2(7(0(11
L*s& of Da&af*les *n bacP!$ se& (1I
A*le L? T3$e CP$ SC< CP$ T*)e <a)e
9999 99 9999 9999999999 9999999999999999999 9999
F # Incr 2(02F1 (""29"I9(#.#2.#".11
JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
RMA<;
Take note o- the only acku' that is a -ull acku' o- data -ile 3/ Also note that the
JPiece &ameK is the name o- the A$M -ile where the acku' -ile resides/
0@ (n an 7$ terminal window? delete the acku' set -ile/ $tart a se'arate terminal
session? so the )MA& session can stay connected/ =se the FA$M en*ironment
*ariales? re*iew and eDecute the r)_as)_f*le'sh scri't to do this/ $u''ly
Y7=) -ull JPiece &ameK as an argument to the scri't/
$ . oraenv
ORACLE_SID = [orcl] ? 3(06
$ cat rm_asm_file.sh
eG$or& ORACLE_SID=JASM
as)c)% KK9EOI
r) 9f $#
eG*&
EOI
EG*&
./rm_asm_file.sh G
; +FRA/orcl/backupset/2009_07_2/!!!"#0_ta$2009072t%&'&(_0)2*0)*92(0(('9
ASMCMD; ASMCMD; $
$
3@ (n your still connected )MA& session? list the acku's again? and look -or the acku'
that corres'onds to the eGa)$le data -ile/
RMA<; list bac-up of datafile .;
L*s& of >acP!$ Se&s
===================
>S Le3 T3$e L? S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on T*)e
9999999 9999 99 9999999999 99999999999 999999999999 9999999999999999999
1I A!ll C7'22M DISL ""."".#1 (""29"I9(#.#0.F0.##
>- Le3. 0" S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#0F1F7
-*ece <a)e.
JARAorclbacP!$se&(""2_"I_(#nnn%f"_&a4(""2"I(#&#0F1F7_"'(C"'C2(7"7712
L*s& of Da&af*les *n bacP!$ se& 1I
A*le L? T3$e CP$ SC< CP$ T*)e <a)e
9999 99 9999 9999999999 9999999999999999999 9999
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-2: Cross-Chec,ing +ac,u-s $continued%
Oracle Database 11g: Administration Workshop II A ; ..
F A!ll 2"7F2F (""29"I9(#.#0.F1.F2
JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
>S Le3 T3$e L? S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on T*)e
9999999 9999 99 9999999999 99999999999 999999999999 9999999999999999999
#I( Incr " #'"ID DISL ""."(.0I (""29"I9(#.#2."F.00
>- Le3. #IC S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#2"(FF
-*ece <a)e.
JARAorclbacP!$se&(""2_"I_(#nnn%n"_&a4(""2"I(#&#2"(FF_"'(I#'C2(7(1III
L*s& of Da&af*les *n bacP!$ se& #I(
A*le L? T3$e CP$ SC< CP$ T*)e <a)e
9999 99 9999 9999999999 9999999999999999999 9999
F " Incr 2(0#F( (""29"I9(#.#2."(.FI
JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
>S Le3 T3$e L? S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on T*)e
9999999 9999 99 9999999999 99999999999 999999999999 9999999999999999999
(1I Incr # 1'I0M DISL "".""."( (""29"I9(#.#2.#".1F
>- Le3. (0# S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#2#"1#
-*ece <a)e.
JARAorclbacP!$se&(""2_"I_(#nnn%n#_&a4(""2"I(#&#2#"1#_"'(II'C2(7(0(11
L*s& of Da&af*les *n bacP!$ se& (1I
A*le L? T3$e CP$ SC< CP$ T*)e <a)e
9999 99 9999 9999999999 9999999999999999999 9999
F # Incr 2(02F1 (""29"I9(#.#2.#".11
JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
RMA<;
&ote that the acku's are still listed as e-ore/ That is ecause the re'ository is not
aware o- the -act that the -ile -or the acku' 'iece is missing/
4@ Cross+check the acku' sets to make the reco*ery catalog aware o- the missing
acku' -ile/
RMA<; crosschec- bac-upset;
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=07 %ev*ce &3$e=DISL
alloca&e% channel. ORA_S>T_TA-E_#
channel ORA_S>T_TA-E_#. SID=FI %ev*ce &3$e=S>T_TA-E
channel ORA_S>T_TA-E_#. :AR<I<D. Oracle Tes& D*sP A-I
crosschecPe% bacP!$ $*ece. fo!n% &o be SEO-IREDS
bacP!$ $*ece
han%le=JARAorclbacP!$se&(""2_"I_(#nnn%f"_&a4(""2"I(#&#0F1F
7_"'(C"'C2(7"7712 RECID=# STAM-=C2(7"7712
crosschecPe% bacP!$ $*ece. fo!n% &o be SA?AILA>LES'
'
'
'
RMA<;
&ote that the acku' in "uestion has eD'ired/
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-2: Cross-Chec,ing +ac,u-s $continued%
Oracle Database 11g: Administration Workshop II A ; .0
;@ !elete all the eD'ired acku' sets/
RMA<; delete expired bac-upset;
!s*n4 channel ORA_DISL_#
!s*n4 channel ORA_S>T_TA-E_#
L*s& of >acP!$ -*eces
>- Le3 >S Le3 -cN C$N S&a&!s Dev*ce T3$e -*ece <a)e
9999999 9999999 999 999 99999999999 99999999999 9999999999
0" 1I # # EO-IRED DISL
JARAorclbacP!$se&(""2_"I_(#nnn%f"_&a4(""2"I(#&#0F1F7_"'(C"
'C2(7"7712
Do 3o! reall3 Ean& &o %ele&e &he above obVec&s 5en&er @ES or
<O6? 7'0
%ele&e% bacP!$ $*ece
bacP!$ $*ece
han%le=JARAorclbacP!$se&(""2_"I_(#nnn%f"_&a4(""2"I(#&#0F1F
7_"'(C"'C2(7"7712 RECID=# STAM-=C2(7"7712
Dele&e% # EO-IRED obVec&s
RMA<;
8@ %ist the acku' sets again/ $ee that the acku' you ,ust deleted is no longer listed/
RMA<; list bac-up of datafile .;
L*s& of >acP!$ Se&s
===================
>S Le3 T3$e L? S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on
T*)e
9999999 9999 99 9999999999 99999999999 999999999999 9999999999
999999999
#I( Incr " #'"ID DISL ""."(.0I (""29"I9
(#.#2."F.00
>- Le3. #IC S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#2"(FF
-*ece <a)e.
JARAorclbacP!$se&(""2_"I_(#nnn%n"_&a4(""2"I(#&#2"(FF_"'(I#
'C2(7(1III
L*s& of Da&af*les *n bacP!$ se& #I(
A*le L? T3$e CP$ SC< CP$ T*)e <a)e
9999 99 9999 9999999999 9999999999999999999 9999
F " Incr 2(0#F( (""29"I9(#.#2."(.FI
JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
>S Le3 T3$e L? S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on
T*)e
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-2: Cross-Chec,ing +ac,u-s $continued%
Oracle Database 11g: Administration Workshop II A ; .2
9999999 9999 99 9999999999 99999999999 999999999999 9999999999
999999999
(1I Incr # 1'I0M DISL "".""."( (""29"I9
(#.#2.#".1F
>- Le3. (0# S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#2#"1#
-*ece <a)e.
JARAorclbacP!$se&(""2_"I_(#nnn%n#_&a4(""2"I(#&#2#"1#_"'(II
'C2(7(0(11
L*s& of Da&af*les *n bacP!$ se& (1I
A*le L? T3$e CP$ SC< CP$ T*)e <a)e
9999 99 9999 9999999999 9999999999999999999 9999
F # Incr 2(02F1 (""29"I9(#.#2.#".11
JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
RMA<;
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; .3
Practice /-*: !isting +ac,u- 'i(es and Creating Archiva( +ac,u-
(n this 'ractice? you list acku' -iles/
.@ Continue to use the )MA& session -rom the 're*ious 'ractice? and generate a re'ort
o- all the osolete acku' -iles/
RMA<; report obsolete;
RMA< re&en&*on $ol*c3 E*ll be a$$l*e% &o &he co))an%
RMA< re&en&*on $ol*c3 *s se& &o re%!n%anc3 #
Re$or& of obsole&e bacP!$s an% co$*es
T3$e Le3 Co)$le&*on T*)e A*lena)eHan%le
99999999999999999999 999999 999999999999999999 999999999999999
99999
>acP!$ Se& 17 (""29"I9(#.#0.F0.#C
>acP!$ -*ece 0# (""29"I9(#.#0.F0.#C
JARAorcla!&obacP!$(""2_"I_(#s_C2(7"77F0'(C#'C2(7"77FI
>acP!$ Se& C7 (""29"I9(#.#C.(2.#I
>acP!$ -*ece I# (""29"I9(#.#C.(2.#I "1PPn")&_#_#
>acP!$ Se& II (""29"I9(#.#C.(2.((
>acP!$ -*ece I2 (""29"I9(#.#C.(2.(( c9#(("F1F07"9
(""2"I(#9"#
>acP!$ Se& 21 (""29"I9(#.#C.1(.#"
>acP!$ -*ece 2C (""29"I9(#.#C.1(.#" "FPPn"sa_#_#
Arch*ve Lo4 #F# (""29"I9(#.#I.02."0
JARAorclarch*velo4(""2_"I_(#&hrea%_#_seB_2'(C7'C2(7#211I
>acP!$ Se& #"F (""29"I9(#.#C.1(.#0
>acP!$ -*ece #"I (""29"I9(#.#C.1(.#0 c9#(("F1F07"9
(""2"I(#9"(
Arch*ve Lo4 #C1 (""29"I9(#.#2."(.02
JARAorclarch*velo4(""2_"I_(#&hrea%_#_seB_#"'(C2'C2(7(1ICI
>acP!$ Se& #I# (""29"I9(#.#2."(.F1
>acP!$ -*ece #IF (""29"I9(#.#2."(.F1
JARAorclbacP!$se&(""2_"I_(#annnf"_&a4(""2"I(#&#2"(F#_"'(I"
'C2(7(1II1
>acP!$ Se& ("F (""29"I9(#.#2."C."C
>acP!$ -*ece ("I (""29"I9(#.#2."C."C
JARAorcla!&obacP!$(""2_"I_(#s_C2(7(12C('(I0'C2(7(12CF
RMA<;
Your list o- -iles might look di--erent/ + Ahat can you deduce aout these acku'
-iles? gi*en that the retention 'olicy is set to RED=<DA<C@ #C
1@ Ahich acku's would e considered osolete i- the retention 'olicy were set to
redundancy o- 1? instead o- .C Answer this without changing the retention 'olicy/
RMA<; report obsolete redundancy =;
Re$or& of obsole&e bacP!$s an% co$*es
T3$e Le3 Co)$le&*on T*)e A*lena)eHan%le
99999999999999999999 999999 999999999999999999 999999999999999
>acP!$ Se& 17 (""29"I9(#.#0.F0.#C
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-*: !isting +ac,u- 'i(es and Creating Archiva( +ac,u-
$continued%
Oracle Database 11g: Administration Workshop II A ; .5
>acP!$ -*ece 0# (""29"I9(#.#0.F0.#C
JARAorcla!&obacP!$(""2_"I_(#s_C2(7"77F0'(C#'C2(7"77FI
>acP!$ Se& C7 (""29"I9(#.#C.(2.#I
>acP!$ -*ece I# (""29"I9(#.#C.(2.#I "1PPn")&_#_#
>acP!$ Se& II (""29"I9(#.#C.(2.((
>acP!$ -*ece I2 (""29"I9(#.#C.(2.(( c9#(("F1F07"9
(""2"I(#9"#
>acP!$ Se& #"F (""29"I9(#.#C.1(.#0
>acP!$ -*ece #"I (""29"I9(#.#C.1(.#0 c9#(("F1F07"9
(""2"I(#9"(
RMA<;
&ote that -ar -ewer acku's are osolete in this hy'othetical re'ort/ That is ecause
with an increased redundancy? more o- the acku's are re"uired/ This command is
run without a--ecting the retention 'olicy/
9@ !elete all osolete acku's/
RMA<; delete noprompt obsolete;
RMA< re&en&*on $ol*c3 E*ll be a$$l*e% &o &he co))an%
RMA< re&en&*on $ol*c3 *s se& &o re%!n%anc3 #
!s*n4 channel ORA_DISL_#
!s*n4 channel ORA_S>T_TA-E_#
Dele&*n4 &he folloE*n4 obsole&e bacP!$s an% co$*es.
T3$e Le3 Co)$le&*on T*)e A*lena)eHan%le
99999999999999999999 999999 999999999999999999 999999999999999
99999
>acP!$ Se& 17 (""29"I9(#.#0.F0.#C
>acP!$ -*ece 0# (""29"I9(#.#0.F0.#C
JARAorcla!&obacP!$(""2_"I_(#s_C2(7"77F0'(C#'C2(7"77FI
>acP!$ Se& C7 (""29"I9(#.#C.(2.#I
>acP!$ -*ece I# (""29"I9(#.#C.(2.#I "1PPn")&_#_#
>acP!$ Se& II (""29"I9(#.#C.(2.((
'
'
'
%ele&e% bacP!$ $*ece
bacP!$ $*ece han%le="FPPn"sa_#_# RECID=F STAM-=C2(7#0I1"
%ele&e% bacP!$ $*ece
bacP!$ $*ece han%le=c9#(("F1F07"9(""2"I(#9"( RECID=C
STAM-=C2(7#0I10
Dele&e% 0 obVec&s
RMA<;
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-*: !isting +ac,u- 'i(es and Creating Archiva( +ac,u-
$continued%
Oracle Database 11g: Administration Workshop II A ; .6
Note$ Your numer o- o,ects may e di--erent? de'ending on re'etitions o- 'ractice
ste's/
0@ %ist the acku' archi*elog -iles that could e used to reco*er to a 'oint in time one
hour ago/
Note$ You may need to ad,ust the -ollowing S@SDATE eD'ression to see some results
that di--er -rom the list command that does not use a S@SDATE "uali-ier at all/ For
eDam'le? try 4s3s%a&e9"FC"(04 to indicate 3 minutes ago/
RMA<; list bac-up of archivelog until time 2sysdateA//=92;
L*s& of >acP!$ Se&s
===================
>S Le3 S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on T*)e
9999999 9999999999 99999999999 999999999999 999999999999999999
9
#2# #'"FM DISL "".""."# (""29"I9
(#.#2."F.F7
>- Le3. #2I S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#2"FFI
-*ece <a)e.
JARAorclbacP!$se&(""2_"I_(#annnf"_&a4(""2"I(#&#2"FFI_"'(I1
'C2(7(12FI
L*s& of Arch*ve% Lo4s *n bacP!$ se& #2#
Thr% SeB LoE SC< LoE T*)e <eG& SC< <eG&
T*)e
9999 9999999 9999999999 9999999999999999999 9999999999 99999
9999
# ## 2(0#(C (""29"I9(#.#2."(.0C 2(0C(I (""29
"I9(#.#2."F.F1
>S Le3 S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on T*)e
9999999 9999999999 99999999999 999999999999 999999999999999999
9
(1C (II'""L DISL "".""."# (""29"I9
(#.#2.#".(2
>- Le3. (0" S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#2#"(7
-*ece <a)e.
JARAorclbacP!$se&(""2_"I_(#annnf"_&a4(""2"I(#&#2#"(7_"'(IC
'C2(7(0((2
L*s& of Arch*ve% Lo4s *n bacP!$ se& (1C
Thr% SeB LoE SC< LoE T*)e <eG& SC< <eG&
T*)e
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-*: !isting +ac,u- 'i(es and Creating Archiva( +ac,u-
$continued%
Oracle Database 11g: Administration Workshop II A ; 0"
9999 9999999 9999999999 9999999999999999999 9999999999 99999
9999
# #( 2(0C(I (""29"I9(#.#2."F.F1 2(02(7 (""29
"I9(#.#2.#".(C
>S Le3 S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on T*)e
9999999 9999999999 99999999999 999999999999 999999999999999999
9
(F7 I'F"L DISL "".""."# (""29"I9
(#.#2.#".12
>- Le3. (C0 S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
TAD(""2"I(#T#2#"1I
-*ece <a)e.
JARAorclbacP!$se&(""2_"I_(#annnf"_&a4(""2"I(#&#2#"1I_"'(I2
'C2(7(0(12
L*s& of Arch*ve% Lo4s *n bacP!$ se& (F7
Thr% SeB LoE SC< LoE T*)e <eG& SC< <eG&
T*)e
9999 9999999 9999999999 9999999999999999999 9999999999 99999
9999
# #1 2(02(7 (""29"I9(#.#2.#".(C 2(02C" (""29
"I9(#.#2.#".1C
RMA<;
3@ %ist the image co'ies o- the single data -ile in the =SERS tales'ace/
a@ )e'ort on the schema to -ind out which data -ile numer elongs to the =SERS
tales'ace/
RMA<; report schema;
Re$or& of %a&abase sche)a for %a&abase E*&h %b_!n*B!e_na)e
ORCL
L*s& of -er)anen& Da&af*les
===========================
A*le S*He5M>6 Tables$ace R> se4s Da&af*le <a)e
9999 99999999 99999999999999999999 9999999 9999999999999999999
99999
# C7" S@STEM @ES
JDATAorcl%a&af*les3s&e)'(FC'C2(IF0FFI
( F2" S@SA=O <O
JDATAorcl%a&af*les3sa!G'(FI'C2(IF0FF2
1 #"" =<DOT>S# @ES
JDATAorcl%a&af*le!n%o&bs#'(F7'C2(IF0FC#
0 F =SERS <O
JDATAorcl%a&af*le!sers'(F2'C2(IF0FC#
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-*: !isting +ac,u- 'i(es and Creating Archiva( +ac,u-
$continued%
Oracle Database 11g: Administration Workshop II A ; 01
F #"" EOAM-LE <O
JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
L*s& of Te)$orar3 A*les
=======================
A*le S*He5M>6 Tables$ace MaGs*He5M>6 Te)$f*le <a)e
9999 99999999 99999999999999999999 99999999999 999999999999999
99999
# (7 TEM- 1(ICI
JDATAorcl&e)$f*le&e)$'(C0'C2(IF07(F
RMA<;
&ote that the -ile in "uestion is data -ile numer 0/
@ %ist any image co'ies o- data -ile numer 0/
RMA<; list copy of datafile 9;
s$ec*f*ca&*on %oes no& )a&ch an3 %a&af*le co$3 *n &he re$os*&or3
RMA<;
&ote that? in this case? there is no image co'y o- this -ile/
4@ !elete any data -ile 0 image co'ies that eDist/
Note$ You may not ha*e any/
RMA<; delete copy of datafile 9;
release% channel. ORA_DISL_#
release% channel. ORA_S>T_TA-E_#
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=#"F %ev*ce &3$e=DISL
L*s& of Da&af*le Co$*es
=======================
Le3 A*le S Co)$le&*on T*)e CP$ SC< CP$ T*)e
9999999 9999 9 9999999999999999999 9999999999 9999999999999999
999
##F 0 A (""29"F9(I.(#."7.0F #2#I#"7 (""29"F9
(I.(".F".FI
<a)e. &)$!sers_co$3'%a&
Do 3o! reall3 Ean& &o %ele&e &he above obVec&s 5en&er @ES or
<O6? 3es
RMA<; list copy of datafile 9;
s$ec*f*ca&*on %oes no& )a&ch an3 %a&af*le co$3 *n &he
re$os*&or3
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-*: !isting +ac,u- 'i(es and Creating Archiva( +ac,u-
$continued%
Oracle Database 11g: Administration Workshop II A ; 0!
RMA<;
;@ To sim'li-y your training en*ironment? disale control -ile autoacku' -or the neDt
-ew ste's/
RMA<; configure controlfile autobac-up off;
ol% RMA< conf*4!ra&*on $ara)e&ers.
CO<AID=RE CO<TROLAILE A=TO>ACL=- O<M
neE RMA< conf*4!ra&*on $ara)e&ers.
CO<AID=RE CO<TROLAILE A=TO>ACL=- OAAM
neE RMA< conf*4!ra&*on $ara)e&ers are s!ccessf!ll3 s&ore%
s&ar&*n4 f!ll res3nc of recover3 ca&alo4
f!ll res3nc co)$le&e
RMA<;
8@ Make an image -ile acku' o- data -ile 0/
RMA<; bac-up as copy datafile 9;
S&ar&*n4 bacP!$ a& (""29"I9(#.(".(I.(F
release% channel. ORA_S>T_TA-E_#
!s*n4 channel ORA_DISL_#
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""0
na)e=JDATAorcl%a&af*le!sers'(F2'C2(IF0FC#
o!&$!& f*le na)e=JARAorcl%a&af*le!sers'(I0'C2(7(770F
&a4=TAD(""2"I(#T("(I(F RECID=( STAM-=C2(7(7702
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e.
"".""."I
A*n*she% bacP!$ a& (""29"I9(#.(".(I.1(
RMA<;
:@ Make another image co'y o- the data -ile? ut make this one an archi*al acku'/
RMA<; bac-up as copy datafile 9 -eep forever;
S&ar&*n4 bacP!$ a& (""29"I9(#.(".(7.1"
c!rren& lo4 arch*ve%
!s*n4 channel ORA_DISL_#
bacP!$ E*ll never be obsole&e
arch*ve% lo4s reB!*re% &o recover fro) &h*s bacP!$ E*ll be
bacPe% !$
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""0
na)e=JDATAorcl%a&af*le!sers'(F2'C2(IF0FC#
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-*: !isting +ac,u- 'i(es and Creating Archiva( +ac,u-
$continued%
Oracle Database 11g: Administration Workshop II A ; 0+
RMA<9""FI#.
===========================================================
RMA<9""FC2. =============== ERROR MESSADE STACL AOLLO:S
===============
RMA<9""FI#.
===========================================================
RMA<9"1""(. fa*l!re of bacP!$ co))an% a& "I(#(""2 (".(7.10
ORA9#27##. canno& have f*les *n D>_RECO?ER@_AILE_DEST E*&h
Pee$ a&&r*b!&es
RMA<;
&ote that the acku' command -ailed/ This is ecause a acku' with the LEE-
attriute Ban archi*al acku'@ cannot e written to the Flash )eco*ery Area/ Allowing
this has the 'otential o- causing the Flash )eco*ery Area to "uickly run out o- s'ace?
-orcing you to s'eci-y a di--erent location/
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-*: !isting +ac,u- 'i(es and Creating Archiva( +ac,u-
$continued%
Oracle Database 11g: Administration Workshop II A ; 0.
.<@ Create an archi*al acku' with a AORMAT clause that causes the acku' to e
written to the &)$ directory/
RMA<; bac-up -eep forever as copy datafile 9 format
2/tmp/bu_Hd_Hs_Hp.dbf2;
S&ar&*n4 bacP!$ a& (""29"I9(#.(".1#.#0
c!rren& lo4 arch*ve%
!s*n4 channel ORA_DISL_#
bacP!$ E*ll never be obsole&e
arch*ve% lo4s reB!*re% &o recover fro) &h*s bacP!$ E*ll be
bacPe% !$
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""0
na)e=JDATAorcl%a&af*le!sers'(F2'C2(IF0FC#
o!&$!& f*le na)e=&)$b!_ORCL_#I_#'%bf &a4=TAD(""2"I(#T("1##0
RECID=1 STAM-=C2(7(2"II
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e.
"".""."1
'
'
'
$*ece han%le=&)$b!_ORCL_("_#'%bf &a4=TAD(""2"I(#T("1##0
co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e.
"".""."#
A*n*she% bacP!$ a& (""29"I9(#.(".1#.(2
RMA<;
..@ $ee i- there are any osolete acku's/ B(- you re'eat 'ractice ste's you might ha*e
osolete ones/@
RMA<; report obsolete;
RMA< re&en&*on $ol*c3 E*ll be a$$l*e% &o &he co))an%
RMA< re&en&*on $ol*c3 *s se& &o re%!n%anc3 #
no obsole&e bacP!$s fo!n%
RMA<;
.1@ Create another Bnonarchi*e@ acku' o- data -ile 0/
RMA<; bac-up as copy datafile 9;
S&ar&*n4 bacP!$ a& (""29"I9(#.(".11.F(
!s*n4 channel ORA_DISL_#
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-*: !isting +ac,u- 'i(es and Creating Archiva( +ac,u-
$continued%
Oracle Database 11g: Administration Workshop II A ; 00
*n$!& %a&af*le f*le n!)ber=""""0
na)e=JDATAorcl%a&af*le!sers'(F2'C2(IF0FC#
o!&$!& f*le na)e=JARAorcl%a&af*le!sers'(C#'C2(7(2(11
&a4=TAD(""2"I(#T("11F( RECID=0 STAM-=C2(7(2(11
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e.
"".""."#
A*n*she% bacP!$ a& (""29"I9(#.(".11.F0
RMA<;
.9@ )e'ort on the osolete acku's/
RMA<; report obsolete;
RMA< re&en&*on $ol*c3 E*ll be a$$l*e% &o &he co))an%
RMA< re&en&*on $ol*c3 *s se& &o re%!n%anc3 #
Re$or& of obsole&e bacP!$s an% co$*es
T3$e Le3 Co)$le&*on T*)e A*lena)eHan%le
99999999999999999999 999999 999999999999999999 999999999999999
99999
Da&af*le Co$3 102 (""29"I9(#.(".(I.(2
JARAorcl%a&af*le!sers'(I0'C2(7(770F
RMA<;
&ote that the -irst acku' taken is now osolete/
.0@ For an alternate *iew o- the acku's? in 6M? na*igate to A*ailaility I Manage
Current Backu's I (mage Co'ies/
.3@ 6nsure that the username and 'assword o- oracleLoracle are in the host
credentials section at the ottom o- the 'age? and then at the u''er+right corner o- the
'age? click !elete All 7solete/
.4@ Ahen the $'eci-y Jo Parameters 'age a''ears? click $how )MA& $cri't/
&ote that the scri't issues the DELETE <O-ROM-T O>SOLETE command/ Click 7#/
.;@ Click $umit Jo/
.8@ A-ter the ,o is sumitted? click View Jo/
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-*: !isting +ac,u- 'i(es and Creating Archiva( +ac,u-
$continued%
Oracle Database 11g: Administration Workshop II A ; 02
.:@ Ahen the ,o status is )unning? use your rowserNs )eload utton until the ,o status
a''ears as $ucceeded/ Then na*igate ack to the acku' listing 'age -or image co'ies
B!ataase I A*ailaility I Manage Current Backu's I (mage Co'ies@/
1<@ &ote that there are now only two acku's o- data -ile 0/ The osolete one has een
deleted ecause it was the third o- three? and the retention 'olicy is set to .? meaning
there need only e two acku's o- any gi*en -ile/ B)ememer the archi*al acku' is
not counted/@
1.@ Click the Backu' $ets ta on this 'age/ Ahat archi*al acku' sets a''ear thereC Ahy
are they thereC
Oracle Internal & Oracle cadem! "#e Onl!
Practice /-*: !isting +ac,u- 'i(es and Creating Archiva( +ac,u-
$continued%
Oracle Database 11g: Administration Workshop II A ; 03
Answer: These archi*al acku' sets are here ecause they were taken as a y'roduct
o- taking the data -ile image co'y as an archi*al acku'/ Ahen the data -ile archi*al
acku' was taken? control -ile autoacku' was enaled? which causes the control -ile
and the $PF(%6 to e acked u'/ Also? any archi*e redo logs that are re"uired to
reco*er the image co'y are taken/ Because the image co'y was an archi*al acku'?
e*ery other -ile that is acked u' as a 'art o- that acku' task is also an archi*al
acku'/
11@ 6nale the automatic acku' o- the control -ile again and eDit )MA&/
RMA<; configure controlfile autobac-up on;
RMA<; exit
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 05
4ractices %or :esson 2
Practice 4-1: +ac,ing u- the Database
(n this 'ractice? you create a cold acku' o- the rca& dataase/
Because A$M does not eD'ose its -iles to the o'erating system? you create acku's to a
regular -ile system destination? so that you can setu' *arious learning situations in the
-ollowing 'ractices/
&ote2 The RCAT dataase is in the A)C5(V6 log mode? and is ca'ale o- 'er-orming
an inconsistent acku'/ (n this eDercise though? you will 'er-orm a consistent cold
acku'/
.@ Create the ho)eoracle>ACL=- directory to hold acku' -iles/
$ cd
$ pwd
ho)eoracle
$ m-dir *(C+),
1@ Make sure that your en*ironment is 'ointing at the rca& dataase/
$. oraenv
ORACLE_SID = [JASM] ? rcat
The Oracle base for
ORACLE_HOME=!"#a$$oracle$ro%!c&##'('"%bho)e_# *s
!"#a$$oracle
$
9@ $hut down the dataase with the IMMEDIATE o'tion? then mount it/
$ sqlplus / as sysdba
S+L; shutdown immediate
Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
S+L; startup mount
ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 1#7"0C("7 b3&es
A*Ge% S*He #11C(00 b3&es
?ar*able S*He (F#CC#177 b3&es
Da&abase >!ffers F7I("(FC b3&es
Re%o >!ffers C1(71(" b3&es
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-1: +ac,ing u- the Database $continued%
Oracle Database 11g: Administration Workshop II A ; 06
Da&abase )o!n&e%'
S+L; exit
0@ Make a whole dataase image co'y acku' into the $HOME/BACKUP directory
using )MA& commands/
$ rman target /
Recover3 Mana4er. Release ##'('"'#'" 9 -ro%!c&*on on T!e /!l (#
((.(C.11 (""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle an%or *&s aff*l*a&es' All r*4h&s
reserve%'
connec&e% &o &ar4e& %a&abase. RCAT 5D>ID=0C02F2I2F8 no& o$en6
RMA<; bac-up database format 2/home/oracle/*(C+),/cold_H)2;
S&ar&*n4 bacP!$ a& (""29"I9(2."7.##.#(
!s*n4 &ar4e& %a&abase con&rol f*le *ns&ea% of recover3 ca&alo4
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=# %ev*ce &3$e=DISL
channel ORA_DISL_#. s&ar&*n4 f!ll %a&af*le bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""#
na)e=JDATArca&%a&af*les3s&e)'(CI'C2(21F1F1
*n$!& %a&af*le f*le n!)ber=""""(
na)e=JDATArca&%a&af*les3sa!G'(C7'C2(21F1FI
*n$!& %a&af*le f*le n!)ber=""""1
na)e=JDATArca&%a&af*le!n%o&bs#'(C2'C2(21F1FI
*n$!& %a&af*le f*le n!)ber=""""F
na)e=JDATArca&%a&af*lerca&'(II'C2(21I""1
*n$!& %a&af*le f*le n!)ber=""""0
na)e=JDATArca&%a&af*le!sers'(I"'C2(21F1F2
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (""29"I9(2."7.##.#1
channel ORA_DISL_#. f*n*she% $*ece # a& (""29"I9(2."7.#1."7
$*ece han%le=ho)eoracle>ACL=-col%_"fPlbCh#_#_#
&a4=TAD(""2"I(2T"7###1 co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e. ""."#.FF
A*n*she% bacP!$ a& (""29"I9(2."7.#1."7
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"I9(2."7.#1."2
$*ece han%le=JARArca&a!&obacP!$(""2_"I_(2s_C210IF"0"'11"'C210IF22#
co))en&=<O<E
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"I9(2."7.#1.#C
RMA<; exit
3@ 7'en the RCAT dataase/
$ ' oraenv
ORACLE_SID = [rca&] ? rcat
sqlplus / as sysdba
S+L; alter database open;
Da&abase al&ere%'
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-1: +ac,ing u- the Database $continued%
Oracle Database 11g: Administration Workshop II A ; 2"
4@ =se the ALTER DATABASE command to ack u' the control -ile as a trace -ile/
S+L; alter database bac-up controlfile to trace as
2/home/oracle/*(C+),/trace_control.bc-2;
Da&abase al&ere%'
S+L; exit
;@ View the content o- the ho)eoracle>ACL=-
$ ls Il /home/oracle/*(C+),
directory/
&o&al ##""FC7
9rE9r99999 # oracle %ba ##(F7CIF(" /!l (2 "7.#( col%_"fPlbCh#_#_#
9rE9r99r99 # oracle %ba CC"# /!l (2 "7.#7 &race_con&rol'bcP
$
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 21
Practice 4-2: Recovering fro2 the !oss of a Data 'i(e
Because A$M does not eD'ose its -iles to the o'erating system? you create tales'aces
with data -iles in a regular -ile system destination? so that you can setu' *arious learning
situations in the -ollowing 'ractices/
(n the ORCL dataase? you create the >R_T>S tales'ace with the C=STOMERS
.@ %og into the ORCL instance with $>%EPlus as the S@S user/
tale/
$ . oraenv
ORACLE_SID = [rca&] ? orcl
$ sqlplus / as sysdba
S+L;
1@ Create the >R_T>S tales'ace with the C=STOMERS
S+L; C#'("' "(*$'0,(C' br_tbs
tale/
1("(%&$' 2/home/oracle/*(C+),/br4/.dbf2 0&5' =.6;
Tables$ace crea&e%'
S+L; C#'("' "(*$' customers tablespace br_tbs
(0 0'$'C" J %#6 sh.customers;
Table crea&e%'
S+L;
9@ Find out the numer o- your new data -ile and ack u' the data -iles to the
ho)eoracle>ACL=-
$ . oraenv
directory/ BYou might -ind it use-ul to kee' the $>%EPlus
window o'en and start the )MA& session in another terminal window? ut it is not
mandatory/@
ORACLE_SID = [JASM] ? orcl
$ rman target / catalog rcatowner<rcat
connec&e% &o &ar4e& %a&abase. ORCL 5D>ID=#(("F1F07"6
recover3 ca&alo4 %a&abase -assEor%. oracle_9) <<<not displayed
connec&e% &o recover3 ca&alo4 %a&abase
RMA<; report schema;
s&ar&*n4 f!ll res3nc of recover3 ca&alo4
f!ll res3nc co)$le&e
Re$or& of %a&abase sche)a for %a&abase E*&h %b_!n*B!e_na)e ORCL
L*s& of -er)anen& Da&af*les
===========================
A*le S*He5M>6 Tables$ace R> se4s Da&af*le <a)e
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-2: Recovering fro2 the !oss of a Data 'i(e $continued%
Oracle Database 11g: Administration Workshop II A ; 2!
9999 99999999 99999999999999999999 9999999 9999999999999999999999
# C2" S@STEM @ES
JDATAorcl%a&af*les3s&e)'(FC'C2(IF0FFI
( C#" S@SA=O <O
JDATAorcl%a&af*les3sa!G'(FI'C2(IF0FF2
1 #"" =<DOT>S# @ES
JDATAorcl%a&af*le!n%o&bs#'(F7'C2(IF0FC#
0 F =SERS <O
JDATAorcl%a&af*le!sers'(F2'C2(IF0FC#
F #"" EOAM-LE <O
JDATAorcl%a&af*leeGa)$le'(CF'C2(IF071I
C (F >R_T>S <O
ho)eoracle>ACL=-br"#'%bf
L*s& of Te)$orar3 A*les
=======================
A*le S*He5M>6 Tables$ace MaGs*He5M>6 Te)$f*le <a)e
9999 99999999 99999999999999999999 99999999999 999999999999999999
99
# (7 TEM- 1(ICI
JDATAorcl&e)$f*le&e)$'(C0'C2(IF07(F
RMA<; bac-up as copy datafile K format
2/home/oracle/*(C+),/br_Hd_Hs_Hp.dbf2;
S&ar&*n4 bacP!$ a& (""29"I9(2."7.17.0I
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=(2 %ev*ce &3$e=DISL
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""C
na)e=ho)eoracle>ACL=-br"#'%bf
o!&$!& f*le na)e=ho)eoracle>ACL=-br_ORCL_((_#'%bf
&a4=TAD(""2"I(2T"71707 RECID=F STAM-=C210IIF1"
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e.
"".""."1
A*n*she% bacP!$ a& (""29"I9(2."7.17.F#
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"I9
(2."7.17.F#
$*ece
han%le=JARAorcla!&obacP!$(""2_"I_(2s_C210IIF11'11('C210IIF1F
co))en&=<O<E
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"I9
(2."7.17.F0
RMA<;
0@ To simulate the 'assage o- time? and to make sure that this data is not cached in the
u--er cache? 'er-orm the -ollowing ste's and eDit -rom $>%EPlus/
S+L; alter system switch logfile;
S3s&e) al&ere%M
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-2: Recovering fro2 the !oss of a Data 'i(e $continued%
Oracle Database 11g: Administration Workshop II A ; 2+
S+L; alter system chec-point;
S3s&e) al&ere%'
S+L; alter system switch logfile;
S3s&e) al&ere%
S+L; exit
3@ !elete the data -ile elonging to the >R_T>S tales'ace Bnot the acku'@/
$ cd ~/*(C+),
$ ls Il brJ
9rE9r99999 # oracle %ba (C(((F2( /!l (( (".FI br"#'%bf
9rE9r99999 # oracle %ba (C(((F2( /!l (( (".F( br_ORCL_((_#'%bf
$ rm br4/.dbf
$ ls Il brJ
9rE9r99999 # oracle %ba (C(((F2( /!l (( (".F( br_ORCL_((_#'%bf
$
4@ &ow log ack in to the dataase? -lush the u--er cache and try to access the data in
the C=STOMERS tale/
$ sqlplus / as sysdba
S+L; alter system flush buffer_cache;
S3s&e) al&ere%'
S+L; select countEJF from sys.customers;
selec& co!n&5,6 fro) s3s'c!s&o)ers
ERROR a& l*ne #.
ORA9"###C. error *n o$en*n4 %a&abase f*le C
ORA9"###". %a&a f*le C. Sho)eoracle>ACL=-br"#'%bfS
ORA9(I"0#. !nable &o o$en f*le
L*n!G Error. (. <o s!ch f*le or %*rec&or3
A%%*&*onal *nfor)a&*on. 1
;@ #nowing you are going to ha*e to restore this -ile? you now take it o--line? and eDit
-rom $>%EPlus/
S+L; alter database datafile K offline;
Da&abase al&ere%'
S+L; exit
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-2: Recovering fro2 the !oss of a Data 'i(e $continued%
Oracle Database 11g: Administration Workshop II A ; 2.
8@ &ow na*igate to your $HOME>ACL=- directory? to -ind what acku's you ha*e o-
the data -ile/ Then choose the most recent? and co'y YOUR -ile into where the li*e
one should e/
$ cd /home/oracle/*(C+),/
$ ls Aal
&o&al ##(C(#C
%rEGr9Gr9G ( oracle o*ns&all 0"2C /!l (2 "7.0( '
%rEGrEGrEG (0 oracle o*ns&all 0"2C /!l (2 "7."( ''
9rE9r99999 # oracle %ba (C(((F2( /!l (2 "7.17 br_ORCL_((_#'%bf
9rE9r99999 # oracle %ba ##(F7CIF(" /!l (2 "7.#( col%_"fPlbCh#_#_#
9rE9r99r99 # oracle %ba CC"# /!l (2 "7.#7 &race_con&rol'bcP
$ cp br_ORCL_22_)"b# br4/.dbf
$ ls Il
9rE9r99999 # oracle o*ns&all (C(((F2( /!l (2 "7.17 br"#'%bf
9rE9r99999 # oracle %ba (C(((F2( /!l (2 "7.17 br_ORCL_((_#'%bf
9rE9r99999 # oracle %ba ##(F7CIF(" /!l (2 "7.#( col%_"fPlbCh#_#_#
9rE9r99r99 # oracle %ba CC"# /!l (2 "7.#7 &race_con&rol'bcP
:@ &ow log in to $>%EPlus and try to ring the -ile online/
$ sqlplus / as sysdba
S+L; alter database datafile K online;
al&er %a&abase %a&af*le C onl*ne
,
ERROR a& l*ne #.
ORA9"###1. f*le C nee%s )e%*a recover3
ORA9"###". %a&a f*le C. Sho)eoracle>ACL=-br"#'%bfS
.<@ The data -ile cannot e rought online as it is too old and? there-ore? you need to
'er-orm media reco*ery to roll it -orward/
S+L; recover datafile K;
Me%*a recover3 co)$le&e'
S+L;
..@ &ow try to ring the data -ile online/
S+L; alter database datafile K online;
Da&abase al&ere%'
.1@ Try again to access the s3s'c!s&o)ers tale? and then eDit $>%EPlus/
S+L; select countEJF from sys.customers;
CO=<T5,6
9999999999
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-2: Recovering fro2 the !oss of a Data 'i(e $continued%
Oracle Database 11g: Administration Workshop II A ; 20
FFF""
S+L; exit
.9@ For the ORCL dataase? con-irm that the control -ile is automatically acked u' and
that the acku' rentention is set to . Bi- not? modi-y it@? take a dataase acku' and
delete osolete -iles Bin 're'aration -or the -ollowing 'ractices@/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
$ rman target / catalog rcatowner<rcat
connec&e% &o &ar4e& %a&abase. ORCL 5D>ID=#(("F1F07"6
recover3 ca&alo4 %a&abase -assEor%. oracle_9) KKKno& %*s$la3e%
connec&e% &o recover3 ca&alo4 %a&abase
RMA<; show retention policy;
RMA< conf*4!ra&*on $ara)e&ers for %a&abase E*&h %b_!n*B!e_na)e
ORCL are.
CO<AID=RE RETE<TIO< -OLIC@ TO RED=<DA<C@ #M N %efa!l&
RMA<;
RMA<; bac-up database;
S&ar&*n4 bacP!$
'
'
'
RMA<;
RMA<; delete noprompt obsolete;
RMA< re&en&*on $ol*c3 E*ll be a$$l*e% &o &he co))an%
'
'
'
RMA<; exit
$
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 22
Practice 4-*: Recovering fro2 the !oss of a(( Contro( 'i(es
This 'ractice makes use o- the ORCL dataase and the reco*ery catalog/ You will simulate
the loss o- all control -iles? and then restore the control -iles and reco*er the dataase/
.@ Connect to the 7)C% dataase and make a inary acku' o- the control -ile/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
$ sqlplus / as sysdba
S+L; alter database bac-up controlfile to
2/home/oracle/*(C+),/ctrl.b-p2;
Da&abase al&ere%'
1@ (denti-y the current control -iles -or the ORCL dataase/ You need to know them in
one o- the -ollowing tasks/ Then shutdown the ORCL
S+L; select name from vLcontrolfile;
dataase to allow the control
-iles to e deleted and eDit $>%EPlus/
<AME
9999999999999999999999999999999999999999999999
JDATAorclcon&rolf*lec!rren&'(C"'C2(7I2C2#
JARAorclcon&rolf*lec!rren&'(FC'C2(7I2C2#
S+L; shutdown immediate;
Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
S+L; exit
9@ $et the en*ironment to the A$M instance and run the as)c)%
Note$ The names o- your control -iles may e di--erent/ !elete YOUR control -iles/
utility to delete the two
control -iles identi-ied ao*e/
$ . oraenv
ORACLE_SID = [orcl] ? 3(06
The Oracle base for
ORACLE_HOME=!"#a$$oracle$ro%!c&##'('"4r*% *s
!"#a$$oracle
$ asmcmd rm 31("(/orcl/controlfile/current.2*0)*92(79*9
$ asmcmd rm 3%#(/orcl/controlfile/current.2&*)*92(79*9
0@ $et the en*ironment ack to the 7)C% dataase and attem't to start u' the dataase/
$ . oraenv
ORACLE_SID = [JASM] ? orcl
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-*: Recovering fro2 the !oss of a(( Contro( 'i(es
$continued%
Oracle Database 11g: Administration Workshop II A ; 23
The Oracle base for
ORACLE_HOME=!"#a$$oracle$ro%!c&##'('"%bho)e_# *s
!"#a$$oracle
$ sqlplus / as sysdba
S+L,-l!s. Release ##'('"'#'" -ro%!c&*on on :e% /!l (2 #"."1.FF
(""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle' All r*4h&s reserve%'
Connec&e% &o an *%le *ns&ance'
S+L; startup
ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 0#7070((0 b3&es
A*Ge% S*He #11C2"7 b3&es
?ar*able S*He (C701I20" b3&es
Da&abase >!ffers #0(C"C11C b3&es
Re%o >!ffers C#"1"0" b3&es
ORA9""("F. error *n *%en&*f3*n4 con&rol f*le8 checP aler& lo4 for
)ore *nfo
S+L; exit
3@ =sing )MA&? connect to the ORCL target dataase? to the RCAT catalog dataase?
and restore the control -ile -rom the autoacku'/
$ rman target / catalog rcatowner<rcat
Recover3 Mana4er. Release ##'('"'#'" 9 -ro%!c&*on on :e% /!l (2
#"."C.(( (""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle an%or *&s aff*l*a&es' All
r*4h&s reserve%'
connec&e% &o &ar4e& %a&abase. ORCL 5no& )o!n&e%6
recover3 ca&alo4 %a&abase -assEor%. oracle_9) <<<not displayed
connec&e% &o recover3 ca&alo4 %a&abase
RMA<; restore controlfile from autobac-up;
S&ar&*n4 res&ore a& (""29"I9(2.#"."C.07
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=(I %ev*ce &3$e=DISL
recover3 area %es&*na&*on. JARA
%a&abase na)e 5or %a&abase !n*B!e na)e6 !se% for search. ORCL
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-*: Recovering fro2 the !oss of a(( Contro( 'i(es
$continued%
Oracle Database 11g: Administration Workshop II A ; 25
channel ORA_DISL_#. A=TO>ACL=-
JfraORCLA=TO>ACL=-(""2_"I_(2s_C210I777F'11F'C210I777F fo!n%
*n &he recover3 area
channel ORA_DISL_#. looP*n4 for A=TO>ACL=- on %a3. (""2"I(2
channel ORA_DISL_#. res&or*n4 con&rol f*le fro) A=TO>ACL=-
JfraORCLA=TO>ACL=-(""2_"I_(2s_C210I777F'11F'C210I777F
channel ORA_DISL_#. con&rol f*le res&ore fro) A=TO>ACL=- co)$le&e
o!&$!& f*le na)e=JDATAorclcon&rolf*lec!rren&'(C"'C2107(7##
o!&$!& f*le na)e=JARAorclcon&rolf*lec!rren&'(FC'C2107(7#1
A*n*she% res&ore a& (""29"I9(2.#"."C.F0
4@ Mount the restored control -ile and attem't to o'en the dataase/
RMA<; alter database mount;
%a&abase )o!n&e%
release% channel. ORA_DISL_#
RMA<; alter database open resetlogs;
RMA<9""FI#.
===========================================================
RMA<9""FC2. =============== ERROR MESSADE STACL AOLLO:S
===============
RMA<9""FI#.
===========================================================
RMA<9"1""(. fa*l!re of al&er %b co))an% a& "I(2(""2 #"."7.0F
ORA9"##F(. f*le # Eas no& res&ore% fro) a s!ff*c*en&l3 ol% bacP!$
ORA9"###". %a&a f*le #.
SJDATAorcl%a&af*les3s&e)'(FC'C2(7I2F"1S
;@ Because the control -iles ha*e een restored? the dataase must e reco*ered/
RMA<; recover database;
S&ar&*n4 recover a& (""29"I9(2.#"."7.F7
S&ar&*n4 *)$l*c*& crosschecP bacP!$ a& (""29"I9(2.#"."7.F7
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=(I %ev*ce &3$e=DISL
CrosschecPe% #( obVec&s
A*n*she% *)$l*c*& crosschecP bacP!$ a& (""29"I9(2.#"."2.""
S&ar&*n4 *)$l*c*& crosschecP co$3 a& (""29"I9(2.#"."2.""
!s*n4 channel ORA_DISL_#
CrosschecPe% 0 obVec&s
A*n*she% *)$l*c*& crosschecP co$3 a& (""29"I9(2.#"."2."#
search*n4 for all f*les *n &he recover3 area
ca&alo4*n4 f*les'''
ca&alo4*n4 %one
L*s& of Ca&alo4e% A*les
=======================
A*le <a)e.
JfraORCLA=TO>ACL=-(""2_"I_(2s_C210I777F'11F'C210I777F
!s*n4 channel ORA_DISL_#
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-*: Recovering fro2 the !oss of a(( Contro( 'i(es
$continued%
Oracle Database 11g: Administration Workshop II A ; 26
s&ar&*n4 )e%*a recover3
arch*ve% lo4 for &hrea% # E*&h seB!ence F2 *s alrea%3 on %*sP as
f*le JDATAorclonl*nelo44ro!$_('(C('C2(7I2I"I
arch*ve% lo4 f*le na)e=JDATAorclonl*nelo44ro!$_('(C('C2(7I2I"I
&hrea%=# seB!ence=F2
)e%*a recover3 co)$le&e8 ela$se% &*)e. "".""."#
A*n*she% recover a& (""29"I9(2.#"."2."F
8@ Attem't to o'en the dataase with the RESETLODS o'tion a-ter reco*ery/
RMA<; alter database open resetlogs;
%a&abase o$ene%
neE *ncarna&*on of %a&abase re4*s&ere% *n recover3 ca&alo4
s&ar&*n4 f!ll res3nc of recover3 ca&alo4
f!ll res3nc co)$le&e
:@ Per-orm a -ull dataase acku' and delete osolete -iles to e 're'ared -or -uture las/
RMA<; bac-up database;
S&ar&*n4 bacP!$ a& (""29"I9(2.#".02.(#
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=0C %ev*ce &3$e=DISL
channel ORA_DISL_#. s&ar&*n4 f!ll %a&af*le bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""(
na)e=JDATAorcl%a&af*les3sa!G'(FI'C2(7I2F"F
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (""29"I9(2.#".02.((
channel ORA_DISL_#. f*n*she% $*ece # a& (""29"I9(2.#".F".#7
$*ece
han%le=JARAorclbacP!$se&(""2_"I_(2nnn%f"_&a4(""2"I(2&#"02((_"
'10"'C2107F1C1 &a4=TAD(""2"I(2T#"02(( co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e. ""."".FC
channel ORA_DISL_#. s&ar&*n4 f!ll %a&af*le bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""#
na)e=JDATAorcl%a&af*les3s&e)'(FC'C2(7I2F"1
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (""29"I9(2.#".F".((
channel ORA_DISL_#. f*n*she% $*ece # a& (""29"I9(2.#".F(."0
$*ece
han%le=JARAorclbacP!$se&(""2_"I_(2nnn%f"_&a4(""2"I(2&#"02((_"
'10#'C2107F0(F &a4=TAD(""2"I(2T#"02(( co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e. ""."#.0(
channel ORA_DISL_#. s&ar&*n4 f!ll %a&af*le bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""C
na)e=ho)eoracle>ACL=-br"#'%bf
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-*: Recovering fro2 the !oss of a(( Contro( 'i(es
$continued%
Oracle Database 11g: Administration Workshop II A ; 3"
*n$!& %a&af*le f*le n!)ber=""""1
na)e=JDATAorcl%a&af*le!n%o&bs#'(F7'C2(7I2F"I
*n$!& %a&af*le f*le n!)ber=""""0
na)e=JDATAorcl%a&af*le!sers'(F2'C2(7I2F"2
*n$!& %a&af*le f*le n!)ber=""""F
na)e=JDATAorcl%a&af*leeGa)$le'(CF'C2(7I2ICF
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (""29"I9(2.#".F(.##
channel ORA_DISL_#. f*n*she% $*ece # a& (""29"I9(2.#".F(.FI
$*ece
han%le=JARAorclbacP!$se&(""2_"I_(2nnn%f"_&a4(""2"I(2&#"02((_"
'10('C2107FF1I &a4=TAD(""2"I(2T#"02(( co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e. ""."".0C
A*n*she% bacP!$ a& (""29"I9(2.#".F(.FI
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"I9
(2.#".F(.FI
$*ece
han%le=JARAorcla!&obacP!$(""2_"I_(2s_C2107FF72'101'C2107FC"1
co))en&=<O<E
A*n*she% Con&rol A*le an% S-AILE a!&obacP!$ a& (""29"I9(2.#".F1
RMA<; delete noprompt obsolete;
. . .
RMA<; exit
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 31
Practice 4-.: Recovering fro2 the !oss of a Redo !og #rou-
This 'ractice makes use o- the ORCL dataase/ You will delete the current redo log -iles?
and see the e--ect this has on the dataase/
.@ %og in to the ORCL dataase using $>%EPlus? and run the re%o_v*eE'sBl
$ sqlplus / as sysdba
"uery to
gather in-ormation aout your redo logs/
S+L; <redo_view.sql
S+L; se& l*nes*He #("
S+L; col )e)ber for)a& a01
S+L; col s&a&!s for)a& a#"
S+L; selec& l'4ro!$N8 l'seB!enceN8 l'arch*ve%8
( l's&a&!s8 f')e)ber
1 fro) v$lo4 l8 v$lo4f*le f
0 Ehere l'4ro!$N=f'4ro!$NM
DRO=-N SE+=E<CEN ARC STAT=S MEM>ER
9999999999 9999999999 999 9999999999 9999999999999999999999999999
999999999999999
1 " @ES =<=SED
JDATAorclonl*nelo44ro!$_1'(C1'C2(7I2I(#
1 " @ES =<=SED
JARAorclonl*nelo44ro!$_1'(F2'C2(7I2I(I
( " @ES =<=SED
JDATAorclonl*nelo44ro!$_('(C('C2(7I2I"I
( " @ES =<=SED
JARAorclonl*nelo44ro!$_('(F7'C2(7I2I#F
# # <O C=RRE<T
JDATAorclonl*nelo44ro!$_#'(C#'C2(7I2C21
# # <O C=RRE<T
JARAorclonl*nelo44ro!$_#'(FI'C2(7I2I"#
C roEs selec&e%'
S+L;
1@ From this it can e seen in our eDam'le that log grou' . is the current log grou'/
Your current redo log grou' may e di--erent -rom the one shown/ &ote the eDact
grou' names o- your current grou'/ You need the names during the neDt ste'/
!etermine the current redo log grou' -or your dataase? and then delete its memer -iles
with the as)c)% utility/ You must shutdown the dataase in order to delete -iles that are
in use in an A$M disk grou'/
S+L; shutdown immediate
Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-.: Recovering fro2 the !oss of a Redo !og #rou-
$continued%
Oracle Database 11g: Administration Workshop II A ; 3!
S+L; exit
$ . oraenv
ORACLE_SID = [orcl] ? 3(06
The Oracle base for
ORACLE_HOME=!"#a$$oracle$ro%!c&##'('"4r*% *s
!"#a$$oracle
$ asmcmd rm 31("(/orcl/onlinelog/group_/.=K/.KM=@NMKM?
$ asmcmd rm 3%#(/orcl/onlinelog/group_/.=.N.KM=@NMN4/
9@ Attem't to start the ORCL dataase and oser*e what ha''ens/ Then eDit your
$>%EPlus session/
$ . oraenv
ORACLE_SID = [JASM] ? orcl
The Oracle base for
ORACLE_HOME=!"#a$$oracle$ro%!c&##'('"%bho)e_# *s
!"#a$$oracle
$ sqlplus / as sysdba
S+L,-l!s. Release ##'('"'#'" -ro%!c&*on on T!e A!4 0 "1."I.07
(""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle' All r*4h&s reserve%'
Connec&e% &o an *%le *ns&ance'
S+L; startup
ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 07#(F2F(" b3&es
A*Ge% S*He #11I1F( b3&es
?ar*able S*He 0##"0171( b3&es
Da&abase >!ffers C(2#0FC" b3&es
Re%o >!ffers F2C1IIC b3&es
Da&abase )o!n&e%'
ORA9"1##1. en%9of9f*le on co))!n*ca&*on channel
-rocess ID. (200F
Sess*on ID. # Ser*al n!)ber. F
S+L; exit
0@ !is'lay the last section o- the alert log to -ind out more details related to the -ailure in
starting the ORCL instance/
$ tail /u4//app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log
ORA9#F"#(. ASM f*le SJARAorclonl*nelo44ro!$_#'(FI'C2(7I2I"#S
%oes no& eG*s&
ORA9""1#(. onl*ne lo4 # &hrea% #.
SJDATAorclonl*nelo44ro!$_#'(C#'C2(7I2C21S
ORA9#IF"1. Psf%o$n.( Aa*le% &o o$en f*le
JDATAorclonl*nelo44ro!$_#'(C#'C2(7I2C21
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-.: Recovering fro2 the !oss of a Redo !og #rou-
$continued%
Oracle Database 11g: Administration Workshop II A ; 3+
ORA9#F"#(. ASM f*le SJDATAorclonl*nelo44ro!$_#'(C#'C2(7I2C21S
%oes no& eG*s&
Errors *n f*le
!"#a$$oracle%*a4r%b)sorclorcl&raceorcl_ora_#FFC1'&rc.
ORA9""1#1. o$en fa*le% for )e)bers of lo4 4ro!$ # of &hrea%
ORA9""1#(. onl*ne lo4 # &hrea% #.
SJDATAorclonl*nelo44ro!$_#'(C#'C2(7I2C21S
ORA9""1#(. onl*ne lo4 # &hrea% #.
SJARAorclonl*nelo44ro!$_#'(FI'C2(7I2I"#S
=SER 5os$*%. #FFC16. &er)*na&*n4 &he *ns&ance %!e &o error 1#1
Ins&ance &er)*na&e% b3 =SER8 $*% = #FFC1
As you can oser*e? the instance terminates due to missing all the memers o- your log
grou'/
3@ %og into $>%EPlus as S@SD>A? start u' and mount the ORCL instance/ >uery the
?$LOD *iew to determine which log grou' is the current grou' and whether its -iles
ha*e een archi*ed already/
$ sqlplus / as sysdba
S+L; startup mount
ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 07#(F2F(" b3&es
A*Ge% S*He #11I1F( b3&es
?ar*able S*He 0##"0171( b3&es
Da&abase >!ffers C(2#0FC" b3&es
Re%o >!ffers F2C1IIC b3&es
Da&abase )o!n&e%'
S+L; select groupOCstatusCarchived from vLlog;
DRO=-N STAT=S ARC
9999999999 9999999999999999 999
# C=RRE<T <O
1 =<=SED @ES
( =<=SED @ES
4@ (- you clear YOUR missing log -ile grou'? then this will re+create the missing log
-iles/
S+L; alter database clear logfile group ;
al&er %a&abase clear lo4f*le 4ro!$ #
,
ERROR a& l*ne #.
ORA9""1F". lo4 # of *ns&ance orcl 5&hrea% #6 nee%s &o be arch*ve%
ORA9""1#(. onl*ne lo4 # &hrea% #.
SJDATAorclonl*nelo44ro!$_#'(C#'C212C2(0IS
Oracle Internal & Oracle cadem! "#e Onl!
Practice 4-.: Recovering fro2 the !oss of a Redo !og #rou-
$continued%
Oracle Database 11g: Administration Workshop II A ; 3.
ORA9""1#(. onl*ne lo4 # &hrea% #.
SJARAorclonl*nelo44ro!$_#'(FI'C212C2(FFS
This is ecause the log-ile has een deleted? and there-ore cannot e archi*ed/ Because
the log -ile has not een archi*ed? lgwr is not allowed to o*erwrite it? e*en i- the -ile no
longer eDists/
;@ Because the log-ile grou' has not een archi*ed? you must use the keyword
Junarchi*edK in the command/ 7'en the dataase and eDit $>%EPlus/
S+L; alter database clear unarchived logfile group ;
Da&abase al&ere%'
S+L; alter database open;
Da&abase al&ere%'
S+L; exit
8@ Per-orm a acku' o- the ORCL dataase including archi*e logs to e ready -or -uture
las/
$ rman target / catalog rcatowner<rcat
Recover3 Mana4er. Release ##'('"'#'" 9 -ro%!c&*on on :e% /!l (2
#".02."I (""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle an%or *&s aff*l*a&es' All
r*4h&s reserve%'
connec&e% &o &ar4e& %a&abase. ORCL 5D>ID=#(("CC"0(C6
recover3 ca&alo4 %a&abase -assEor%. oracle_9) <<<not displayed
connec&e% &o recover3 ca&alo4 %a&abase
RMA<; bac-up database plus archivelog;
'' '
A*n*she% bacP!$ a& ("9A=D9"2
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& ("9A=D9"2
$*ece
han%le=JARAorcla!&obacP!$(""2_"7_("s_C2F0"2ICF'(I2'C2F0"2ICI
co))en&=<O<E
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& ("9A=D9"2
RMA<; delete noprompt obsolete;
. . .
Dele&e% ( obVec&s
RMA<; exit
Note$ Your numer o- deleted o,ects will most likely e di--erent/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 30
4ractices %or :esson 3
Practice 5-1: Recovering I2age Co-ies
(n this 'ractice? you reco*er an image co'y o- a -ile to the current $C&? to allow -aster
reco*ery time later/ You create a new tales'ace called A--RAISAL? which has one
tale in it/ A-ter creating it initially with a small amount o- data? you take an incremental
acku' o- it/ Then you add many rows and take another incremental acku'/ At that
'oint? you ha*e an image co'y o- the A--RAISAL tales'ace and also an incremental
acku' o- it/ Because you need to reco*er the tales'ace later? you reco*er the image
co'y so that it is as u'+to+date as the last incremental acku'/ This is done without going
to the eD'ense o- creating a new image co'y/
.@ Make sure you are at the Qlabs directory and run the
crea&e_a$$ra*sal_&s'sh scri't to create a new tales'ace called
A--RAISAL/
$ cd ~/labs
$ ./create_appraisal_ts.sh
Tables$ace crea&e%'
Table crea&e%'
$
1@ Make a le*el . acku' o- the tales'ace? to e used -or image co'y reco*ery/ (- no
le*el . eDists yet? it will actually create a le*el < incremental acku'/ This takes
se*eral minutes/
$ rman target / catalog rcatowner<rcat
Recover3 Mana4er. Release ##'('"'#'" 9 -ro%!c&*on on :e% /!l (2
#".02."I (""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle an%or *&s aff*l*a&es' All r*4h&s
reserve%'
connec&e% &o &ar4e& %a&abase. ORCL 5D>ID=#(("CC"0(C6
recover3 ca&alo4 %a&abase -assEor%. oracle5*/ <<<not displayed
connec&e% &o recover3 ca&alo4 %a&abase
RMA<; bac-up incremental level / for recover of copy with tag
2app_incr2 database;
S&ar&*n4 bacP!$ a& (""29"79"F."1."".(0
s&ar&*n4 f!ll res3nc of recover3 ca&alo4
f!ll res3nc co)$le&e
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=F7 %ev*ce &3$e=DISL
no $aren& bacP!$ or co$3 of %a&af*le # fo!n%
no $aren& bacP!$ or co$3 of %a&af*le ( fo!n%
no $aren& bacP!$ or co$3 of %a&af*le F fo!n%
no $aren& bacP!$ or co$3 of %a&af*le 1 fo!n%
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-1: Recovering I2age Co-ies $continued%
Oracle Database 11g: Administration Workshop II A ; 32
no $aren& bacP!$ or co$3 of %a&af*le C fo!n%
no $aren& bacP!$ or co$3 of %a&af*le I fo!n%
no $aren& bacP!$ or co$3 of %a&af*le 0 fo!n%
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""#
na)e=JDATAorcl%a&af*les3s&e)'(C"'C20"F"F#I
o!&$!& f*le na)e=JARAorcl%a&af*les3s&e)'1"#'C20"C("(2
&a4=A--_I<CR RECID=C STAM-=C20"C("20
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e. ""."#.#C
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""(
na)e=JDATAorcl%a&af*les3sa!G'(CC'C20"F"F(#
o!&$!& f*le na)e=JARAorcl%a&af*les3sa!G'1""'C20"C(#"2
&a4=A--_I<CR RECID=I STAM-=C20"C((#C
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e. ""."#.FC
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""F
na)e=JDATAorcl%a&af*leeGa)$le'(F2'C20"F"7#1
o!&$!& f*le na)e=JARAorcl%a&af*leeGa)$le'(27'C20"C(((I
&a4=A--_I<CR RECID=7 STAM-=C20"C((1I
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e. ""."".#F
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""1
na)e=JDATAorcl%a&af*le!n%o&bs#'(I7'C20"F"F(#
o!&$!& f*le na)e=JARAorcl%a&af*le!n%o&bs#'(2I'C20"C((01
&a4=A--_I<CR RECID=2 STAM-=C20"C((F#
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e. ""."".#F
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""C na)e=ho)eoracle>ACL=-br"#'%bf
o!&$!& f*le na)e=JARAorcl%a&af*lebr_&bs'(2C'C20"C((F2
&a4=A--_I<CR RECID=#" STAM-=C20"C((CF
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e. ""."".(#
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""I
na)e=JDATAorcl%a&af*lea$$ra*sal'(FC'C20"C#21I
o!&$!& f*le na)e=JARAorcl%a&af*lea$$ra*sal'(2F'C20"C((71
&a4=A--_I<CR RECID=## STAM-=C20"C((7F
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e. "".""."7
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""0
na)e=JDATAorcl%a&af*le!sers'(C0'C20"F"F(#
o!&$!& f*le na)e=JARAorcl%a&af*le!sers'(20'C20"C((72 &a4=A--_I<CR
RECID=#( STAM-=C20"C((72
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e. "".""."1
A*n*she% bacP!$ a& (""29"79"F."1."0.F#
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"79"F."1."0.F#
$*ece
han%le=JARAorcla!&obacP!$(""2_"7_"Fs_C20"C((20'(2('C20"C(1"I
co))en&=<O<E
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"79"F."1."F."2
RMA<;
9@ (n a se'arate terminal window? 'er-orm some !M% on the tale in the A--RAISAL
tales'ace/ =se the e)$_*nser&s'sh scri't/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-1: Recovering I2age Co-ies $continued%
Oracle Database 11g: Administration Workshop II A ; 33
$ cd ~/labs
$ ./emp_inserts.sh
#"I roEs crea&e%'
Co))*& co)$le&e'
(#0 roEs crea&e%'
Co))*& co)$le&e'
$
0@ %ist the co'y o- the A--RAISAL tales'ace to see its $C&/
RMA<; list copy of tablespace appraisal;
L*s& of Da&af*le Co$*es
=======================
Le3 A*le S Co)$le&*on T*)e CP$ SC< CP$ T*)e
9999999 9999 9 9999999999999999999 9999999999 9999999999999999
999
#2IF I A (""29"79"F."1."0.0F 7F1I#2 (""29"79
"F."1."0.12
<a)e. JARAorcl%a&af*lea$$ra*sal'(2F'C20"C((71
Ta4. A--_I<CR
RMA<;
3@ )un the scri't to 'er-orm more transactions on the tale that resides in the
A--RAISAL tales'ace/
$ ./emp_inserts.sh
0(7 roEs crea&e%'
Co))*& co)$le&e'
7FC roEs crea&e%'
Co))*& co)$le&e'
$
4@ Per-orm another le*el . acku'/ This one will indeed e a le*el . ecause you already
ha*e a le*el </
RMA<; bac-up incremental level / for recover of copy with tag
2app_incr2 database;
S&ar&*n4 bacP!$ a& (""29"79"F."1.(F.07
!s*n4 channel ORA_DISL_#
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-1: Recovering I2age Co-ies $continued%
Oracle Database 11g: Administration Workshop II A ; 35
channel ORA_DISL_#. s&ar&*n4 *ncre)en&al level # %a&af*le
bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""#
na)e=JDATAorcl%a&af*les3s&e)'(C"'C20"F"F#I
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (""29"79"F."1.(F.02
channel ORA_DISL_#. f*n*she% $*ece # a& (""29"79"F."1.(F.F"
$*ece
han%le=JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(7F'C2
0"C1F02 &a4=A--_I<CR co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e.
"".""."#
channel ORA_DISL_#. s&ar&*n4 *ncre)en&al level # %a&af*le
bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""(
na)e=JDATAorcl%a&af*les3sa!G'(CC'C20"F"F(#
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (""29"79"F."1.(F.F#
channel ORA_DISL_#. f*n*she% $*ece # a& (""29"79"F."1.(F.F0
$*ece
han%le=JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(70'C2
0"C1FF# &a4=A--_I<CR co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e.
"".""."1
channel ORA_DISL_#. s&ar&*n4 *ncre)en&al level # %a&af*le
bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""C
na)e=ho)eoracle>ACL=-br"#'%bf
*n$!& %a&af*le f*le n!)ber=""""1
na)e=JDATAorcl%a&af*le!n%o&bs#'(I7'C20"F"F(#
*n$!& %a&af*le f*le n!)ber=""""0
na)e=JDATAorcl%a&af*le!sers'(C0'C20"F"F(#
*n$!& %a&af*le f*le n!)ber=""""F
na)e=JDATAorcl%a&af*leeGa)$le'(F2'C20"F"7#1
*n$!& %a&af*le f*le n!)ber=""""I
na)e=JDATAorcl%a&af*lea$$ra*sal'(FC'C20"C#21I
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (""29"79"F."1.(F.F0
channel ORA_DISL_#. f*n*she% $*ece # a& (""29"79"F."1.(F.FF
$*ece
han%le=JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(II'C2
0"C1FFF &a4=A--_I<CR co))en&=<O<E
channel ORA_DISL_#. bacP!$ se& co)$le&e8 ela$se% &*)e.
"".""."#
A*n*she% bacP!$ a& (""29"79"F."1.(F.FF
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"79
"F."1.(F.FF
$*ece
han%le=JARAorcla!&obacP!$(""2_"7_"Fs_C20"C1FFC'(C#'C20"C1F
FI co))en&=<O<E
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-1: Recovering I2age Co-ies $continued%
Oracle Database 11g: Administration Workshop II A ; 36
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"79
"F."1.(F.F2
RMA<;
;@ %ist and note the $C& o- the A--RAISAL tales'ace incremental acku' Bnot the
image co'y@/
RMA<; list bac-up of tablespace appraisal;
L*s& of >acP!$ Se&s
===================
>S Le3 T3$e L? S*He Dev*ce T3$e Ela$se% T*)e Co)$le&*on
T*)e
9999999 9999 99 9999999999 99999999999 999999999999 9999999999
999999999
("1C Incr # ('(0M DISL "".""."" (""29"79
"F."1.(F.F0
>- Le3. ("0# S&a&!s. A?AILA>LE Co)$resse%. <O Ta4.
A--_I<CR
-*ece <a)e.
JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(II'C20"C1FFF
L*s& of Da&af*les *n bacP!$ se& ("1C
A*le L? T3$e CP$ SC< CP$ T*)e <a)e
9999 99 9999 9999999999 9999999999999999999 9999
I # Incr 7FFCC# (""29"79"F."1.(F.F0
JDATAorcl%a&af*lea$$ra*sal'(FC'C20"C#21I
RMA<;
8@ =se the incremental acku' to reco*er the A--RAISAL tales'ace image co'y/
RMA<; recover copy of tablespace appraisal with tag
2app_incr2;
S&ar&*n4 recover a& (""29"79"F."1.(2.("
!s*n4 channel ORA_DISL_#
channel ORA_DISL_#. s&ar&*n4 *ncre)en&al %a&af*le bacP!$ se&
res&ore
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le co$*es &o recover
recover*n4 %a&af*le co$3 f*le n!)ber=""""I
na)e=JARAorcl%a&af*lea$$ra*sal'(77'C20"C1F#2
channel ORA_DISL_#. rea%*n4 fro) bacP!$ $*ece
JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(II'C20"C1FFF
channel ORA_DISL_#. $*ece
han%le=JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(II'C2
0"C1FFF &a4=A--_I<CR
channel ORA_DISL_#. res&ore% bacP!$ $*ece #
channel ORA_DISL_#. res&ore co)$le&e8 ela$se% &*)e. "".""."#
A*n*she% recover a& (""29"79"F."1.(2.(#
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"79
"F."1.(2.(#
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-1: Recovering I2age Co-ies $continued%
Oracle Database 11g: Administration Workshop II A ; 5"
$*ece
han%le=JARAorcla!&obacP!$(""2_"7_"Fs_C20"C1IC1'(C"'C20"C1I
C1 co))en&=<O<E
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"79
"F."1.(2.(C
RMA<;
:@ %ist the $C& -or the A--RAISAL tales'ace image co'y/ Ahat is it nowC
RMA<; list copy of tablespace appraisal;
L*s& of Da&af*le Co$*es
=======================
Le3 A*le S Co)$le&*on T*)e CP$ SC< CP$ T*)e
9999999 9999 9 9999999999999999999 9999999999 9999999999999999
999
("2" I A (""29"79"F."1.(2.(" 7FFCC# (""29"79
"F."1.(F.F0
<a)e. JARAorcl%a&af*lea$$ra*sal'(77'C20"C1F#2
Ta4. A--_I<CR
RMA<;
&ote that it is now e"ual to the $C& o- the last incremental acku'/
.<@ )eco*er all the data -ile image co'ies in the dataase ased on the most recent
incremental acku'/
RMA<; recover copy of database with tag 2app_incr2;
S&ar&*n4 recover a& (""29"79"F."1.11.(2
!s*n4 channel ORA_DISL_#
no co$3 of %a&af*le I fo!n% &o recover
channel ORA_DISL_#. s&ar&*n4 *ncre)en&al %a&af*le bacP!$ se&
res&ore
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le co$*es &o recover
recover*n4 %a&af*le co$3 f*le n!)ber=""""#
na)e=JARAorcl%a&af*les3s&e)'(2#'C20"C1111
channel ORA_DISL_#. rea%*n4 fro) bacP!$ $*ece
JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(7F'C20"C1F02
channel ORA_DISL_#. $*ece
han%le=JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(7F'C2
0"C1F02 &a4=A--_I<CR
channel ORA_DISL_#. res&ore% bacP!$ $*ece #
channel ORA_DISL_#. res&ore co)$le&e8 ela$se% &*)e. "".""."#
channel ORA_DISL_#. s&ar&*n4 *ncre)en&al %a&af*le bacP!$ se&
res&ore
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le co$*es &o recover
recover*n4 %a&af*le co$3 f*le n!)ber=""""(
na)e=JARAorcl%a&af*les3sa!G'1#C'C20"C1121
channel ORA_DISL_#. rea%*n4 fro) bacP!$ $*ece
JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(70'C20"C1FF#
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-1: Recovering I2age Co-ies $continued%
Oracle Database 11g: Administration Workshop II A ; 51
channel ORA_DISL_#. $*ece
han%le=JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(70'C2
0"C1FF# &a4=A--_I<CR
channel ORA_DISL_#. res&ore% bacP!$ $*ece #
channel ORA_DISL_#. res&ore co)$le&e8 ela$se% &*)e. "".""."#
channel ORA_DISL_#. s&ar&*n4 *ncre)en&al %a&af*le bacP!$ se&
res&ore
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le co$*es &o recover
recover*n4 %a&af*le co$3 f*le n!)ber=""""1
na)e=JARAorcl%a&af*le!n%o&bs#'(2"'C20"C102#
recover*n4 %a&af*le co$3 f*le n!)ber=""""0
na)e=JARAorcl%a&af*le!sers'(71'C20"C1F(I
recover*n4 %a&af*le co$3 f*le n!)ber=""""F
na)e=JARAorcl%a&af*leeGa)$le'1"I'C20"C10II
recover*n4 %a&af*le co$3 f*le n!)ber=""""C
na)e=JARAorcl%a&af*lebr_&bs'(72'C20"C1F#I
channel ORA_DISL_#. rea%*n4 fro) bacP!$ $*ece
JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(II'C20"C1FFF
channel ORA_DISL_#. $*ece
han%le=JARAorclbacP!$se&(""2_"7_"Fnnn%n#_a$$_*ncr_"'(II'C2
0"C1FFF &a4=A--_I<CR
channel ORA_DISL_#. res&ore% bacP!$ $*ece #
channel ORA_DISL_#. res&ore co)$le&e8 ela$se% &*)e. "".""."#
A*n*she% recover a& (""29"79"F."1.11.11
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"79
"F."1.11.11
$*ece
han%le=JARAorcla!&obacP!$(""2_"7_"Fs_C20"C0"#0'(C('C20"C0"
#F co))en&=<O<E
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"79
"F."1.11.1I
RMA<;
..@ View the $C&s o- all the image co'ies now/ They should all e? at the most? e"ual to
the latest incremental acku'/
RMA<; list copy;
s$ec*f*ca&*on %oes no& )a&ch an3 con&rol f*le co$3 *n &he
re$os*&or3
L*s& of Da&af*le Co$*es
=======================
Le3 A*le S Co)$le&*on T*)e CP$ SC< CP$ T*)e
9999999 9999 9 9999999999999999999 9999999999 9999999999999999
999
(#00 # A (""29"79"F."1.11.1" 7FFCF0 (""29"79
"F."1.(F.02
<a)e. JARAorcl%a&af*les3s&e)'(2#'C20"C1111
Ta4. A--_I<CR
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-1: Recovering I2age Co-ies $continued%
Oracle Database 11g: Administration Workshop II A ; 5!
(#0F ( A (""29"79"F."1.11.1# 7FFCFI (""29"79
"F."1.(F.F#
<a)e. JARAorcl%a&af*les3sa!G'1#C'C20"C1121
Ta4. A--_I<CR
(#02 1 A (""29"79"F."1.11.1( 7FFCC# (""29"79
"F."1.(F.F0
<a)e. JARAorcl%a&af*le!n%o&bs#'(2"'C20"C102#
Ta4. A--_I<CR
(#07 0 A (""29"79"F."1.11.1( 7FFCC# (""29"79
"F."1.(F.F0
<a)e. JARAorcl%a&af*le!sers'(71'C20"C1F(I
Ta4. A--_I<CR
#02# 0 A (""29"79"F."(.#2.0" 70I7(F (""29"79
"F."(.#2.0"
<a)e. JARAorcl%a&af*le!sers'(22'C20"F2F7#
Ta4. TAD(""2"7"FT"(#20"
#01C 0 A (""29"79"F."(.#7.0# 70II(I (""29"79
"F."(.#7.0#
Lee$. >ACL=-_LODS =n&*l. AORE?ER
<a)e. &)$b!_ORCL_#I_#'%bf
Ta4. TAD(""2"7"FT"(#717
(#0C F A (""29"79"F."1.11.1( 7FFCC# (""29"79
"F."1.(F.F0
<a)e. JARAorcl%a&af*leeGa)$le'1"I'C20"C10II
Ta4. A--_I<CR
(#0I C A (""29"79"F."1.11.1( 7FFCC# (""29"79
"F."1.(F.F0
<a)e. JARAorcl%a&af*lebr_&bs'(72'C20"C1F#I
Ta4. A--_I<CR
#C0# C A (""29"79"F."(.(0.(# 707F0C (""29"79
"F."(.(0.("
<a)e. ho)eoracle>ACL=-br_ORCL_(1_#'%bf
Ta4. TAD(""2"7"FT"((0("
("2" I A (""29"79"F."1.(2.(" 7FFCC# (""29"79
"F."1.(F.F0
<a)e. JARAorcl%a&af*lea$$ra*sal'(77'C20"C1F#2
Ta4. A--_I<CR
RMA<;
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 5+
Practice 5-2: Perfor2ing 'ast Recover)
(n this 'ractice? you take ad*antage o- the Flash )eco*ery Area to 'er-orm a -ast
reco*ery o- a data -ile/
Note$ The data -ile numers in your dataase may di--er -rom what is shown here/
.@ =se the )MA& session -rom the 're*ious 'ractice and take the A--RAISAL data -ile
o--line/
RMA<; sql 8alter tablespace appraisal offline8;
sBl s&a&e)en&. al&er &ables$ace a$$ra*sal offl*ne
s&ar&*n4 f!ll res3nc of recover3 ca&alo4
f!ll res3nc co)$le&e
RMA<;
1@ =se the S:ITCH command to re'lace the data -ile -rom the -lash reco*ery area/
a@ !etermine the name o- the data -ile that is currently associated with the
A--RAISAL tales'ace/
RMA<; report schema;
Re$or& of %a&abase sche)a for %a&abase E*&h %b_!n*B!e_na)e
ORCL
L*s& of -er)anen& Da&af*les
===========================
A*le S*He5M>6 Tables$ace R> se4s Da&af*le <a)e
9999 99999999 99999999999999999999 9999999 9999999999999999999
99999
# C7" S@STEM @ES
JDATAorcl%a&af*les3s&e)'(C"'C20"F"F#I
( FI" S@SA=O <O
JDATAorcl%a&af*les3sa!G'(CC'C20"F"F(#
1 7F =<DOT>S# @ES
JDATAorcl%a&af*le!n%o&bs#'(I7'C20"F"F(#
0 F =SERS <O
JDATAorcl%a&af*le!sers'(C0'C20"F"F(#
F #"" EOAM-LE <O
JDATAorcl%a&af*leeGa)$le'(F2'C20"F"7#1
C (F >R_T>S <O
ho)eoracle>ACL=-br"#'%bf
I (F A--RAISAL <O
JDATAorcl%a&af*lea$$ra*sal'(FC'C20"C#21I
L*s& of Te)$orar3 A*les
=======================
A*le S*He5M>6 Tables$ace MaGs*He5M>6 Te)$f*le <a)e
9999 99999999 99999999999999999999 99999999999 9999999999999
# (7 TEM- 1(ICI
JDATAorcl&e)$f*le&e)$'(CF'C20"F"I2F
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-2: Perfor2ing 'ast Recover) $continued%
Oracle Database 11g: Administration Workshop II A ; 5.
&ote that there is only one data -ile -or the tales'ace/ (n this case? it is data -ile
numer ;/ You can use that data -ile numer? instead o- the tales'ace name? in the
u'coming set o- commands/
@ Con-irm that you ha*e an image co'y -or data -ile ; that you can switch to/
RMA<; list copy of datafile N;
L*s& of Da&af*le Co$*es
=======================
Le3 A*le S Co)$le&*on T*)e CP$ SC< CP$ T*)e
9999999 9999 9 9999999999999999999 9999999999 9999999999999999
999
("2" I A (""29"79"F."1.(2.(" 7FFCC# (""29"79
"F."1.(F.F0
<a)e. JARAorcl%a&af*lea$$ra*sal'(77'C20"C1F#2
Ta4. A--_I<CR
RMA<;
c@ $witch to that co'y o- the image -ile/
RMA<; switch datafile N to copy;
%a&af*le I sE*&che% &o %a&af*le co$3
WJARAorcl%a&af*lea$$ra*sal'(77'C20"C1F#2W
s&ar&*n4 f!ll res3nc of recover3 ca&alo4
f!ll res3nc co)$le&e
RMA<;
d@ )eco*er data -ile ;/
RMA<; recover datafile N;
S&ar&*n4 recover a& (""29"79"F."1.01.10
!s*n4 channel ORA_DISL_#
s&ar&*n4 )e%*a recover3
)e%*a recover3 co)$le&e8 ela$se% &*)e. "".""."#
A*n*she% recover a& (""29"79"F."1.01.1F
RMA<;
9@ Bring the A--RAISAL tales'ace ack online/
RMA<; sql 8alter tablespace appraisal online8;
sBl s&a&e)en&. al&er &ables$ace a$$ra*sal onl*ne
s&ar&*n4 f!ll res3nc of recover3 ca&alo4
f!ll res3nc co)$le&e
RMA<;
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-2: Perfor2ing 'ast Recover) $continued%
Oracle Database 11g: Administration Workshop II A ; 50
0@ )e'ort the schema to note the -ile name -or the A--RAISAL tales'ace/
RMA<; report schema;
Re$or& of %a&abase sche)a for %a&abase E*&h %b_!n*B!e_na)e
ORCL
L*s& of -er)anen& Da&af*les
===========================
A*le S*He5M>6 Tables$ace R> se4s Da&af*le <a)e
9999 99999999 99999999999999999999 9999999 9999999999999999999
99999
# C7" S@STEM @ES
JDATAorcl%a&af*les3s&e)'(C"'C20"F"F#I
( FI" S@SA=O <O
JDATAorcl%a&af*les3sa!G'(CC'C20"F"F(#
1 7F =<DOT>S# @ES
JDATAorcl%a&af*le!n%o&bs#'(I7'C20"F"F(#
0 F =SERS <O
JDATAorcl%a&af*le!sers'(C0'C20"F"F(#
F #"" EOAM-LE <O
JDATAorcl%a&af*leeGa)$le'(F2'C20"F"7#1
C (F >R_T>S <O
ho)eoracle>ACL=-br"#'%bf
I (F A--RAISAL <O
JARAorcl%a&af*lea$$ra*sal'(77'C20"C1F#2
L*s& of Te)$orar3 A*les
=======================
A*le S*He5M>6 Tables$ace MaGs*He5M>6 Te)$f*le <a)e
9999 99999999 99999999999999999999 99999999999 999999999999999
99999
# (7 TEM- 1(ICI
JDATAorcl&e)$f*le&e)$'(CF'C20"F"I2F
RMA<;
&ote that you are now using the Flash )eco*ery Area data -ile as the o'en data -ile
-or the online tales'ace/
3@ !etermine what ha''ened to the original data -ile/
%ist the image co'ies -or data -ile ;? to see i- it is listed/
RMA<; list copy of datafile N;
L*s& of Da&af*le Co$*es
=======================
Le3 A*le S Co)$le&*on T*)e CP$ SC< CP$ T*)e
9999999 9999 9 9999999999999999999 9999999999 9999999999999999
999
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-2: Perfor2ing 'ast Recover) $continued%
Oracle Database 11g: Administration Workshop II A ; 52
((07 I A (""29"79"F."1.0(.02 7FCI#2 (""29"79
"F."1.12.#1
<a)e. JDATAorcl%a&af*lea$$ra*sal'(FC'C20"C#21I
&ote that it is still there and is listed now as an image co'y/ But? the reason -or
switching was ecause this data -ile was considered to e on a damaged disk? or the
data -ile itsel- was corru'ted/
4@ (n a se'arate terminal window? make sure you are at the Qlabs directory/
$ cd ~/labs
;@ )ememer that the reason -or switching was ecause this data -ile was considered to
e on a damaged disk? or the data -ile itsel- was corru'ted in some way/ $o? run the
r)_as)_f*le'sh scri't to delete the -ile/ But -irst? you must ensure that you are
'ointing to the FA$M instance/
$ . oraenv
ORACLE_SID = [orcl] ? 3(06
The Oracle base for
ORACLE_HOME=!"#a$$oracle$ro%!c&##'('"4r*% *s
!"#a$$oracle
$ asmcmd rm 31("(/orcl/datafile/appraisal.=.K.KM94K/M?N
8@ 6*entually? you want to re-rain -rom using the Flash )eco*ery Area as storage -or
acti*e data -iles/ By now? the hardware or corru'tion 'rolem has een remedied? so
switch the data -ile ack to the original location/
a@ Back u' the data -ile? s'eci-ying the DATA A$M disk grou'? using the
DATAAILE tem'late/
RMA<; bac-up as copy to destination 231("(EdatafileF2 datafile
N;
S&ar&*n4 bacP!$ a& (""29"79"F."1.02.1"
!s*n4 channel ORA_DISL_#
channel ORA_DISL_#. s&ar&*n4 %a&af*le co$3
*n$!& %a&af*le f*le n!)ber=""""I
na)e=JARAorcl%a&af*lea$$ra*sal'(77'C20"C1F#2
o!&$!& f*le na)e=JDATAorcl%a&af*lea$$ra*sal'(FC'C20"C02I#
&a4=TAD(""2"7"FT"1021" RECID=(7 STAM-=C20"C02I#
channel ORA_DISL_#. %a&af*le co$3 co)$le&e8 ela$se% &*)e.
"".""."1
A*n*she% bacP!$ a& (""29"79"F."1.02.11
S&ar&*n4 Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"79
"F."1.02.11
$*ece
han%le=JARAorcla!&obacP!$(""2_"7_"Fs_C20"C02IF'(2F'C20"C02
II co))en&=<O<E
A*n*she% Con&rol A*le an% S-AILE A!&obacP!$ a& (""29"79
"F."1.02.0(
RMA<;
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-2: Perfor2ing 'ast Recover) $continued%
Oracle Database 11g: Administration Workshop II A ; 53
@ Take the data -ile o--line/
RMA<; sql 8alter database datafile N offline8;
sBl s&a&e)en&. al&er %a&abase %a&af*le I offl*ne
RMA<;
c@ $witch the data -ile to the newly made co'y/
RMA<; switch datafile N to copy;
%a&af*le I sE*&che% &o %a&af*le co$3
WJDATAorcl%a&af*lea$$ra*sal'(FC'C20"C02I#W
s&ar&*n4 f!ll res3nc of recover3 ca&alo4
f!ll res3nc co)$le&e
RMA<;
d@ )e'ort the schema to con-irm that the data -ile location has changed/
RMA<; report schema;
Re$or& of %a&abase sche)a for %a&abase E*&h %b_!n*B!e_na)e
ORCL
L*s& of -er)anen& Da&af*les
===========================
A*le S*He5M>6 Tables$ace R> se4s Da&af*le <a)e
9999 99999999 99999999999999999999 9999999 9999999999999999999
99999
# C7" S@STEM @ES
JDATAorcl%a&af*les3s&e)'(C"'C20"F"F#I
( FI" S@SA=O <O
JDATAorcl%a&af*les3sa!G'(CC'C20"F"F(#
1 7F =<DOT>S# @ES
JDATAorcl%a&af*le!n%o&bs#'(I7'C20"F"F(#
0 F =SERS <O
JDATAorcl%a&af*le!sers'(C0'C20"F"F(#
F #"" EOAM-LE <O
JDATAorcl%a&af*leeGa)$le'(F2'C20"F"7#1
C (F >R_T>S <O
ho)eoracle>ACL=-br"#'%bf
I (F A--RAISAL <O
JDATAorcl%a&af*lea$$ra*sal'(FC'C20"C02I#
L*s& of Te)$orar3 A*les
=======================
A*le S*He5M>6 Tables$ace MaGs*He5M>6 Te)$f*le <a)e
9999 99999999 99999999999999999999 99999999999 999999999999999
99999
# (7 TEM- 1(ICI
JDATAorcl&e)$f*le&e)$'(CF'C20"F"I2F
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-2: Perfor2ing 'ast Recover) $continued%
Oracle Database 11g: Administration Workshop II A ; 55
:@ )eco*er the data -ile/
RMA<; recover datafile N;
S&ar&*n4 recover a& (""29"79"F."1.F1.(I
!s*n4 channel ORA_DISL_#
s&ar&*n4 )e%*a recover3
)e%*a recover3 co)$le&e8 ela$se% &*)e. ""."".""
A*n*she% recover a& (""29"79"F."1.F1.(I
RMA<;
.<@ Bring the data -ile online/
RMA<; sql 8alter database datafile N online8;
sBl s&a&e)en&. al&er %a&abase %a&af*le I onl*ne
RMA<;
..@ Cross+check the image co'y acku's and remo*e the osolete data -ile ; image co'y/
6Dit )MA& when -inished/
RMA<; crosschec- copy;
release% channel. ORA_DISL_#
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=F7 %ev*ce &3$e=DISL
s$ec*f*ca&*on %oes no& )a&ch an3 con&rol f*le co$3 *n &he
re$os*&or3
val*%a&*on s!ccee%e% for %a&af*le co$3
%a&af*le co$3 f*le
na)e=JARAorcl%a&af*les3s&e)'(2#'C20"C1111 RECID=(#
STAM-=C20"C0"#"
''
val*%a&*on fa*le% for %a&af*le co$3
%a&af*le co$3 f*le
na)e=JDATAorcl%a&af*lea$$ra*sal'(FC'C20"C#21I RECID=(I
STAM-=C20"C0FC2
''
na)e=JARAorclarch*velo4(""2_"7_"F&hrea%_#_seB_('1(C'C20"C#
F#1 RECID=(# STAM-=C20"C#F#1
val*%a&*on s!ccee%e% for arch*ve% lo4
arch*ve% lo4 f*le
na)e=JARAorclarch*velo4(""2_"7_"F&hrea%_#_seB_1'1##'C20"C#
I0I RECID=(( STAM-=C20"C#IF"
CrosschecPe% (2 obVec&s
RMA<; list expired copy;
s$ec*f*ca&*on %oes no& )a&ch an3 arch*ve% lo4 *n &he
re$os*&or3
Oracle Internal & Oracle cadem! "#e Onl!
Practice 5-2: Perfor2ing 'ast Recover) $continued%
Oracle Database 11g: Administration Workshop II A ; 56
L*s& of Da&af*le Co$*es
=======================
Le3 A*le S Co)$le&*on T*)e CP$ SC< CP$ T*)e
9999999 9999 9 9999999999999999999 9999999999 9999999999999999
999
((07 I O (""29"79"F."1.0(.02 7FCI#2 (""29"79
"F."1.12.#1
<a)e. JDATAorcl%a&af*lea$$ra*sal'(FC'C20"C#21I
RMA<; delete expired copy;
release% channel. ORA_DISL_#
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=F7 %ev*ce &3$e=DISL
s$ec*f*ca&*on %oes no& )a&ch an3 con&rol f*le co$3 *n &he
re$os*&or3
s$ec*f*ca&*on %oes no& )a&ch an3 arch*ve% lo4 *n &he
re$os*&or3
L*s& of Da&af*le Co$*es
=======================
Le3 A*le S Co)$le&*on T*)e CP$ SC< CP$ T*)e
9999999 9999 9 9999999999999999999 9999999999 9999999999999999
999
((07 I O (""29"79"F."1.0(.02 7FCI#2 (""29"79
"F."1.12.#1
<a)e. JDATAorcl%a&af*lea$$ra*sal'(FC'C20"C#21I
Do 3o! reall3 Ean& &o %ele&e &he above obVec&s 5en&er @ES or
<O6? 7'0
%ele&e% %a&af*le co$3
%a&af*le co$3 f*le
na)e=JDATAorcl%a&af*lea$$ra*sal'(FC'C20"C#21I RECID=(I
STAM-=C20"C0FC2
Dele&e% # EO-IRED obVec&s
RMA<; exit
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 6"
4ractices %or :esson 5
Practice 6-1: Monitoring RMA3 7obs
(n this 'ractice? you eDecute a long+running )MA& ,o and monitor its 'rogress to
determine how much longer it is eD'ected to run/
.@ Point to the ORCL
$ . oraenv
instance? in*oke )MA& and delete all osolete acku's/ You need
to 'er-orm a cross+check -irst? so that the re'ository is u'+to+date/
orcl
$ rman target / catalog rcatowner<rcat
recover3 ca&alo4 %a&abase -assEor%. oracle_9) <<<not displayed
RMA<; crosschec- bac-up;
' ' '
RMA<; delete noprompt obsolete;
' ' '
1@ 7'en a second terminal window/ Change to the labs directory and 'oint to the
("cl
$ . oraenv
instance/ (n*oke $>%EPlus and connect as S@SD>A/ You use this second
session to monitor a dataase acku'/
orcl
$ sqlplus / as sysdba
9@ )eturn to your -irst terminal window/ (n your )MA& session? egin a dataase
acku' to the ta'e de*ice/
RMA<; bac-up device type sbt database;
S&ar&*n4 bacP!$ a& (""29"79"F."0.(1.0#
release% channel. ORA_DISL_#
alloca&e% channel. ORA_S>T_TA-E_#
channel ORA_S>T_TA-E_#. SID=0I %ev*ce &3$e=S>T_TA-E
channel ORA_S>T_TA-E_#. :AR<I<D. Oracle Tes& D*sP A-I
channel ORA_S>T_TA-E_#. s&ar&*n4 f!ll %a&af*le bacP!$ se&
channel ORA_S>T_TA-E_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""#
na)e=JDATAorcl%a&af*les3s&e)'(C"'C20"F"F#I
channel ORA_S>T_TA-E_#. s&ar&*n4 $*ece # a& (""29"79
"F."0.(1.0(
channel ORA_S>T_TA-E_#. f*n*she% $*ece # a& (""29"79
"F."0.(0.1I
$*ece han%le=("Pl&IBe_#_# &a4=TAD(""2"7"FT"0(10( co))en&=A-I
?ers*on ('"8MMS ?er
s*on 7'#'1'"'''
Oracle Internal & Oracle cadem! "#e Onl!
Practice 6-1: Monitoring RMA3 7obs $continued%
Oracle Database 11g: Administration Workshop II A ; 61
0@ =se your $>%EPlus session to monitor the 'rogress o- the dataase acku' y
"uerying the ?$SESSIO<_LO<DO-S *iew/ By using this *iew? you can determine
whether the acku' is 'rogressing normally or hanging/ (- the acku' is 'rogressing
normally? the TIME_REMAI<I<D column should e decreasing/ 6Decute the
B!er3_lon4o$s('sBl scri't a -ew times to "uery ?$SESSIO<_LO<DO-S/
$ince the scri't contains multi'le $6%6CT statements? you cannot enter slash to
rerun the scri't/ You must ty'e or 'aste the scri't name -or each run/ 6ach time you
should see the TIME_REMAI<I<D *alue decreasing -or the SID associated with the
acku' task/ The detail data section 'ertains to indi*idual channel o'enings and
closings/ The aggregate data section descries the entire )MA& ,o 'rogress/
S+L; <query_longops=.sql
De&a*l Da&a
99999999999999999999999999999999999999
De&a*l -ro4ress Infor)a&*on 5$er f*le6
SID START_TIME ELA-SED_SECO<DS TIME_REMAI<I<D
9999999999 9999999999999999999 999999999999999 99999999999999
0" (""29"79"F."F.#(.#2 (" (0
A44re4a&e Da&a
999999999999999999999999999999
A44re4a&e -ro4ress Infor)a&*on
SID SERIALN CO<TEOT SOAAR TOTAL:ORL T_COM-LETE
9999999 9999999999 9999999999 9999999999 9999999999 9999999
(# 210 0 01222 (1C""" #7'C0
S+L; <query_longops=.sql
De&a*l Da&a
99999999999999999999999999999999999999
De&a*l -ro4ress Infor)a&*on 5$er f*le6
SID START_TIME ELA-SED_SECO<DS TIME_REMAI<I<D
9999999999 9999999999999999999 999999999999999 99999999999999
0" (""29"79"F."F.#1.(C #( 1F
A44re4a&e Da&a
999999999999999999999999999999
A44re4a&e -ro4ress Infor)a&*on
SID SERIALN CO<TEOT SOAAR TOTAL:ORL T_COM-LETE
99999999 9999999999 9999999999 9999999999 9999999999 9999999
(# 210 0 #1#"12 (1C""" FF'F1
Oracle Internal & Oracle cadem! "#e Onl!
Practice 6-1: Monitoring RMA3 7obs $continued%
Oracle Database 11g: Administration Workshop II A ; 6!
3@ 6Dit your )MA& and $>% sessions/
4@ )un the clean!$_arch*velo4s'sh scri't to ack u' and remo*e archi*elog
-iles/ This takes se*eral minutes to run/
$ cd ~/labs
$ ./cleanup_archivelogs.sh
;@ )un the clean!$_&a$e_%*r'sh scri't to remo*e -iles -rom the &a$e
directory/
$ ./cleanup_tape_dir.sh
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 6+
4ractices %or :esson 6
(n this lesson you learn aout diagnosing and re'airing lock corru'tion/
(n these 'ractices? you em'loy *arious diagnostic ca'ailities to sol*e errors/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 6.
Practice 8-1: Diagnostic 0cenario
(n this o'tional 'ractice? you create a data dictionary corru'tion that you analyze using
$u''ort Aorkench and A!)C(/ If you begin this practice, you must complete it.
.@ 6Decute the h)_se&!$'sh scr*$& -rom the labs sudirectory/ This scri't
corru'ts the data dictionary/
$ . oraenv
orcl
$ cd ~/labs
$ cat hm_setup.sh
NXb*nbash
c% ho)eoraclelabs
sBl$l!s as s3s%ba KKEOA
se& echo on
crea&e &able sco&&'&abV)E5c n!)ber6 &ables$ace !sersM
var*able obV n!)berM
be4*n
selec& obVec&_*% *n&o .obV fro) %ba_obVec&s Ehere
oEner=SSCOTTS an% obVec&_na)e=STA>/M:SM
en%M

$r*n& obVM
!$%a&e &ab$ se& cols=#""# Ehere obVN=.obVM
co))*&M
EOA
$ ./hm_setup.sh
S+L; S+L; S+L;
Table crea&e%'
S+L; S+L; S+L; ( 1 0
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L;
O>/
9999999999
I0CFI
S+L;
# roE !$%a&e%'
S+L;
Co))*& co)$le&e'
$
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 60
1@ =se 6M to trigger a health check on the data dictionary/
a@ From the !ataase home 'age Bconnected as the S@S user@? click Ad*isor Central
at the ottom o- the 'age in the )elated %inks section/
@ 7n the Ad*isor Central 'age? click the Checkers ta/
c@ 7n the Checker taed 'age? click !ictionary (ntegrity Check/
d@ 7n the )un !ictionary (ntegrity Check 'age? s'eci-y a )un &ame2 D*c&ChecP
and click 7#/
e@ Back to the Ad*isor Central Checkers 'age? you should see a Con-irmation
message indicating that your check ran success-ully/
-@ $elect your !ictCheck run and click !etails/
g@ This takes you to the )un !etails Findings taed 'age? where you can see some
!ata Corru'tion/ (n 'articular? you should see the -ollowing -inding2 J$>%
dictionary health check2 in*alid column numer 8 on o,ect TABO -ailed/K
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 62
The corru'tion should corres'ond to a row in TA>$ that re-erences
SCOTT'TA>/M:/
9@ 5ow would you get a re'ort aout the 're*ious -inding using $>%EPlusC
$ sqlplus / as sysdba
S+L; set long /44444
S+L; set pages MMM
S+L; select dbms_hm.get_run_reportE21ictChec-2F from dual;
D>MS_HM'DET_R=<_RE-ORT5SDICTCHECLS6
99999999999999999999999999999999999999999999999999999999999999999999
999999999999
>as*c R!n Infor)a&*on
R!n <a)e . D*c&ChecP
R!n I% . 07#
ChecP <a)e . D*c&*onar3 I
n&e4r*&3 ChecP
Mo%e . MA<=AL
S&a&!s . COM-LETED
S&ar& T*)e . (""29"I9((
(1.#(.FF'2("I12 J"I.""
En% T*)e . (""29"I9(( (1.#1."#'F#(I
## J"I.""
Error Enco!n&ere% . "
So!rce Inc*%en& I% . "
<!)ber of Inc*%en&s Crea&e% . "
In$!& -ara)&ers for &he R!n
TA>LE_<AME=ALL_CORE_TA>LES
CHECL_MASL=ALL
R!n A*n%*n4s An% Reco))en%a&*ons
A*n%*n4
A*n%*n4 <a)e . D*c&*onar3 Incons*s&enc3
A*n%*n4 ID . 07(
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 63
T3$e . AAIL=RE
S&a&!s . O-E<
-r*or*&3 . CRITICAL
Messa4e . S+L %*c&*onar3 heal&h checP. *
nval*% col!)n n!)ber 7 on
obVec& TA>$ fa*le%
Messa4e . Da)a4e% roE*% *s AAAAACAA>AAA=
f-AAC 9 %escr*$&*on. ObVec&
SCOTT'TA>/M: *s reference%
S+L;
0@ &a*igate to your 6M 5ome 'age/ Ahat do you oser*e in the Alerts sectionC
You should see a new critical alert B!ata Failure@ -or the 're*iously detected
corru'tion in the Alerts section o- the 5ome 'age/ BIt may take a while to appear.@
3@ Flush your shared 'ool and u--er cache -irst? and then eDit and reconnect as the S@S
user/
$ sqlplus / as sysdba
S+L; alter system flush shared_pool;
S3s&e) al&ere%'
S+L;
S+L; alter system flush buffer_cache;
S3s&e) al&ere%'
S+L; exit
$ sqlplus / as sysdba
4@ From a $>%EPlus session connected as the S@S user? eDecute the -ollowing
statement2 selec& , fro) sco&&'&abV)EM
Question: Ahat do you oser*eC
S+L; select J from scott.tabPmw;
selec& , fro) sco&&'&abV)E
,
ERROR a& l*ne #.
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 65
ORA9"1##1. en%9of9f*le on co))!n*ca&*on channel
-rocess ID. #07I(
Sess*on ID. CC Ser*al n!)ber. C(F2
S+L;
Answer: At -irst the session seems to hang? then the ORA9"1##1 error is dis'layed/
;@ =se 6M to in*estigate the 're*ious 'rolem/
a@ From the 6M 5ome 'age? you should see one acti*e incident/ Click the Acti*e
(ncident link/ (- not? click $o-tware and $u''ort/ 7n the $o-tware and $u''ort
taed 'age? click $u''ort Aorkench in the $u''ort section/
@ 7n the $u''ort Aorkench Prolems taed 'age? you should see a new Acti*e
(ncident whose descri'tion is similar to ORA I00F [Bcs&%a56JC2"]/
c@ Click the JFK icon in the !etails column -or this 'rolem/
d@ This shows you the corres'onding -irst+time incident/
e@ Make a note o- the incident numer B(n this screenshot it is 8;1:@/
-@ Click that incident numer/
g@ This takes you to the corres'onding (ncident !etails 'age/
h@ 7n the (ncident !etails 'age? in the A''lication (n-ormation section? you can see
the cause the incident/ (t is2 Pselec& , fro) sco&&'&abV)EP/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 66
You can also see two dum' -iles generated -rom the !um' Files taed 'age/ The
-irst one corres'onds to the incident dum' -ile and is located in the A!) directory
!"#a$$oracle%*a4r%b)sorclorcl*nc*%en&*nc%*r_nnnn
n/ The second one is the classical corres'onding trace -ile located in
!"#a$$oracle%*a4r%b)sorclorcl&race/
h@ Click the eyeglasses icon in the View Contents column -or the incident trace B-irst
row@/
i@ (- you did not sa*e your 5ost credentials 're*iously? then the 5ost Credentials
'age is dis'layed/ 6nter oracle as username and enter oracle as 'assword?
then click Continue/
8@ 7n the Contents 'age? you see the structured trace in-ormation/ 6D'and the
*nc*%en&_%!)$ and c!s&o)_asser&_%!)$ nodes/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 1""
:@ Then click the Jcurrent s"l statementK link/
.<@ This 'rints the cul'rit $>% statement in the window elow the Trace Ma'/
..@ Click 7#/
.1@ 7n the (ncident !etails 'age again? click the Prolem #ey link/
.9@ 7n the Prolem !etails 'age? click 6dit to the right o- the $) -ield/
.0@ 6nter #(10 in the $) &umer 'o'+u' window that a''ears and click 7#/ (t is
assumed that you already o'ened an $) B.190@ with Meta%ink/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 1"1
.3@ You should now see the $) numer on the Prolem !etails 'age/
.4@ Click the Acti*ity %og ta/
.;@ This takes you to the Acti*ity %og taed 'age? on which you can now see your last
action on the 'rolem/ You can o'tionally enter a comment here/ B(- you do? click
Add Comment to sa*e your comment/@
.8@ Back to your terminal window? locate your incident and your health check re'ort in
A!)/ BYour incident numer may e di--erent/@
$ cd L#(C$'_*(0'/diag/rdbms/orcl/orcl
$ ls
aler& c%!)$ h) *nc*%en& *nc$P4 *r lcP )e&a%a&a s&a4e
sEee$ &race
$ cd incident
$ ls Ala
&o&al #(
%rEGr9G999 1 oracle %ba 0"2C /!l (( (1.(I '
%rEGr9G999 #1 oracle %ba 0"2C /!l (" (1.02 ''
%rEGr9Gr9G ( oracle %ba 0"2C /!l (( (1.(I *nc%*r_7I(2
$ cd incdir_@N=M
$ ls
orcl_ora_#07I(_*7I(2'&rc orcl_ora_#07I(_*7I(2'&r)
$ cd ../..
$ ls
aler& c%!)$ h) *nc*%en& *nc$P4 *r lcP )e&a%a&a s&a4e
sEee$ &race
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 1"!
$ cd hm
$ ls
HMRE-ORT_D*c&ChecP'h)
$ cd ..
$
.:@ =se A!)C( to locate your incident and 'rolem in-ormation/
$ adrci
ADRCI. Release ##'('"'"'( 9 >e&a on Th! /!n 0 (".#0.1( (""2
ADRCI. Release ##'('"'#'" 9 -ro%!c&*on on Th! /!l (1 "#."0.12
(""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle an%or *&s aff*l*a&es' All
r*4h&s reserve%'
ADR base = W!"#a$$oracleW
a%rc*; set homepath diag/rdbms/orcl/orcl
a%rc*; show homes
ADR Ho)es.
%*a4r%b)sorclorcl
a%rc*; show incidents
ADR Ho)e = !"#a$$oracle%*a4r%b)sorclorcl.
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,
I<CIDE<T_ID -RO>LEM_LE@
CREATE_TIME
99999999999999999999 99999999999999999999999999999999999999999
999999999999999999 9999999999999999999999999999999999999999
7I(2 ORA I00F [Bcs&%a56JC2"]
(""29"I9(( (1.(I.(C'#(2""" J"I.""
# roEs fe&che%
a%rc*;
1<@ =se 6nter'rise Manager to 'ackage your 'rolem "uickly/
1.@ From the Prolem !etails 'age? click >uick Package in the (n*estigate and )esol*e
section/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 1"+
11@ 7n the >uick Packaging2 Create &ew Package 'age? lea*e the de-ault 'ackage name
Bsomething similar to ORAI00FBc_(""2"I(1"##717@ and select &o -or J$end to
7racle $u''ortK entry/
19@ Ahen the 'age is re-reshed? click &eDt/
10@ 7n the >uick Packaging2 View Contents 'age? you can see the list o- incidents that
are 'art o- this 'ackage/ There should e only one incident in your case/ Click &eDt/
13@ 7n the >uick Packaging2 View Mani-est 'age? look at the 'ackage name and the 'ath/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 1".
14@ Click &eDt/
1;@ 7n the >uick Packaging2 $chedule 'age? ensure (mmediately is selected and click
$umit/
18@ The Processing2 Generating ='load File -or Package 'age a''ears/ Aait until it is
-inished/
1:@ 7n the Con-irmation 'age? you should see something similar to2 PGenerating an
u'load -ile -or 'ackage2 7)A;003"cG1<<:<;19<..898 has -ailed/K
9<@ Click 7#/
9.@ 7n the Prolem !etails 'age? click the Acti*ity %og ta/
91@ Back to the Prolem !etails Acti*ity %og taed 'age? you should now see two new
entries in the log re'orting aout the 'ackage creation -or this 'rolem/
99@ (n the $ummary section? click Yes to the right o- the Packaged entry/
90@ This takes you to the Packages 'age? -rom where you can see your 'ackage/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 1"0
93@ $elect your 'ackage? and click View/
This takes you to the Package !etails 'age? where you can see the 'ackage details/
94@ Click the Files ta/
7n the Files taed 'age? you can now see the Full Package Content *iew/
9;@ =se A!)C( to determine the list o- eDisting 'ackages/
$ adrci
ADRCI. Release ##'#'"'F'" 9 >e&a on Th! Ma3 (0 "I.FI.#1 (""I
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 1"2
Co$3r*4h& 5c6 #27(8 (""I8 Oracle' All r*4h&s reserve%'
ADR base = W!"#a$$oracleW
a%rc*; set homepath diag/rdbms/orcl/orcl
a%rc*; query ips_pac-age
ADR Ho)e = !"#a$$oracle%*a4r%b)sorclorcl.
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,
-ACLADE_ID ALADS STAT=S
CREATIO<_TIME LAST_SE+=E<CE
LAST_COM-LETE_SE+=E< -RO>LEM_ID <AME
DESCRI-TIO<
CORRELATIO<_LE?EL DRI?I<D_I<CIDE<T >EDI<_TIME
E<D_TIME =-DATE_TIME
LAST_>ASE_SE+=E<CE
99999999999999999999 99999999999999999999 99999999999999999999
9999999999999999999999999999999999999999 99999999999999999999
99999999999999999999 99999999999999999999 99999999999999999999
99999999999999999999999999999999999999999999999999999999999999
9999999999999999999 999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999999
99999999999 99999999999999999999 99999999999999999999 99999999
99999999999999999999999999999999 99999999999999999999999999999
99999999999 9999999999999999999999999999999999999999 999999999
99999999999
# " 0
(""29"I9(1 "#.(#.1F'I27II0 J"I."" #
# #
ORAI00FBc_(""2"I(1"##717
( 7I(2
(""29"I9(1 "#.(#.1F'2#2#C" J"I."" "
# roEs fe&che%
a%rc*; exit
98@ A-ter analyzing the 'rolem? you know that the numer o- columns -or TA>/M: is
wrong in TA>$/ FiD the issue y u'dating TA>$ and close your 'rolem/ You can
eDecute h)_f*G'sh -rom the labs
$ cd ~/labs
sudirectory -or that 'ur'ose/
$ cat hm_fix.sh
NXb*nbash
N Aor &ra*n*n4 $!r$ose onl3
sBl$l!s as s3s%ba KKEOA
se& echo on
var*able obV n!)berM
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 1"3
be4*n
selec& obVec&_*% *n&o .obV fro) %ba_obVec&s Ehere
oEner=SSCOTTS an% obVec&_na)e=STA>/M:SM
en%M

$r*n& obVM
!$%a&e &ab$ se& cols=# Ehere obVN=.obVM
co))*&M
EOA
$ ./hm_fix.sh
S+L; S+L; S+L; ( 1 0
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L;
O>/
9999999999
I0CFI
S+L;
# roE !$%a&e%'
S+L;
Co))*& co)$le&e'
$
9:@ =se 6nter'rise Manager to close your incident/
0<@ 7n the Package !etails 'age? click the J'rolemK link to the right o- the JProlems in
PackageK -ield in the $ummary section/
0.@ 7n the Prolem !etails (ncidents taed 'age? select your incident and click Close/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-1: Diagnostic 0cenario $continued%
Oracle Database 11g: Administration Workshop II A ; 1"5
01@ 7n the Con-irmation 'age? click Yes/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 1"6
Practice 8-2: Re-airing +(oc, Corru-tion
.@ To set u' this lock corru'tions 'ractice? use a terminal window? na*igate to the
$HOMElabs directory? and eDecute the bc_se&!$'sh scri't/ This scri't creates a
tales'ace called >CT>S and a user called >C/ The tales'ace is then 'o'ulated/ A
acku' o- the new tales'ace is 'er-ormed/
Take a -ew moments to ins'ect each scri't actions e-ore eDecuting it/ As usual you
'oint to the orcl
$ cd ~/labs
instance/
$ . oraenv
ORACLE_SID = [orcl] Q orcl
$ cat bc_setup.sh
NXb*nbash
N Aor &ra*n*n4 $!r$ose onl3
N R!n as oracle OS !ser
sBl$l!s 9S nolo4 ; &)$se&!$'lo4 (;Y# KKEOA
connec& as s3s%ba
99 CLEA<=- fro) $rev*o!s r!n
DRO- =SER bc CASCADEM
DRO- TA>LES-ACE bc&bs I<CL=DI<D CO<TE<TS A<D DATAAILESM
99 Crea&e &ables$ace
CREATE TA>LES-ACE bc&bs
DATAAILE Sho)eoracle>ACL=-bc&bs"#'%bfS SIRE #"M
SEDME<T S-ACE MA<ADEME<T MA<=ALM
99 Crea&e !ser
CREATE =SER bc IDE<TIAIED >@ oracle_0=
DEAA=LT TA>LES-ACE bc&bs
+=OTA =<LIMITED O< bc&bsM
DRA<T CREATE SESSIO< TO bcM
99 crea&e &able an% $o$!la&e
99 be s!re &able *s a& leas& ( blocPs lon4
CREATE TA>LE bc'bcco$3
TA>LES-ACE bc&bs
AS SELECT , AROM HR'EM-LO@EESM
I<SERT I<TO bc'bcco$3
SELECT , AROM bc'bcco$3M
I<SERT I<TO bc'bcco$3
SELECT , AROM bc'bcco$3M
EOA
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-2: Re-airing +(oc, Corru-tion $continued%
Oracle Database 11g: Administration Workshop II A ; 11"
N99 Crea&e bacP!$ of &he bc&bs &ables$ace
r)an &ar4e& ; &)$r)an'lo4 (;Y# KKEOA
>ACL=- AS CO-@ TA>LES-ACE bc&bsM
EOA
N99 !$%a&e &he &able
sBl$l!s 9S nolo4 ;; &)$se&!$'lo4 (;Y# KKEOA
connec& as s3s%ba
=-DATE bc'bcco$3 SET salar3 = salar3J#M
COMMITM
EOA
$ ./bc_setup.sh
1@ %og into $>%EPlus as the $Y$ user and eDecute the bc_cr*&*cal scri't? which
corru'ts the data -ile/ 6nter your dis'layed lock numer/
$ sqlplus / as sydba
S+L; <bc_critical
Connec&e%'
AILE_<O >LOCL_<O
9999999999 9999999999
I #(2
S3s&e) al&ere%'
SEn&er >locP n!)ber Ehen $ro)$&e%S
En&er val!e for blocP_no. /=M
"J# recor%s *n
"J# recor%s o!&
7" b3&es 57" >6 co$*e%8 C'#I(0e9"F secon%s8 #'1 M>s
"J# recor%s *n
"J# recor%s o!&
I2 b3&es 5I2 >6 co$*e%8 F'I#CCe9"F secon%s8 #'0 M>s
SELECT , fro) bc'bcco$3
,
ERROR a& l*ne #.
ORA9"#FI7. ORACLE %a&a blocP corr!$&e% 5f*le N I8 blocP N #(26
ORA9"###". %a&a f*le I. Sho)eoracle>ACL=-bc&bs"#'%bfS
S+L;
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-2: Re-airing +(oc, Corru-tion $continued%
Oracle Database 11g: Administration Workshop II A ; 111
9@ =se )MA& to ack u' the T>S>C tales'ace/ Ahat ha''ensC
$ rman target / nocatalog
RMA<; bac-up tablespace bctbs;
S&ar&*n4 bacP!$ a& (""29"I9(1.#C.(#.#C
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=# %ev*ce &3$e=DISL
channel ORA_DISL_#. s&ar&*n4 f!ll %a&af*le bacP!$ se&
channel ORA_DISL_#. s$ec*f3*n4 %a&af*le5s6 *n bacP!$ se&
*n$!& %a&af*le f*le n!)ber=""""I
na)e=ho)eoracle>ACL=-bc&bs"#'%bf
channel ORA_DISL_#. s&ar&*n4 $*ece # a& (""29"I9(1.#C.(#.#C
RMA<9""FI#.
===========================================================
RMA<9""FC2. =============== ERROR MESSADE STACL AOLLO:S
===============
RMA<9""FI#.
===========================================================
RMA<9"1""2. fa*l!re of bacP!$ co))an% on ORA_DISL_# channel a&
"I(1(""2 #C.(#.(1
ORA9#2FCC. eGcee%e% l*)*& of " corr!$& blocPs for f*le
ho)eoracle>ACL=-bc&bs"#'%bf
RMA<; exit
The acku' -ails u'on encountering the -irst corru't lock/
0@ =se the )MA& l*s& fa*l!re command to 'ro*ide details aout the errors/
$ rman target / nocatalog
Recover3 Mana4er. Release ##'#'"'C'" 9 -ro%!c&*on on Mon A!4
(I "2.02.F" (""I
connec&e% &o &ar4e& %a&abase. ORCL 5D>ID=##F7FICI0"6
RMA<; list failure detail;
RMA<; L*s& of Da&abase Aa*l!res
=========================
Aa*l!re ID -r*or*&3 S&a&!s T*)e De&ec&e% S!))ar3
9999999999 99999999 999999999 9999999999999999999 9999999
FC( HIDH O-E< (""29"I9(1.#C.##."0 Da&af*le I.
Sho)eoracle>ACL=-bc&bs"#'%bfS con&a*ns one or )ore corr!$&
blocPs
I)$ac&. So)e obVec&s *n &ables$ace >CT>S )*4h& be
!nava*lable
L*s& of ch*l% fa*l!res for $aren& fa*l!re ID FC(
Aa*l!re ID -r*or*&3 S&a&!s T*)e De&ec&e% S!))ar3
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-2: Re-airing +(oc, Corru-tion $continued%
Oracle Database 11g: Administration Workshop II A ; 11!
9999999999 99999999 999999999 9999999999999999999 9999999
FI# HIDH O-E< (""29"I9(1.#C.##."F >locP #1"
*n %a&af*le I. Sho)eoracle>ACL=-bc&bs"#'%bfS *s )e%*a
corr!$&
I)$ac&. ObVec& >CCO-@ oEne% b3 >C )*4h& be !nava*lable
FCF HIDH O-E< (""29"I9(1.#C.##."0 >locP #(2
*n %a&af*le I. Sho)eoracle>ACL=-bc&bs"#'%bfS *s )e%*a
corr!$&
I)$ac&. ObVec& >CCO-@ oEne% b3 >C )*4h& be !nava*lable
Note$ Do not close this R"AN session6
3@ Alternati*ely? in another terminal window? you can "uery the ?$IR_AAIL=RE *iew
to *iew details aout the -ailure2
$ sqlplus / as sysdba
S+L; set pages MMM
S+L; select failure_idC time_detectedC descriptionC impacts
from DL&#_%(&$)#' where impacts li-e 2H*CH2;
AAIL=RE_ID TIME_DETECTED
9999999999 9999999999999999999
DESCRI-TIO<
99999999999999999999999999999999999999999999999999999999999999
999999999999999999
IM-ACTS
99999999999999999999999999999999999999999999999999999999999999
999999999999999999
FC( (""29"I9(1.#C.##."0
Da&af*le I. Sho)eoracle>ACL=-bc&bs"#'%bfS con&a*ns one or
)ore corr!$& blocP
s
So)e obVec&s *n &ables$ace >CT>S )*4h& be !nava*lable
FCF (""29"I9(1.#C.##."0
>locP #(2 *n %a&af*le I. Sho)eoracle>ACL=-bc&bs"#'%bfS *s
)e%*a corr!$&
ObVec& >CCO-@ oEne% b3 >C )*4h& be !nava*lable
FI# (""29"I9(1.#C.##."F
>locP #1" *n %a&af*le I. Sho)eoracle>ACL=-bc&bs"#'%bfS *s
)e%*a corr!$&
ObVec& >CCO-@ oEne% b3 >C )*4h& be !nava*lable
S+L;
S+L; exit
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-2: Re-airing +(oc, Corru-tion $continued%
Oracle Database 11g: Administration Workshop II A ; 11+
4@ Continue in your )MA& session/ 6Decute the )MA& a%v*se fa*l!re all
command to *iew reco*ery o'tions/
RMA<; advise failure all;
L*s& of Da&abase Aa*l!res
=========================
Aa*l!re ID -r*or*&3 S&a&!s T*)e De&ec&e% S!))ar3
9999999999 99999999 999999999 9999999999999999999 9999999
FC( HIDH O-E< (""29"I9(1.#C.##."0 Da&af*le I.
Sho)eoracle>ACL=-bc&bs"#'%bfS con&a*ns one or )ore corr!$&
blocPs
anal3H*n4 a!&o)a&*c re$a*r o$&*onsM &h*s )a3 &aPe so)e &*)e
!s*n4 channel ORA_DISL_#
alloca&e% channel. ORA_S>T_TA-E_#
channel ORA_S>T_TA-E_#. SID=(0 %ev*ce &3$e=S>T_TA-E
channel ORA_S>T_TA-E_#. :AR<I<D. Oracle Tes& D*sP A-I
anal3H*n4 a!&o)a&*c re$a*r o$&*ons co)$le&e
Man%a&or3 Man!al Ac&*ons
========================
no )an!al ac&*ons ava*lable
O$&*onal Man!al Ac&*ons
=======================
no )an!al ac&*ons ava*lable
A!&o)a&e% Re$a*r O$&*ons
========================
O$&*on Re$a*r Descr*$&*on
999999 999999999999999999
# Recover )!l&*$le corr!$& blocPs *n %a&af*le I
S&ra&e43. The re$a*r *ncl!%es co)$le&e )e%*a recover3 E*&h
no %a&a loss
Re$a*r scr*$&.
!"#a$$oracle%*a4r%b)sorclorclh)reco_12F(CI10#1'h)
RMA<;
Note$ An a%v*se fa*l!re command must 'recede a re$a*r command/ $o? do
not eDecute other commands? ut continue with the neDt ste'/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-2: Re-airing +(oc, Corru-tion $continued%
Oracle Database 11g: Administration Workshop II A ; 11.
;@ Continue in your )MA& session and eDecute the )MA& re$a*r fa*l!re
command / 6nter 7'0? when asked i- you want to eDecute the re'air/
Note$ Your actual scri't name is most likely di--erent than the eDam'le/
RMA<; repair failure;
S&ra&e43. The re$a*r *ncl!%es co)$le&e )e%*a recover3 E*&h no
%a&a loss
Re$a*r scr*$&.
!"#a$$oracle%*a4r%b)sorclorclh)reco_12F(CI10#1'h)
con&en&s of re$a*r scr*$&.
N blocP )e%*a recover3 for )!l&*$le blocPs
recover %a&af*le I blocP #(2 &o #1"M
Do 3o! reall3 Ean& &o eGec!&e &he above re$a*r 5en&er @ES or
<O6? 7'0
eGec!&*n4 re$a*r scr*$&
S&ar&*n4 recover a& (""29"I9(1.#C.1F.10
!s*n4 channel ORA_DISL_#
!s*n4 channel ORA_S>T_TA-E_#
ORA9"#"#1. !ser reB!es&e% cancel of c!rren& o$era&*o
channel ORA_S>T_TA-E_#. res&or*n4 blocP5s6 fro) %a&af*le co$3
JARAorcl%a&af*lebc&bs'(2C'C2(27C"7F
s&ar&*n4 )e%*a recover3
)e%*a recover3 co)$le&e8 ela$se% &*)e. "".""."1
A*n*she% recover a& (""29"I9(1.#C.1F.17
re$a*r fa*l!re co)$le&e
RMA<;
8@ %ist all -ailures in )MA&/ There should y none/
RMA<; list failure all;
no fa*l!res fo!n% &ha& )a&ch s$ec*f*ca&*on
RMA<; exit
:@ To clean u' the 'ractice en*ironment? run the bc_clean!$'sh scri't -rom the
$HOMElabs directory/
$ cat bc_cleanup.sh
NXb*nbash
N Aor &ra*n*n4 $!r$ose onl3
N99 Clean!$ &he &ables$ace8 an% !ser fro) &he corr!$& blocPs
Oracle Internal & Oracle cadem! "#e Onl!
Practice 8-2: Re-airing +(oc, Corru-tion $continued%
Oracle Database 11g: Administration Workshop II A ; 110
sBl$l!s 9S nolo4 ; &)$clean!$'lo (;Y# KKEOA
connec& as s3s%ba
99 CLEA<=- fro) $rev*o!s r!n
DRO- =SER bc CASCADEM
DRO- TA>LES-ACE bc&bs I<CL=DI<D CO<TE<TS A<D DATAAILESM
EOITM
EOA
$ ./bc_cleanup.sh
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 112
4ractices %or :esson 1"
Flashack Transaction Backout is a logical reco*ery o'tion to roll ack a s'eci-ic
transaction and de'endent transactions while the dataase remains online/ A de'endent
transaction is related y a write+a-ter+write BAAA@ relationshi'? in which a transaction
modi-ies the same data that was changed y the target transaction? or a 'rimary+key
constraint relationshi'? in which a transaction reinserts the 'rimary+key *alue that was
deleted y the target transaction/ Flashack Transaction utilizes undo and the redo
generated -or undo locks to create and eDecute a com'ensating transaction -or re*erting
the a--ected data to its original state/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 113
Practice 19-1: '(ashbac, 1ransaction +ac,out
(n this 'ractice? you *iew a demonstration o- acking out erroneous transactions/
.@ Click the oracleZs Ho)e icon on your deskto'/
1@ &a*igate to the ho)eoracle%e)osfb&_bacPo!& directory/
9@ !oule+click the fb&_bacPo!&_v*eEle&_sEf'h&)l -ile/
0@ (n the )un or !is'lay window? click !is'lay and *iew the 'resentation/
3@ =se the controls at the ottom o- the *iewlet window to start? 'ause and sto' the
'resentation? as suits your 'ersonal learning style/
4@ =ninterru'ted *iewing o- the demos takes aout ten minutes/ Ahen you ha*e -inished
*iewing the 'resentation? close your Ae rowser window/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 115
4ractices %or :esson 11
These 'ractices co*er the use o- Flashack !ata Archi*e/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 116
Practice 11-1: :sing '(ashbac, Data Archive
(n this 'ractice? you use 7racle Total )ecall/
.@ %og into $>%EPlus as the S@S user and eDecute the fla%a_se&!$ scri't -rom the
$HOMElabs directory/ The setu' scri't creates a second undo tales'ace? a small
ALA_T>S# tales'ace? and the ARCHI?E_ADMI< user with the oracle_0=
'assword/ The 'assword is case+sensiti*e y de-ault/ Take a -ew moments to ins'ect
the scri't e-ore eDecuting it/
$ sqlplus / as sysdba
S+L; <flada_setup
Connec&e%'
S+L; se& servero!&$!& on
S+L; 99 se& ver*f3 on
S+L; se& &er) on
S+L; se& l*nes (""
S+L; se& $a4es 00
S+L; se& $a!se on
S+L;
S+L; ,== Crea&e a &ables$ace for 3o!r flashbacP %a&a arch*ve
==,
S+L; DRO- TA>LES-ACE fla_&bs# I<CL=DI<D CO<TE<TS
(
DRO- TA>LES-ACE fla_&bs# I<CL=DI<D CO<TE<TS
,
ERROR a& l*ne #.
ORA9""2F2. &ables$ace SALA_T>S#S %oes no& eG*s&
S+L; CREATE SMALLAILE TA>LES-ACE fla_&bs#
( DATAAILE S$HOME>ACL=-fla_&bs"#'%bfS
1 SIRE #"M RE=SE A=TOEOTE<D O< <EOT C0"L MAOSIRE 1(ICIM
0 <OLODDI<D EOTE<T MA<ADEME<T LOCAL SEDME<T S-ACE
MA<ADEME<T A=TO
F
Tables$ace crea&e%'
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
S+L;
S+L; ,== Crea&e a secon% !n%o &ables$ace for &es&*n4 ==,
S+L; DRO- TA>LES-ACE !n%o&bs( I<CL=DI<D CO<TE<TS
(
DRO- TA>LES-ACE !n%o&bs( I<CL=DI<D CO<TE<TS
,
ERROR a& l*ne #.
ORA9""2F2. &ables$ace S=<DOT>S(S %oes no& eG*s&
S+L; CREATE SMALLAILE =<DO TA>LES-ACE !n%o&bs(
( DATAAILE S$HOME>ACL=-!n%o&bs"('%bfS
1 SIRE #"FM RE=SE A=TOEOTE<D O< <EOT F#("L MAOSIRE 1(ICIM
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1!"
0
Tables$ace crea&e%'
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
S+L; ,== Crea&e an ARCHI?E_ADMI< !ser l*Pe &he HR !ser ==,
S+L; ,== E*&h ALA_T>S# %efa!l& &ables$ace ==,
S+L; CREATE =SER ARCHI?E_ADMI< -ROAILE DEAA=LT IDE<TIAIED >@
Woracle_0=W
( DEAA=LT TA>LES-ACE ALA_T>S# TEM-ORAR@ TA>LES-ACE TEM-
1 ACCO=<T =<LOCLM
=ser crea&e%'
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
S+L; DRA<T ALTER SESSIO< TO ARCHI?E_ADMI<M
Dran& s!ccee%e%'
S+L; DRA<T CREATE DATA>ASE LI<L TO ARCHI?E_ADMI<M
Dran& s!ccee%e%'
S+L; DRA<T CREATE SE+=E<CE TO ARCHI?E_ADMI<M
Dran& s!ccee%e%'
S+L; DRA<T CREATE SESSIO< TO ARCHI?E_ADMI<M
Dran& s!ccee%e%'
S+L; DRA<T CREATE S@<O<@M TO ARCHI?E_ADMI<M
Dran& s!ccee%e%'
S+L; DRA<T CREATE ?IE: TO ARCHI?E_ADMI<M
Dran& s!ccee%e%'
S+L; DRA<T =<LIMITED TA>LES-ACE TO ARCHI?E_ADMI<M
Dran& s!ccee%e%'
S+L; DRA<T EOEC=TE O< S@S'D>MS_STATS TO ARCHI?E_ADMI<M
Dran& s!ccee%e%'
S+L; DRA<T CO<<ECT8 RESO=RCE TO ARCHI?E_ADMI<M
Dran& s!ccee%e%'
S+L;
S+L; ,== Se&!$ for AlashbacP Da&a Arch*ve co)$le&e% ==,
S+L; ,== The ARCHI?E_ADMI< !ser has &he $assEor%. oracle_0=
==,
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
S+L;
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1!1
1@ To gi*e the ARCHI?E_ADMI< user administrati*e 'ri*ileges -or creating?
maintaining? and dro''ing -lashack data archi*es? eDecute the -ollowing command
as the S@S user2
DRA<T ALASH>ACL ARCHI?E ADMI<ISTER TO arch*ve_a%)*n
$ sqlplus / as sysdba
M
S+L; ;#(!" %$(0T*(C+ (#CT&D' (16&!&0"'# " archive_admin
;
Dran& s!ccee%e%'
S+L; exit
9@ (n $>%EPlus? connect as the ARCHI?E_ADMI< user with the ARCHI?E_ADMI<
$ sqlplus
'assword/
Note$ The 'assword is case+sensiti*eM the username is not case+sensiti*e/
archive_admin
En&er $assEor%. oracle_9) <<< not displayed
S+L;
0@ To create a -lashack data archi*e? eDecute the -ollowing command2
C#'("' %$(0T*(C+ (#CT&D' fla/
"(*$'0,(C' fla_tbs/
:)"( /46
#'"'!"&! / 7'(#
6ntering the command is recommended -or etter retention? ut i- ty'ing is a di--iculty? you
can also eDecute the
/
fla%a_crea&e'sBl
S+L; CREATE ALASH>ACL ARCHI?E fla#
scri't/
TA>LES-ACE fla_&bs#
+=OTA #"M
RETE<TIO< # @EAR
( 1 0 F
AlashbacP arch*ve crea&e%'
S+L;
3@ Gi*e the 'ri*ilege to use the ALA# archi*e to the HR user? y eDecuting the -ollowing
command2
;#(!" %$(0T*(C+ (#CT&D' on %$(/ to T#;
S+L; DRA<T ALASH>ACL ARCHI?E on ALA# &o HRM
Dran& s!ccee%e%'
S+L;
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1!!
4@ You now switch to the role o- a -lashack archi*e user/ Connect as the HR user with
the oracle_0= 'assword/ To enale this -lashack data archi*e -or the
EM-LO@EES
S+L; connect T#
tale? eDecute the -ollowing command2
($"'# "(*$' hr.employees %$(0T*(C+ (#CT&D' fla/;
En&er $assEor%. oracle_9)
Connec&e%'
<<< not displayed
S+L; ($"'# "(*$' hr.employees %$(0T*(C+ (#CT&D' fla/;
Table al&ere%'
S+L;
;@ To *iew and increase the salary o- Mr/ FoD three times y .<<<? eDecute the
fla%a_%)l scri't as the HR
S+L; <flada_dml
user/ This 'roduces acti*ity in the -lashack data
archi*e/
S+L; REM W,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, W
S+L; REM WAor %e)o $!r$oses O<L@. AlashbacP Da&a Arch*ve W
S+L;
S+L; se& echo on
S+L; se& servero!&$!& on
S+L; 99 se& ver*f3 on
S+L; se& &er) on
S+L; se& l*nes (""
S+L; se& $a4es 00
S+L; se& $a!se on $a!se W-ress [En&er] &o con&*n!e'''W
S+L;
S+L; ,== +!er3 &he c!rren& salar3 for Mr' AoG ==,
S+L;
S+L; SELECT e)$lo3ee_*%8 las&_na)e8 salar3
( AROM hr'e)$lo3ees
1 :HERE las&_na)e = SAoGS
0
,ress R'nterS to continue...
EM-LO@EE_ID LAST_<AME SALAR@
99999999999 9999999999999999999999999 9999999999
#I" AoG 2C""
# roE selec&e%'
S+L;
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
S+L;
S+L; ,== Increase &he salar3 &hree &*)es b3 #""" ==,
S+L;
S+L; =-DATE hr'e)$lo3ees
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1!+
( SET salar3 = salar3 J #"""
1 :HERE las&_na)e = SAoGS
0
# roE !$%a&e%'
S+L; COMMIT
(
Co))*& co)$le&e'
S+L; =-DATE hr'e)$lo3ees
( SET salar3 = salar3 J #"""
1 :HERE las&_na)e = SAoGS
0
# roE !$%a&e%'
S+L; COMMIT
(
Co))*& co)$le&e'
S+L; =-DATE hr'e)$lo3ees
( SET salar3 = salar3 J #"""
1 :HERE las&_na)e = SAoGS
0
# roE !$%a&e%'
S+L; COMMIT
(
Co))*& co)$le&e'
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
S+L;
S+L; ,== +!er3 &he !$9&o9%a&e val!e for Mr' AoG ==,
S+L;
S+L; SELECT e)$lo3ee_*%8 las&_na)e8 salar3
( AROM hr'e)$lo3ees
1 :HERE las&_na)e = SAoGS
0
,ress R'nterS to continue...
EM-LO@EE_ID LAST_<AME SALAR@
99999999999 9999999999999999999999999 9999999999
#I" AoG #(C""
# roE selec&e%'
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1!.
S+L;
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
S+L;
S+L; se& $a!se off
S+L;
8@ To "uery the internal name o- the archi*e tale? eDecute the -ollowing command2
0'$'C" J %#6 )0'#_%$(0T*(C+_(#CT&D'_"(*$'0;
S+L; 0'$'C" J %#6 )0'#_%$(0T*(C+_(#CT&D'_"(*$'0;
TA>LE_<AME O:<ER_<AME
999999999999999999999999999999 999999999999999999999999999999
ALASH>ACL_ARCHI?E_<AME
99999999999999999999999999999999999999999999999999999999999999
ARCHI?E_TA>LE_<AME
99999999999999999999999999999999999999999999999999999
EM-LO@EES HR
ALA#
S@S_A>A_HIST_I1#1I
# roE selec&e%'
S+L;
:@ To ensure that the -ollowing "ueries use the archi*e tales? and not the undo? switch
the undo tales'aces and dro' the old one/ As a S@S user? assign )!1"*0= as the
current undo tales'ace? y using 6nter'rise Manager I $er*erI Automatic =ndo
Management I JChange Tales'aceK utton? selecting the =<DOT>S( tales'ace?
and clicking 7#? or y eDecuting the -ollowing commands2
connect / as sysdba
($"'# 070"'6 0'" )!1_"(*$'0,(C'>)!1"*0=;
1#, "(*$'0,(C' )!1"*0/;
S+L; connect / as sysdba
Connec&e%'
S+L; ($"'# 070"'6 0'" )!1_"(*$'0,(C'>)!1"*0=;
S3s&e) al&ere%'
S+L; 1#, "(*$'0,(C' )!1"*0/;
Tables$ace %ro$$e%'
Note$ (- you eDecute the DRO- command too "uickly? while internal 'rocessing still
occurs? you might recei*e an 7)A+9<<.9 error/ Aait se*eral minutes and try again/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1!0
.<@ As the HR user? choose a time a-ter the creation o- the -lashack data archi*e and
e-ore you eDecuted the erroneous !M%/ To *iew Mr/ FoDNs em'loyee record as o-
that time? eDecute the -ollowing "uery Bre'lace '!' "I#U$% with your chosen
historic date? -ormat eDam'les2 Q3<Q $6C7&!? Q.<Q !AY? Q3Q M7&T5@2
Note$ You recei*e an 7)A+.044 error? i- the time you s'eci-y a time e-ore the
-lashack data archi*e was started/ )educe the time to a smaller inter*al and try
again/ (- you still see the salary o- .14<<? increase your time inter*al/
0'$'C" employee_idC last_nameC salary
%#6 hr.employees (0 % "&6'0"(6,
E070"&6'0"(6, A &!"'#D($ +&+ ,I-./EF
UT'#' last_name > 2%ox2;
6ntering the command is recommended -or etter retention and selecting the right
time inter*al? ut i- ty'ing is a di--iculty? you can also eDecute the fla%a_sel'sBl
S+L; connect hr
scri't/
Ener $assEor%. oracle_9) <<< not displayed
Connec&e%'
S+L; SELECT e)$lo3ee_*%8 las&_na)e8 salar3
( AROM hr'e)$lo3ees AS OA TIMESTAM-
1 5S@STIMESTAM- 9 I<TER?AL S#FS MI<=TE6
0 :HERE las&_na)e = SAoGSM
EM-LO@EE_ID LAST_<AME SALAR@
99999999999 9999999999999999999999999 9999999999
#I" AoG 2C""
# roE selec&e%'
S+L;
..@ As the HR user? you realize that the recent u'dates were mistakes/ To re*ert to the
original *alues -or your chosen historic date B-or eDam'le? ten minutes ago@? eDecute
the -ollowing command Bre'lace '!' "I#U$% with your chosen historic date@2
),1("' hr.employees
0'" salary > E0'$'C" salary %#6 hr.employees
(0 % "&6'0"(6, E070"&6'0"(6, A &!"'#D($ +&+ ,I-./EF
UT'#' last_name > 2%ox2F
UT'#' last_name > 2%ox2;
6ntering the command is recommended -or etter retention and selecting the right
time inter*al? ut i- ty'ing is a di--iculty? you can also eDecute the fla%a_!$%'sBl
S+L; =-DATE hr'e)$lo3ees
scri't/
( SET salar3 = 5SELECT salar3 AROM hr'e)$lo3ees
1 AS OA TIMESTAM- 5S@STIMESTAM- 9 I<TER?AL S#FS MI<=TE6
0 :HERE las&_na)e = SAoGS6
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1!2
F :HERE las&_na)e = SAoGSM
# roE !$%a&e%'
S+L;
.1@ From your $>%EPlus session? connect to the dataase as the S@S user and list the
data dictionary *iews a*ailale to you/ 6Decute the fla%a_l*s&#'sBl
S+L; connect / as sysdba
-ile2
Connec&e%'
S+L; <flada_list/
S+L; REM W,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, W
S+L; REM WAor %e)o $!r$oses O<L@.W
S+L;
S+L; connec& as s3s%ba
Connec&e%'
S+L;
S+L; se& echo on
S+L; se& servero!&$!& on
S+L; 99 se& ver*f3 on
S+L; se& &er) on
S+L; se& l*nes (""
S+L; se& $a4es 00
S+L; se& $a!se on $a!se W-ress [En&er] &o con&*n!e '''W
S+L;
S+L; ,== To l*s& &he ava*lable %a&a %*c&*oar3 v*eEs ==,
S+L;
S+L; SELECT &able_na)e
( AROM %*c&
1 :HERE &able_na)e LILE STALASH>ACL_ARCHI?ETS
0
,ress R'nterS to continue ...
TA>LE_<AME
999999999999999999999999999999
D>A_ALASH>ACL_ARCHI?E
D>A_ALASH>ACL_ARCHI?E_TA>LES
D>A_ALASH>ACL_ARCHI?E_TS
=SER_ALASH>ACL_ARCHI?E
=SER_ALASH>ACL_ARCHI?E_TA>LES
S+L; $a!se -ress [En&er] &o con&*n!e '''
,ress R'nterS to continue ...
S+L;
S+L; col ALASH>ACL_ARCHI?E_<AME for)a& A(F
S+L; col ARCHI?E_TA>LE_<AME for)a& A("
S+L; col TA>LE_<AME for)a& A#(
S+L; col O:<ER_<AME for)a& A#"
S+L;
S+L; DESC %ba_flashbacP_arch*ve
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1!3
<a)e
<!ll? T3$e
9999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999 99999999
99999999999999999999999999999999999999999999999999999999999999
99999999999999
O:<ER_<AME
?ARCHAR(51"6
ALASH>ACL_ARCHI?E_<AME
<OT <=LL ?ARCHAR(5(FF6
ALASH>ACL_ARCHI?EN
<OT <=LL <=M>ER
RETE<TIO<_I<_DA@S
<OT <=LL <=M>ER
CREATE_TIME
TIMESTAM-526
LAST_-=RDE_TIME
TIMESTAM-526
STAT=S
?ARCHAR(5I6
S+L; $a!se -ress [En&er] &o con&*n!e '''
,ress R'nterS to continue ...
S+L;
S+L; ,== To B!er3 &he &*)e Ehen &he flashbacP %a&a arch*ve5s6
have been crea&e% ==,
S+L;
S+L; SELECT flashbacP_arch*ve_na)e8 crea&e_&*)e8 s&a&!s
( AROM %ba_flashbacP_arch*ve
1
,ress R'nterS to continue ...
ALASH>ACL_ARCHI?E_<AME CREATE_TIME
STAT=S
9999999999999999999999999 999999999999999999999999999999999999
999999999999999999999999999999999999999 9999999
ALA# "F9/=<9"2 ##'"C'"2'""""""""" -M
S+L; $a!se -ress [En&er] &o con&*n!e '''
,ress R'nterS to continue ...
S+L;
S+L; DESC %ba_flashbacP_arch*ve_&s
<a)e
<!ll? T3$e
9999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999 99999999
99999999999999999999999999999999999999999999999999999999999999
99999999999999
ALASH>ACL_ARCHI?E_<AME
<OT <=LL ?ARCHAR(5(FF6
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1!5
ALASH>ACL_ARCHI?EN
<OT <=LL <=M>ER
TA>LES-ACE_<AME
<OT <=LL ?ARCHAR(51"6
+=OTA_I<_M>
?ARCHAR(50"6
S+L; $a!se -ress [En&er] &o con&*n!e '''
,ress R'nterS to continue ...
S+L;
S+L; ,== To l*s& &he &ables$ace5s68 Eh*ch are !se% for
flashbacP %a&a arch*ves ==,
S+L;
S+L; SELECT ,
( AROM %ba_flashbacP_arch*ve_&s
1
-ress [En&er] &o con&*n!e '''
ALASH>ACL_ARCHI?E_<AME ALASH>ACL_ARCHI?EN TA>LES-ACE_<AME
+=OTA_I<_M>
9999999999999999999999999 999999999999999999 99999999999999999
9999999999999 9999999999999999999999999999999999999999
ALA# # ALA_T>S#
#"
S+L; $a!se -ress [En&er] &o con&*n!e '''
,ress R'nterS to continue ...
S+L;
S+L; DESC %ba_flashbacP_arch*ve_&ables
<a)e
<!ll? T3$e
9999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999 99999999
99999999999999999999999999999999999999999999999999999999999999
99999999999999
TA>LE_<AME
<OT <=LL ?ARCHAR(51"6
O:<ER_<AME
<OT <=LL ?ARCHAR(51"6
ALASH>ACL_ARCHI?E_<AME
<OT <=LL ?ARCHAR(5(FF6
ARCHI?E_TA>LE_<AME
?ARCHAR(5F16
STAT=S
?ARCHAR(576
S+L; $a!se -ress [En&er] &o con&*n!e '''
,ress R'nterS to continue ...
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1!6
S+L;
S+L; ,== +!er3 &he &able na)e5s68 &he oEner na)e5s68 an% ==,
S+L; ,== &he *n&ernal Wh*s&or3W &able na)e5s6 of &he
flashbacP %a&a arch*ve ==,
S+L;
S+L; SELECT ,
( AROM %ba_flashbacP_arch*ve_&ables
1
,ress R'nterS to continue ...
TA>LE_<AME O:<ER_<AME ALASH>ACL_ARCHI?E_<AME ARCHI?E_TA>LE_<AME
99999999999 9999999999 9999999999999999999999 999999999999999999
EM-LO@EES HR ALA# S@S_A>A_HIST_I1#1I
S+L;
S+L; $a!se -ress [En&er] &o con&*n!e '''
,ress R'nterS to continue ...
S+L; clear col!)ns
S+L;
.9@ As the HR user Bwith the oracle_0= 'assword@? list the ALASH>ACL_ARCHI?E
data dictionary tales? which are accessile to you/ You can eDecute the
fla%a_l*s&(
S+L; connect hr
scri't? i- you 're-er to not enter the commands directly/
En&er $assEor%. oracle_9) <<< not dislplayed
Connec&e%'
S+L; <flada_list=
S+L; SELECT &able_na)e
( AROM %*c&
1 :HERE &able_na)e LILE STALASH>ACL_ARCHI?ETS
0
,ress R'nterS to continue ...
TA>LE_<AME
999999999999999999999999999999
=SER_ALASH>ACL_ARCHI?E
=SER_ALASH>ACL_ARCHI?E_TA>LES
S+L; $a!se -ress [En&er] &o con&*n!e '''
,ress R'nterS to continue ...
S+L; eG*&
$
.0@ To 'ractice additional -lashack data archi*e maintenance tasks? 'er-orm the
-ollowing ste's2 %og into $>%EPlus as the ARCHI?E_ADMI<
$ sqlplus
user/
En&er $assEor%.
(#CT&D'_(16&!
oracle_9) <<< not displayed
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1+"
S+L;
.3@ !ata in the -lashack data archi*e is automatically 'urged when the retention time
eD'ires/ 5owe*er? you can also 'urge data eD'licitly with the -ollowing command to
'urge data older than two minutes2
ALTER ALASH>ACL ARCHI?E fla# -=RDE >EAORE TIMESTAM-
5S@STIMESTAM- 9 I<TER?AL S(S MI<=TE6M
S+L; ($"'# %$(0T*(C+ (#CT&D' fla/ ,)#;' *'%#'
"&6'0"(6,E070"&6'0"(6, A &!"'#D($ 2=2 6&!)"'F;
AlashbacP arch*ve al&ere%'
S+L;
.4@ 6Decute the fla%a_&bs('sBl scri't to create an additional .< MB
S+L; <flada_tbs=
tales'ace as
the S@S user/
Connec&e%'
S+L; se& servero!&$!& on
S+L; 99 se& ver*f3 on
S+L; se& &er) on
S+L; se& l*nes (""
S+L; se& $a4es 00
S+L; se& $a!se on
S+L;
S+L; ,== Crea&e ano&her &ables$ace ==,
S+L;
S+L; DRO- TA>LES-ACE fla_&bs( I<CL=DI<D CO<TE<TS
(
DRO- TA>LES-ACE fla_&bs( I<CL=DI<D CO<TE<TS
,
ERROR a& l*ne #.
ORA9""2F2. &ables$ace SALA_T>S(S %oes no& eG*s&
S+L;
S+L; CREATE SMALLAILE TA>LES-ACE fla_&bs(
( DATAAILE S$HOME>ACL=-fla_&bs"('%bfS
1 SIRE #"M RE=SE A=TOEOTE<D O< <EOT C0"L MAOSIRE 1(ICIM
0 <OLODDI<D EOTE<T MA<ADEME<T LOCAL SEDME<T S-ACE
MA<ADEME<T A=TO
F
Tables$ace crea&e%'
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
S+L;
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1+1
.;@ As the ARCHI?E_ADMI<
S+L; connect
user? add 3 MB o- the ALA_T>S( tales'ace to the ALA#
-lashack data archi*e/
En&er $assEor%.
(#CT&D'_(16&!
Connec&e%'
oracle_9) <<< not displayed
S+L; ($"'# %$(0T*(C+ (#CT&D' fla/ (11 "(*$'0,(C' fla_tbs=
:)"( .6;
AlashbacP arch*ve al&ere%'
S+L;
.8@ All tales in one s'eci-ic -lashack data archi*e ha*e the same retention time/ Change
the retention time o- the ALA# -lashack data archi*e to two years/
S+L; ($"'# %$(0T*(C+ (#CT&D' fla/ 61&%7 #'"'!"&! = 7'(#;
AlashbacP arch*ve al&ere%'
S+L;
.:@ As the ARCHI?E_ADMI< user? dro' the ALA#
S+L; 1#, %$(0T*(C+ (#CT&D' fla/;
-lashack data archi*e/
Note$ !ro''ing a -lashack data archi*e includes dro''ing the internal tam'er'roo-ed
history tale/ You cannot dro' this tale directly due to auditing and security
re"uirements/ !ro''ing a -lashack data archi*e does not dro' the tales'aces in
which they are stored? ecause the tales'aces might contain other data/
AlashbacP arch*ve %ro$$e%'
S+L;
1<@ Aait a minute or two and connect as S@S userM clean u' your en*ironment y
eDecuting the fla%a_clean!$'sBl scri't/
S+L; <flada_cleanup
S+L; REM EGec!&e &h*s scr*$& scr*$& for &ra*n*n4 $!r$oses onl3
S+L; REM =n%o Clean!$ for AlashbacP Da&a Arch*ve
S+L; REM EGec!&e scr*$& as S@SD>A
S+L;
S+L; se& echo on
S+L; se& servero!&$!& on
S+L; se& &er) on
S+L; se& l*nes (""
S+L; se& $a!se on
S+L;
S+L; connec& as s3s%ba
Connec&e%'
S+L; se& echo off
Tables$ace crea&e%'
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-1: :sing '(ashbac, Data Archive $continued%
Oracle Database 11g: Administration Workshop II A ; 1+!
S+L;
S+L; ALTER S@STEM SET =<DO_TA>LES-ACE=!n%o&bs#
(
S3s&e) al&ere%'
S+L; DRO- TA>LES-ACE fla_&bs# I<CL=DI<D CO<TE<TS
(
Tables$ace %ro$$e%'
S+L; DRO- TA>LES-ACE fla_&bs( I<CL=DI<D CO<TE<TS
(
Tables$ace %ro$$e%'
S+L;
S+L; DRO- TA>LES-ACE !n%o&bs( I<CL=DI<D CO<TE<TS
(
Tables$ace %ro$$e%'
S+L; hos& r) 9f $HOME>ACL=-fla_&bs"#'%bf
S+L; hos& r) 9f $HOME>ACL=-fla_&bs"('%bf
S+L; hos& r) 9f $HOME>ACL=-!n%o&bs"('%bf
S+L; $ro)$& AlashbacP Da&a Arch*ve clean!$ co)$le&e'
AlashbacP Da&a Arch*ve clean!$ co)$le&e'
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
S+L; eG*&
Note$ (- you eDecute the DRO- command too "uickly while internal 'rocessing is still
occurring? you might recei*e an 7)A+9<<.9 error/ Aait and try again/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 1++
Practice 11-2: :sing the Rec)c(e +in
(n this 'ractice you use the recycle in to restore dro''ed o,ects/ You can do this with
$>% commands or with 6nter'rise Manager/ &or the 'ormer( per'orm steps through ).
&or the latter( per'orm step ( and then steps ! through .
.@ This worksho' scenario simulates loss o- data/ Point to the orcl
$ cd LT6'/labs
instance/ To
introduce the 'rolem? change directory to $HOMElabs and run the
rec3cleb*n_lab'sh as shown2
$. oraenv
ORACLE_SID = [orcl] ? orcl
$ ./recyclebin_lab.sh
S+L; S+L;
Table %ro$$e%'
S+L; S+L; selec& , fro) hr'%e$ar&)en&s
,
ERROR a& l*ne #.
ORA9""20(. &able or v*eE %oes no& eG*s&
S+L; selec& , fro) hr'%e$ar&)en&s
,
ERROR a& l*ne #.
ORA9""20(. &able or v*eE %oes no& eG*s&
S+L; selec& , fro) hr'%e$ar&)en&s
,
ERROR a& l*ne #.
ORA9""20(. &able or v*eE %oes no& eG*s&
1@ The la scri't dro's the HR'DE-ARTME<TS tale including indeDes? restraints? and
so on/ >uery the D>A_REC@CLE_>I< *iew to con-irm this/
$ sqlplus / as sysdba
S+L; C$ U!'# %#6(" (.
S+L; 0'$'C" ownerC original_nameC droptime
%#6 dba_recyclebin UT'#' owner > 2T#2;
O:<ER ORIDI<AL_<AME DRO-TIME
99999 99999999999999999999999999999999 9999999999999999999
HR DE-T_ID_-L (""29"C9"C.#F.1#."F
HR DE-ARTME<TS (""29"C9"C.#F.1#."F
HR DE-T_LOCATIO<_IO (""29"C9"C.#F.1#."0
9@ =se Flashack Tale to restore the dro''ed o,ects/ You can use Flashack Tale
through 6nter'rise Manager or through $>%EPlus/ To -lash ack the tale using
6nter'rise Manager? go to ste' 3/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-2: :sing the Rec)c(e +in $continued%
Oracle Database 11g: Administration Workshop II A ; 1+.
S+L; %$(0T*(C+ "(*$' hr.departments " *'%#' 1#,;
AlashbacP co)$le&e'
S+L;
0@ Per-orm a select o'eration against the HR'DE-ARTME<TS tale to con-irm the
success o- the Flashack Tale o'eration? then eDit
S+L; 0'$'C" J %#6 hr.departments;
DE-ARTME<T_ID DE-ARTME<T_<AME MA<ADER_ID LOCATIO<_ID
9999999999999 99999999999999999999999999 9999999999 99999999999
#" A%)*n*s&ra&*on ("" #I""
(" MarPe&*n4 ("# #7""
1" -!rchas*n4 ##0 #I""
' ' '
S+L; exit
3@ The HR'DE-ARTME<TS tale can also e -lashed ack using 6nter'rise Manager/
4@ %og in as the S@S user with the oracle_0= 'assword and connect as S@SD>A
;@ (n 6M? na*igate to $chema I Tales/
/
8@ Click the )ecycle Bin utton? enter HR in the $chema &ame -ield and click Go/
:@ Click the F icon e-ore DE-ARTME<TS? to see the de'endant o,ects/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-2: :sing the Rec)c(e +in $continued%
Oracle Database 11g: Administration Workshop II A ; 1+0
.<@ $elect DE-ARTME<TS -rom the list and click the Flashack !ro' utton/
..@ The Per-orm 7,ect %e*el )eco*ery2 )ename 'age allows you to rename the restored
o,ect/ Acce't the de-ault or original name and click &eDt/
.1@ 7n the )e*iew 'age? ins'ect the (m'act Analysis/ &ote that the tale and de'endent
o,ects are to e restored and note the names they will e restored to/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-2: :sing the Rec)c(e +in $continued%
Oracle Database 11g: Administration Workshop II A ; 1+2
.9@ 7'tionally? click the $how $>% utton? re*iew the $>% and click 7#/
.0@ Click $umit/
.3@ Click 7# on the Con-irmation 'age/
.4@ To *iew tale data in 6M2
a@ Click the Tales readcrum/
@ 6nter HR
c@ $elect the
as $chema and click Go/
DE-ARTME<TS tale? then the View !ata Actions? and click Go to
eDecute the action/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 11-2: :sing the Rec)c(e +in $continued%
Oracle Database 11g: Administration Workshop II A ; 1+3
.;@ A-ter con-irming that the data are restored? click 7#/ Then eDit 6M/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 1+5
4ractices %or :esson 1!
(n this lesson you learn to -lash ack an entire dataase/
-ac7ground$ (n this scenario? the 5) reorganization ,o runs 'rematurely? and you must
undo its changes/ The changes are such that you are not sure what tales are in*ol*ed/ $o?
you decide Bnow that -lashack logging has een enaled@ to use Flashack !ataase
instead o- 'er-orming a reco*ery/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 1+6
Practice 12-1: '(ashbac, Database
Flash ack an entire dataase/ =nless s'eci-ied otherwise? you should log in as the S@S user
as S@SD>A through $>%EPlus or !ataase Control/
.@ =sing 6nter'rise Manager? turn on -lashack logging -or your dataase Benale
Flashack !ataase@/
a@ (n !ataase Control? click the A*ailaility ta? and then the )eco*ery $ettings
link in the Backu'L)eco*ery $etu' region/
@ $croll down and select the 6nale Flashack !ataase check oD/ Click A''ly/
7n the Con-irmation 'age? click Yes to 'roceed with the dataase shutdown/
c@ 7n the Con-irmation 'age? click Yes to restart your dataase/
d@ 7n the )estart !ataase2 $'eci-y 5ost and Target !ataase Credentials? ensure
that oracle
e@ 7'tionally? on the )estart !ataase2 Con-irmation 'age? click $how $>%? re*iew
the $>% and click )eturn/
is entered as username and as 'assword/ Then click 7#/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 12-1: '(ashbac, Database $continued%
Oracle Database 11g: Administration Workshop II A ; 1."
-@ Click Yes on the )estart !ataase2 Con-irmation 'age/
g@ Click )e-resh and wait -or the dataase to restart/ B(- you recei*e an internal error?
,ust cllick 7# and than again )e-resh/@ + You may need to click )e-resh se*eral
times/
1@ A-ter the dataase has een restarted with -lashack logging enaled? note the lowest
$C& o- the dataase
a@ 7n the !ataase home 'age? click the Flashack Time link in the 5igh
A*ailaility section/ R03S
@ 7n the )eco*ery $ettings 'age? at the ottom o- the Flash )eco*ery section? note
the %owest $C& RR04rSS B
9@ Alternati*ely? you can *iew and note the current $C& o- the dataase y "uerying the
?$DATA>ASE *iew/
..940:1 in this eDam'le@/
Note: You will need the *+# later.
$C&2 GGGGGGGGGGGGGGGG
a@ 6nter the -ollowing2
$ cd LT6'/labs
$ sqlplus / as sysdba
S+L; 0'$'C" current_scn %#6 vLdatabase;
C=RRE<T_SC<
99999999999
##1I1CI
0@ &ote the sum o- the salaries in the HR'EM-LO@EES tale and the count o- the rows
in the /O>_HISTOR@ tale/
S+L; 0'$'C" 0)6EsalaryF %#6 hr.employees;
S=M5SALAR@6
99999999999
Oracle Internal & Oracle cadem! "#e Onl!
Practice 12-1: '(ashbac, Database $continued%
Oracle Database 11g: Administration Workshop II A ; 1.1
C2#0#C
S+L; 0'$'C" C)!"EJF %#6 hr.Pob_history;
CO=<T5,6
9999999999
#"
3@ To 'er-orm some 5) reorganization u'dates? /
a@ Connect as HR user with the oracle_0=
@ 6Decute the flb_%b_&Gn'sBl scri't/
'assword/
S+L; connect hr
En&er $assEor%. oracle_9) <<< not displayed
Connec&e%'
S+L; <flb_db_txn.sql
S+L;
S+L; !$%a&e e)$lo3ees se& %e$ar&)en&_*% = 2" Ehere Vob_*% =
SIT_-RODSM
F roEs !$%a&e%'
S+L;
S+L; !$%a&e e)$lo3ees e se& salar3 = leas&5e'salar385selec&
5)*n_salar3 J )aG_salar36( , #'#" fro) Vobs V Ehere V'Vob_*%
= e'Vob_*%66 Ehere Vob_*% no& l*Pe SAD_TSM
#"1 roEs !$%a&e%'
S+L;
S+L; co))*&M
Co))*& co)$le&e'
S+L;
4@ As the S@S
&ote that these *alues are di--erent -rom what was "ueried in ste's 1 and 9/
user? note the current $C& in the dataase again? and also the salary sum
and the /O>_HISTOR@ row count/
S+L; connect / as sysdba
Connec&e%'
S+L; 0'$'C" current_scn %#6 vLdatabase;
C=RRE<T_SC<
99999999999
Oracle Internal & Oracle cadem! "#e Onl!
Practice 12-1: '(ashbac, Database $continued%
Oracle Database 11g: Administration Workshop II A ; 1.!
##1IF7C
S+L; 0'$'C" 0)6EsalaryF %#6 hr.employees;
S=M5SALAR@6
99999999999
CI2"2('0
S+L; 0'$'C" C)!"EJF %#6 hr.Pob_history;
CO=<T5,6
9999999999
#F
S+L;
;@ =sing )MA&? -lash ack the dataase to the -irst $C& *alue noted in ste' 1
B..9;94; in this eDam'le@/
a@ $hut down and then mount the dataase y entering the -ollowing2
S+L; 0T)"1U! &66'1&("'
Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
S+L; 0"(#"), 6)!"
ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 07#(F2F(" b3&es
A*Ge% S*He #11I1(0 b3&es
?ar*able S*He 17F7I7"1C b3&es
Da&abase >!ffers 77"7"170 b3&es
Re%o >!ffers F2C1IIC b3&es
Da&abase )o!n&e%'
S+L; exit
@ (- you ha*e any )MA& o'en? close them/ Then log in to )MA& again/
$ rman target / nocatalog
connec&e% &o &ar4e& %a&abase. ORCL 5D>ID=#(("F1F07"8 no& o$en6
!s*n4 &ar4e& %a&abase con&rol f*le *ns&ea% of recover3 ca&alo4
RMA<;
c@ At the )MA& 'rom't? enter the ALASH>ACL DATA>ASE command? and su''ly
the $C& numer recorded in ste' 12
RMA<; %$(0T*(C+ 1("(*(0' " 0C!>//?N?KN;
S&ar&*n4 flashbacP a& (""29"I9(1.(#."F.(2
alloca&e% channel. ORA_DISL_#
channel ORA_DISL_#. SID=(I %ev*ce &3$e=DISL
Oracle Internal & Oracle cadem! "#e Onl!
Practice 12-1: '(ashbac, Database $continued%
Oracle Database 11g: Administration Workshop II A ; 1.+
alloca&e% channel. ORA_S>T_TA-E_#
channel ORA_S>T_TA-E_#. SID=(7 %ev*ce &3$e=S>T_TA-E
channel ORA_S>T_TA-E_#. :AR<I<D. Oracle Tes& D*sP A-I
s&ar&*n4 )e%*a recover3
)e%*a recover3 co)$le&e8 ela$se% &*)e. "".""."1
A*n*she% flashbacP a& (""29"I9(1.(#."F.10
RMA<;
8@ Be-ore o'ening the dataase -or read and write o'erations? *eri-y that the dataase
was -lashed ack to the correct $C& y looking at the contents o- the tales and
seeing that they are ack to what was noted in ste' 9/
a@ %ogged into $>%EPlus as $Y$!BA? enter the -ollowing coomand to o'en the
dataase in read+only mode2
S+L; alter database open read only;
Da&abase al&ere%'
@ 6nter the -ollowing at the $>% 'rom't to determine the salary sum -or the
EM-LO@EES tale/
S+L; 0'$'C" 0)6EsalaryF %#6 hr.employees;
S=M5SALAR@6
99999999999
C2#0#C
:@ 7'en the dataase -or read and write o'eations/ You ha*e to use the RESETLODS
keyword/
a@ $hut down the dataase2
S+L; shutdown immediate
Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
@ $tart u' the dataase in the MO=<T state2
S+L; startup mount
ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 07#(F2F(" b3&es
A*Ge% S*He #11I1(0 b3&es
?ar*able S*He 17F7I7"1C b3&es
Da&abase >!ffers 77"7"170 b3&es
Oracle Internal & Oracle cadem! "#e Onl!
Practice 12-1: '(ashbac, Database $continued%
Oracle Database 11g: Administration Workshop II A ; 1..
Re%o >!ffers F2C1IIC b3&es
Da&abase )o!n&e%'
S+L;
c@ 7'en the dataase in readLwrite mode with resetlogs2
S+L; alter database open resetlogs;
Da&abase al&ere%'
B$he command might take a while to e,ecute.@
.<@ At this 'oint you can -amiliarize yoursel- with the -lashack+related VO *iews/ To see
time *alues? alter your session to dis'lay hours? minutes? and seconds with any date
*alues/
S+L; ($"'# 0'00&! 0'" !$0_1("'_%#6(">8yyyyAmmAdd
hh=9BmiBss8;
..@ >uery the ?$ALASH>ACL_DATA>ASE_LOD *iew and determine the lowest $C&
that the dataase can e -lashed ack to/ )ecord your answer here2 GGGGGGGGGGGGG
S+L; set wrap off
S+L; select J from vL%$(0T*(C+_1("(*(0'_$;;
OLDEST_ALASH>ACL_SC< OLDEST_ALASH>ACL_TI RETE<TIO<_TARDET
ALASH>ACL_SIRE
99999999999999999999 9999999999999999999 9999999999999999 9999
9999999999
##1C02( (""29"I9(1 (".0I.#I #00"
#C170"""
S+L;
.1@ View the o*erhead associated with -lashack logging and related o'erations y
"uerying ?$ALASH>ACL_DATA>ASE_STAT/ Ahat is the a*erage numer o- ytes
o- -lashack data written 'er minute during this time inter*alC
S+L; select J from DL%$(0T*(C+_1("(*(0'_0"(";
&r!nca&*n4 5as reB!es&e%6 before col!)n
ESTIMATED_ALASH>ACL_SIRE
OLDEST_ALASH>ACL_SC< OLDEST_ALASH>ACL_TI RETE<TIO<_TARDET
ALASH>ACL_SIRE
99999999999999999999 9999999999999999999 9999999999999999 9999
9999999999
##1C02( (""29"I9(1 (".0I.#I #00"
#C170"""
S+L; selec& , fro) ?$ALASH>ACL_DATA>ASE_STATM
Oracle Internal & Oracle cadem! "#e Onl!
Practice 12-1: '(ashbac, Database $continued%
Oracle Database 11g: Administration Workshop II A ; 1.0
&r!nca&*n4 5as reB!es&e%6 before col!)n
ESTIMATED_ALASH>ACL_SIRE
>EDI<_TIME E<D_TIME ALASH>ACL_DATA
D>_DATA REDO_DATA
9999999999999999999 9999999999999999999 99999999999999 9999999
999 9999999999
(""29"I9(1 =/B4N.FC (""29"I9(1 =/B/=.#1 9.?@?K@
" #1I(#C"
S+L;
(n the eDam'le ao*e? the answer is 0F171C7 5(#."I [ (#.#(
.9@ !etermine the current size o- stored -lashack data y "uerying
?$ALASH>ACL_DATA>ASE_LOD/ )ecord your answer here2 GGGGGGGGGGGGG'
@ which is
2"ICI1 ytes 'er minute/ Your numers may *ary slightly/
S+L; 0'$'C" flashbac-_size %#6 DL%$(0T*(C+_1("(*(0'_$;;
ALASH>ACL_SIRE
99999999999999
(0FIC"""
Note$ Your results will 'roaly *ary slightly -rom those shown here/
.0@ To turn o-- the -lashack dataase -unctionality? eDecute the -ollowing command/
S+L; ($"'# 1("(*(0' %$(0T*(C+ %%;
Da&abase al&ere%'
S+L; exit
Note$ The command might take a cou'le o- minutes to eDecute/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 1.2
4ractices %or :esson 1+
(n this 'ractice? you use Automatic Memory Management to show that you no longer
need to manually modi-y SDA_TARDET and -DA_ADDREDATE_TARDET/ You oser*e
the memory distriution when you run an eD'ensi*e 'arallel "uery that consumes a lot o-
$GA memory/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 1.3
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
(n this 'ractice? you use the *arious new memory management ca'ailities/
.@ For your orcl dataase? na*igate into the labs
$ . oraenv
directory? turn o-- archi*ing? and
sto' 6nter'rise Manager !ataase Control/
ORACLE_SID = [orcl] ? orcl
$ cd ~/labs
$ ./orcl_to_noarchivelog.sh
Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 07#(F2F(" b3&es
A*Ge% S*He #11I1F( b3&es
?ar*able S*He 1I1(2F"2C b3&es
Da&abase >!ffers #""CC1(2C b3&es
Re%o >!ffers F2C1IIC b3&es
Da&abase )o!n&e%'
Da&abase al&ere%'
Da&abase al&ere%'
$ emctl stop dbconsole
Oracle En&er$r*se Mana4er ##4 Da&abase Con&rol Release
##'('"'"'(
Co$3r*4h& 5c6 #22C8 (""2 Oracle Cor$ora&*on' All r*4h&s
reserve%'
h&&$s.e%rsr1I$#'!s'oracle'co).##F7e)consoleabo!&A$$l*ca&*
on
S&o$$*n4 Oracle En&er$r*se Mana4er ##4 Da&abase Con&rol '''
''' S&o$$e%'
$
1@ "a7e a cop# of #our !P(80E? logged in to $>%EPlus -or the orcl instance as the
S@S user with the oracle_0=
$ sqlplus / as sysdba
'assword/
S+L; C#'("' ,%&$'>2/tmp/initorcl.ora.ba-2 %#6 0,%&$';
A*le crea&e%'
S+L;
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;1.5
9@ $till connected as the S@S user in $>%EPlus? set the -ollowing 'arameters to the
gi*en *alue in your $PF(%6 onlyT =se the a))_$ara)e&ers'sBl -ile located in
your ho)eoraclelabs directory/
_-O_!se_lar4e_$ool = TR=E
_)e)or3_broPer_s&a&_*n&erval = F
_)e)or3_)ana4e)en&_&rac*n4 = 1#
$arallel_eGec!&*on_)essa4e_s*He = 1C7C0
$arallel_)aG_servers = (""
$arallel_a%a$&*ve_)!l&*_!ser = AALSE
$rocesses = (""
s4a_&ar4e& = "
$4a_a44re4a&e_&ar4e& = "
)e)or3_&ar4e& = 1""M
S+L; <amm_parameters
S+L; al&er s3s&e) se& W_-O_!se_lar4e_$oolW = TR=E
SCO-E=S-AILEM
S3s&e) al&ere%'
S+L; al&er s3s&e) se& W_)e)or3_broPer_s&a&_*n&ervalW = F
SCO-E=S-AILEM
S3s&e) al&ere%'
S+L; al&er s3s&e) se& W_)e)or3_)ana4e)en&_&rac*n4W = 1#
SCO-E=S-AILEM
S3s&e) al&ere%'
S+L; al&er s3s&e) se& W$arallel_eGec!&*on_)essa4e_s*HeW =
1C7C0 SCO-E=S-AILEM
S3s&e) al&ere%'
S+L; al&er s3s&e) se& W$arallel_)aG_serversW = (""
SCO-E=S-AILEM
S3s&e) al&ere%'
S+L; al&er s3s&e) se& W$arallel_a%a$&*ve_)!l&*_!serW = AALSE
SCO-E=S-AILEM
S3s&e) al&ere%'
S+L; al&er s3s&e) se& W$rocessesW = ("" SCO-E=S-AILEM
S3s&e) al&ere%'
S+L; al&er s3s&e) se& W$4a_a44re4a&e_&ar4e&W = " SCO-E=S-AILEM
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;1.6
S3s&e) al&ere%'
S+L; al&er s3s&e) se& Ws4a_&ar4e&W = " SCO-E=S-AILEM
S3s&e) al&ere%'
S+L; al&er s3s&e) se& W)e)or3_&ar4e&W = 1""M SCO-E=S-AILEM
S3s&e) al&ere%'
S+L;
0@ 6Decute the a))_se&!$'sBl scri't/
a@ !ro' and recreate the T>SSDA and M@TEM- tales'aces and the AMM
S+L; <amm_setup.sql
!BA user
-or whom they are de-aults/ Then 'ress 6nter to continue/
S+L; REM W,,,,,,,,,,,,,,,,,,,,,,,,,, W
S+L; REM WAor &ra*n*n4 $!r$oses O<L@8 eGec!&e as &he oracle OS
!ser
S+L;
S+L; se& echo on
S+L; se& servero!&$!& on
S+L; se& &er) on
S+L; se& l*nes (""
S+L; se& $a4es 00
S+L; se& $a!se on $a!se W-ress [En&er] &o con&*n!e'''W
S+L;
S+L; %ro$ &ables$ace &bss4a *ncl!%*n4 con&en&s an% %a&af*lesM
%ro$ &ables$ace &bss4a *ncl!%*n4 con&en&s an% %a&af*les
,
ERROR a& l*ne #.
ORA9""2F2. &ables$ace ST>SSDAS %oes no& eG*s&
S+L;
S+L; crea&e &ables$ace &bss4a %a&af*le SJDATAS s*He (")M
Tables$ace crea&e%'
S+L;
S+L; %ro$ &ables$ace )3&e)$ *ncl!%*n4 con&en&s an% %a&af*lesM
%ro$ &ables$ace )3&e)$ *ncl!%*n4 con&en&s an% %a&af*les
,
ERROR a& l*ne #.
ORA9""2F2. &ables$ace SM@TEM-S %oes no& eG*s&
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;10"
S+L;
S+L; crea&e &e)$orar3 &ables$ace )3&e)$ &e)$f*le SJDATAS s*He
0") re!seM
Tables$ace crea&e%'
S+L;
S+L; %ro$ !ser a)) casca%eM
%ro$ !ser a)) casca%e
,
ERROR a& l*ne #.
ORA9"#2#7. !ser SAMMS %oes no& eG*s&
S+L;
S+L; crea&e !ser a)) *%en&*f*e% b3 \oracle_0=Z
( %efa!l& &ables$ace &bss4a
1 &e)$orar3 &ables$ace )3&e)$M
=ser crea&e%'
S+L;
S+L; 4ran& connec&8reso!rce8%ba &o a))M
Dran& s!ccee%e%'
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
@ To *iew the current memory com'onents? "uery the
?$MEMOR@_D@<AMIC_COM-O<E<TS
S+L;
*iew y 'ressing 6nter to continue the
scri't/
S+L;
S+L; SELECT s!bs&r5COM-O<E<T8 "8 #"6 COM-8 C=RRE<T_SIRE CS8
=SER_S-ECIAIED_SIRE =S
( AROM v$)e)or3_%3na)*c_co)$onen&s
1 :HERE C=RRE<T_SIREX="M
,ress R'nterS to continue...
c@ View the "uery result y 'ressing 6nter to continue the scri't/
S+L; col!)n COM- for)a& a#"
S+L;
S+L; SELECT s!bs&r5COM-O<E<T8 "8 #"6 COM-8 C=RRE<T_SIRE CS8
=SER_S-ECIAIED_SIRE =S
( AROM v$)e)or3_%3na)*c_co)$onen&s
1 :HERE C=RRE<T_SIREX="M
-ress [En&er] &o con&*n!e'''
COM- CS =S
9999999999 9999999999 9999999999
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;101
share% $oo #CIII(#C" "
lar4e $ool 0#201"0 "
Vava $ool 0#201"0 "
SDA Tar4e& (720"C2IC "
DEAA=LT b! #"07FIC"" "
-DA Tar4e& #2(21I270 "
C roEs selec&e%'
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
S+L;
3@ %og in as the AMM user with the oracle_0= 'assword? recreate the TA>SDA
S+L; connect amm
tale and
insert rows y 'ressing 6nter to continue the scri't/
En&er $assEor%. oracle_9) <<< not displayed
Connec&e%'
S+L; <amm_setup=.sql
S+L; REM W,,,,,,,,,,,,,,,,,,,,,,,,,, W
S+L; REM WAor &ra*n*n4 $!r$oses O<L@
S+L; REM Connec&e% as &he AMM !ser E*&h &he oracle_0=
$assEor%
S+L; se& servero!&$!& on
S+L; se& &er) on
S+L; se& l*nes (""
S+L; se& $a4es 00
S+L; se& $a!se on $a!se W-ress [En&er] &o con&*n!e'''W
S+L; %ro$ &able &abs4a $!r4eM
%ro$ &able &abs4a $!r4e
,
ERROR a& l*ne #.
ORA9""20(. &able or v*eE %oes no& eG*s&
S+L;
S+L; crea&e &able &abs4a5a n!)ber8 b n!)ber6 &ables$ace
&bss4aM
Table crea&e%'
S+L;
S+L; be4*n
( for * *n #''#""""" loo$
1 *nser& *n&o &abs4a val!es 5*8 *6M
0 en% loo$M
F en%M
C
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;10!
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; co))*&M
Co))*& co)$le&e'
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
a@ Modi-y the TA>SDA tale to J$arallel C0K? create a TEST-DA
S+L;
'rocedure
Bwhich creates a workload@ y 'ressing 6nter to continue the scri't/
S+L; al&er &able &abs4a $arallel C0M
Table al&ere%'
S+L;
S+L; crea&e or re$lace $roce%!re &es&$4a5 $s*He n!)ber 6 as
( be4*n
1 %eclare
0 T@-E nAllo&)en&_&ab&3$ IS TA>LE OA char5("076 I<DEO >@
>I<AR@_I<TEDERM
F )3arra3 nAllo&)en&_&ab&3$M
C be4*n
I for * *n #''$s*He loo$
7 )3arra35*6 .= &o_char5*6M
2 en% loo$M
#" en%M
## en%M
#(
-roce%!re crea&e%'
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
@ Con-irm that there are no errors and "uery the dynamic memory com'onents
again y 'ressing 6nter to continue the scri't/
S+L; shoE errors
<o errors'
S+L;
S+L; SELECT s!bs&r5COM-O<E<T8 "8 #"6 COM-8 C=RRE<T_SIRE CS8
=SER_S-ECIAIED_SIRE =S
( AROM v$)e)or3_%3na)*c_co)$onen&s
1 :HERE C=RRE<T_SIREX="M
,ress R'nterS to continue...
c@ To *iew the "uery results? 'ress 6nter to continue the scri't/
COM- CS =S
9999999999 9999999999 9999999999
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;10+
share% $oo #CIII(#C" "
lar4e $ool 0#201"0 "
Vava $ool 0#201"0 "
SDA Tar4e& (720"C2IC "
DEAA=LT b! #"07FIC"" "
-DA Tar4e& #2(21I270 "
C roEs selec&e%'
S+L;
S+L; $a!se -ress [En&er] &o eG*& &he scr*$&'''
,ress R'nterS to exit the script...
d@ 6Dit the scri't? ut remain in the $>%EPlus session/
S+L; se& $a!se off
S+L;
4@ Connect as S@SD>A in your $>%EPlus session? shut down and start your dataase
instance and then connect again as the AMM user with the oracle_0=
S+L; connect / as sysdba
'assword2
Connec&e%'
S+L; shutdown immediate
Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
S+L;
S+L; 0"(#"),
ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 1#17C""2C b3&es
A*Ge% S*He #11C("0 b3&es
?ar*able S*He ("2I#7177 b3&es
Da&abase >!ffers 2C0C722( b3&es
Re%o >!ffers C11CF#( b3&es
Da&abase )o!n&e%'
Da&abase o$ene%'
S+L;
S+L; connect amm
En&er $assEor%. oracle_9) <<< not displayed
Connec&e%'
S+L;
;@ As the AMM user? determine the current settings -or the *arious memory u--ers as
well as the list o- resized o'erations that were done since you started your instance/
a@ You can use the ammGco)$onen&s'sBl scri't -or that 'ur'ose/
S+L; <amm_components.sql
S+L; se& servero!&$!& on
S+L; se& &er) on
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;10.
S+L; se& l*nes (""
S+L; se& $a4es #""
S+L; se& hea%*n4 on
S+L; col!)n co)$ for)a& a#7
S+L; col!)n f*nal_s*He for)a& 222222222
S+L; col!)n o$er_&3$e for)a& a2
S+L; se& $a!se on $a!se W-ress [En&er] &o con&*n!e'''W
S+L;
S+L; SELECT s!bs&r5COM-O<E<T8 "8 #76 COM-8 C=RRE<T_SIRE CS8
=SER_S-ECIAIED_SIRE =S
( AROM v$)e)or3_%3na)*c_co)$onen&s
1 :HERE C=RRE<T_SIREX="M
,ress R'nterS to continue...
@ To *iew the "uery result? 'ress 6nter to continue the scri't/
COM- CS =S
999999999999999999 9999999999 9999999999
share% $ool 7177C"7" "
lar4e $ool 0#201"0 "
Vava $ool 0#201"0 "
SDA Tar4e& #77I01C7" "
DEAA=LT b!ffer cac 77"7"170 "
-DA Tar4e& #(F7(2#(" "
C roEs selec&e%'
S+L; $a!se -ress [En&er] &o con&*n!e'''
,ress R'nterS to continue...
c@ View the memory com'onents Bordered y descending START_TIME
S+L; SELECT s!bs&r5COM-O<E<T8"8("6 co)$8 AI<AL_SIRE8
O-ER_T@-E8 O-ER_MODE8 s&a&!s
@ y 'ressing
6nter to continue the scri't/
( AROM v$)e)or3_res*He_o$s
1 ORDER >@ START_TIME %escM
,ress R'nterS to continue..'
d@ To *iew the "uery result? 'ress 6nter to continue the scri't/
COM- AI<AL_SIRE O-ER_T@-E O-ER_MODE STAT=S
999999999999999999 9999999999 999999999 999999999 999999999
share% $ool 7177C"7" DRO: IMMEDIATE COM-LETE
DEAA=LT b!ffer cac 77"7"170 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b!ffer cac 2((I0C77 SHRI<L IMMEDIATE COM-LETE
share% $ool I2C2#IIC DRO: IMMEDIATE COM-LETE
lar4e $ool 0#201"0 DRO: IMMEDIATE COM-LETE
Vava $ool 0#201"0 STATIC COM-LETE
s&rea)s $ool " STATIC COM-LETE
SDA Tar4e& #77I01C7" STATIC COM-LETE
-DA Tar4e& #(F7(2#(" STATIC COM-LETE
DEAA=LT b!ffer cac 2C0C722( STATIC IMMEDIATE COM-LETE
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;100
DEAA=LT b!ffer cac #""CC1(2C STATIC IMMEDIATE COM-LETE
ASM >!ffer Cache " STATIC COM-LETE
DEAA=LT b!ffer cac #"07FIC"" STATIC COM-LETE
DEAA=LT b!ffer cac #"07FIC"" STATIC IMMEDIATE COM-LETE
DEAA=LT (L b!ffer " STATIC COM-LETE
DEAA=LT 0L b!ffer " STATIC COM-LETE
DEAA=LT 7L b!ffer " STATIC COM-LETE
DEAA=LT #CL b!ffer " STATIC COM-LETE
DEAA=LT 1(L b!ffer " STATIC COM-LETE
LEE- b!ffer cache " STATIC COM-LETE
REC@CLE b!ffer cac " STATIC COM-LETE
lar4e $ool 0#201"0 STATIC COM-LETE
share% $ool CI#"77C0 STATIC COM-LETE
share% $ool I#1"1#C7 DRO: IMMEDIATE COM-LETE
share% $ool IF02I0I( DRO: IMMEDIATE COM-LETE
DEAA=LT b!ffer cac 2C0C722( I<ITIALIR IMMEDIATE COM-LETE
I<D
(C roEs selec&e%'
S+L; $a!se -ress [En&er] &o eG*& &he scr*$&'''
,ress R'nterS to exit the script...
S+L; se& $a!se off
S+L;
S+L;
8@ )emain connected as the AMM user in your $>%EPlus session and eDecute the
-ollowing "uery/ (mmediately a-ter that? determine the com'onent sizes and resized
o'erations/ You can use B!er3#'sBl scri't -or that 'ur'ose/ Ahat do you oser*eC
selec& ,J -ARALLEL5s (06 , co!n&5,6 fro) 5selec& ,J
$arallel5s (06 , , fro) &abs4a s 4ro!$ b3 a6M
a@ 6Decute the a))_B!er3#'sBl
S+L; <amm_query/.sql
scri't/ You can see that the large 'ool has a much
igger size while the u--er cache is smaller/ This memory trans-er was
automatically done y the system/
S+L; selec& ,J -ARALLEL5s (06 , co!n&5,6 fro) 5selec& ,J
$arallel5s (06 , , fro) &abs4a s 4ro!$ b3 a6M
CO=<T5,6
9999999999
#"""""
S+L;
S+L; col!)n COM- for)a& a#(
S+L;
S+L; selec& s!bs&r5COM-O<E<T8 "8 #"6 COM-8 C=RRE<T_SIRE CS8
=SER_S-ECIAIED_SIRE =S fro) v$)e)or3_%3na)*c_co)$onen&s Ehere
C=RRE<T_SIREX="M
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;102
COM- CS =S
999999999999 9999999999 9999999999
share% $oo 77"7"170 "
lar4e $ool 7177C"7" "
Vava $ool 0#201"0 "
SDA Tar4e& #77I01C7" "
DEAA=LT b! 0#201"0 "
-DA Tar4e& #(F7(2#(" "
C roEs selec&e%'
S+L;
S+L; selec& s!bs&r5COM-O<E<T8 "8 #"6 COM-8 AI<AL_SIRE8
O-ER_T@-E8 O-ER_MODE8 s&a&!s fro) v$)e)or3_res*He_o$s or%er b3
START_TIMEM
COM- AI<AL_SIRE O-ER_T@-E O-ER_MODE STAT=S
999999999999 9999999999 999999999 999999999 999999999
share% $oo CI#"77C0 STATIC COM-LETE
share% $oo I#1"1#C7 DRO: IMMEDIATE COM-LETE
share% $oo IF02I0I( DRO: IMMEDIATE COM-LETE
lar4e $ool 0#201"0 DRO: IMMEDIATE COM-LETE
lar4e $ool 0#201"0 STATIC COM-LETE
Vava $ool 0#201"0 STATIC COM-LETE
s&rea)s $o " STATIC COM-LETE
SDA Tar4e& #77I01C7" STATIC COM-LETE
ASM >!ffer " STATIC COM-LETE
DEAA=LT b! #"07FIC"" STATIC IMMEDIATE COM-LETE
DEAA=LT b! #"07FIC"" STATIC COM-LETE
DEAA=LT b! #""CC1(2C STATIC IMMEDIATE COM-LETE
DEAA=LT b! 2C0C722( STATIC IMMEDIATE COM-LETE
DEAA=LT b! 2C0C722( I<ITIALIR IMMEDIATE COM-LETE
I<D
DEAA=LT (L " STATIC COM-LETE
DEAA=LT 0L " STATIC COM-LETE
DEAA=LT 7L " STATIC COM-LETE
DEAA=LT #C " STATIC COM-LETE
DEAA=LT 1( " STATIC COM-LETE
LEE- b!ffe " STATIC COM-LETE
REC@CLE b! " STATIC COM-LETE
-DA Tar4e& #(F7(2#(" STATIC COM-LETE
DEAA=LT b! 2((I0C77 SHRI<L IMMEDIATE COM-LETE
share% $oo I2C2#IIC DRO: IMMEDIATE COM-LETE
DEAA=LT b! 77"7"170 SHRI<L IMMEDIATE COM-LETE
share% $oo 7177C"7" DRO: IMMEDIATE COM-LETE
DEAA=LT b! 7177C"7" SHRI<L DEAERRED COM-LETE
share% $oo 77"7"170 DRO: DEAERRED COM-LETE
DEAA=LT b! I2C2#IIC SHRI<L IMMEDIATE COM-LETE
lar4e $ool 7177C"7 DRO: IMMEDIATE COM-LETE
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;103
DEAA=LT b! CI#"77C0 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! I#1"1#C7 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! IF02I0I( SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! C(2#0FC" SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F7I("(FC SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F0F(F2F( SHRI<L IMMEDIATE COM-LETE
lar4e $ool #(F7(2#( DRO: IMMEDIATE COM-LETE
lar4e $ool #CIII(#C DRO: IMMEDIATE COM-LETE
lar4e $ool ("2I#F(" DRO: IMMEDIATE COM-LETE
lar4e $ool (21C"#(7 DRO: IMMEDIATE COM-LETE
lar4e $ool 11FF001( DRO: IMMEDIATE COM-LETE
lar4e $ool (F#CF7(0 DRO: IMMEDIATE COM-LETE
DEAA=LT b! (21C"#(7 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! (F#CF7(0 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! ("2I#F(" SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! #CIII(#C SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! #CIII(#C SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! #(F7(2#( SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 7177C"7 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 11FF001( SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 1II07I1C SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 0#201"0" SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 0C#1I100 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F"11#C07 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F0F(F2F( SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 0#201"0 SHRI<L IMMEDIATE COM-LETE
lar4e $ool I2C2#IIC DRO: IMMEDIATE COM-LETE
lar4e $ool IF02I0I( DRO: IMMEDIATE COM-LETE
lar4e $ool I#1"1#C7 DRO: IMMEDIATE COM-LETE
lar4e $ool I#1"1#C7 DRO: IMMEDIATE COM-LETE
lar4e $ool CI#"77C0 DRO: IMMEDIATE COM-LETE
lar4e $ool C(2#0FC" DRO: IMMEDIATE COM-LETE
lar4e $ool F7I("(FC DRO: IMMEDIATE COM-LETE
lar4e $ool F0F(F2F( DRO: IMMEDIATE COM-LETE
lar4e $ool F"11#C07 DRO: IMMEDIATE COM-LETE
lar4e $ool 0C#1I100 DRO: IMMEDIATE COM-LETE
lar4e $ool 0#201"0" DRO: IMMEDIATE COM-LETE
lar4e $ool 1II07I1C DRO: IMMEDIATE COM-LETE
lar4e $ool 11FF001( DRO: IMMEDIATE COM-LETE
lar4e $ool 7177C"7" DRO: IMMEDIATE COM-LETE
I" roEs selec&e%'
S+L;
S+L;
:@ )edo the same thing as in the 're*ious ste'? ut this time use the -ollowing "uery/
You can use a))_B!er3('sBl
-ossi.le Answer: The same trend continues/
scri't -or that 'ur'ose/ Ahat do you oser*eC
S+L; <amm_query=.sql
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;105
S+L; selec& ,J -ARALLEL5s (F6 , co!n&5,6 fro) 5selec& ,J
$arallel5s (F6 , , fro) &abs4a s 4ro!$ b3 a6M
CO=<T5,6
9999999999
#"""""
S+L;
S+L; col!)n COM- for)a& a#(
S+L;
S+L; selec& s!bs&r5COM-O<E<T8 "8 #"6 COM-8 C=RRE<T_SIRE CS8
=SER_S-ECIAIED_SIRE =S fro) v$)e)or3_%3na)*c_co)$onen&s Ehere
C=RRE<T_SIREX="M
COM- CS =S
999999999999 9999999999 9999999999
share% $oo 77"7"170 "
lar4e $ool 7177C"7" "
Vava $ool 0#201"0 "
SDA Tar4e& #77I01C7" "
DEAA=LT b! 0#201"0 "
-DA Tar4e& #(F7(2#(" "
C roEs selec&e%'
S+L;
S+L; selec& s!bs&r5COM-O<E<T8 "8 #"6 COM-8 AI<AL_SIRE8
O-ER_T@-E8 O-ER_MODE8 s&a&!s fro) v$)e)or3_res*He_o$s or%er b3
START_TIMEM
COM- AI<AL_SIRE O-ER_T@-E O-ER_MODE STAT=S
999999999999 9999999999 999999999 999999999 999999999
share% $oo CI#"77C0 STATIC COM-LETE
share% $oo I#1"1#C7 DRO: IMMEDIATE COM-LETE
share% $oo IF02I0I( DRO: IMMEDIATE COM-LETE
lar4e $ool 0#201"0 DRO: IMMEDIATE COM-LETE
lar4e $ool 0#201"0 STATIC COM-LETE
Vava $ool 0#201"0 STATIC COM-LETE
s&rea)s $o " STATIC COM-LETE
SDA Tar4e& #77I01C7" STATIC COM-LETE
ASM >!ffer " STATIC COM-LETE
DEAA=LT b! #"07FIC"" STATIC IMMEDIATE COM-LETE
DEAA=LT b! #"07FIC"" STATIC COM-LETE
DEAA=LT b! #""CC1(2C STATIC IMMEDIATE COM-LETE
DEAA=LT b! 2C0C722( STATIC IMMEDIATE COM-LETE
DEAA=LT b! 2C0C722( I<ITIALIR IMMEDIATE COM-LETE
I<D
DEAA=LT (L " STATIC COM-LETE
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;106
DEAA=LT 0L " STATIC COM-LETE
DEAA=LT 7L " STATIC COM-LETE
DEAA=LT #C " STATIC COM-LETE
DEAA=LT 1( " STATIC COM-LETE
LEE- b!ffe " STATIC COM-LETE
REC@CLE b! " STATIC COM-LETE
-DA Tar4e& #(F7(2#(" STATIC COM-LETE
DEAA=LT b! 2((I0C77 SHRI<L IMMEDIATE COM-LETE
share% $oo I2C2#IIC DRO: IMMEDIATE COM-LETE
DEAA=LT b! 77"7"170 SHRI<L IMMEDIATE COM-LETE
share% $oo 7177C"7" DRO: IMMEDIATE COM-LETE
DEAA=LT b! 7177C"7" SHRI<L DEAERRED COM-LETE
share% $oo 77"7"170 DRO: DEAERRED COM-LETE
DEAA=LT b! I2C2#IIC SHRI<L IMMEDIATE COM-LETE
lar4e $ool 7177C"7 DRO: IMMEDIATE COM-LETE
DEAA=LT b! CI#"77C0 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! I#1"1#C7 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! IF02I0I( SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! C(2#0FC" SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F7I("(FC SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F0F(F2F( SHRI<L IMMEDIATE COM-LETE
lar4e $ool #(F7(2#( DRO: IMMEDIATE COM-LETE
lar4e $ool #CIII(#C DRO: IMMEDIATE COM-LETE
lar4e $ool ("2I#F(" DRO: IMMEDIATE COM-LETE
lar4e $ool (21C"#(7 DRO: IMMEDIATE COM-LETE
lar4e $ool 11FF001( DRO: IMMEDIATE COM-LETE
lar4e $ool (F#CF7(0 DRO: IMMEDIATE COM-LETE
DEAA=LT b! (21C"#(7 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! (F#CF7(0 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! ("2I#F(" SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! #CIII(#C SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! #CIII(#C SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! #(F7(2#( SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 7177C"7 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 11FF001( SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 1II07I1C SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 0#201"0" SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 0C#1I100 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F"11#C07 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F0F(F2F( SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 0#201"0 SHRI<L IMMEDIATE COM-LETE
lar4e $ool I2C2#IIC DRO: IMMEDIATE COM-LETE
lar4e $ool IF02I0I( DRO: IMMEDIATE COM-LETE
lar4e $ool I#1"1#C7 DRO: IMMEDIATE COM-LETE
lar4e $ool I#1"1#C7 DRO: IMMEDIATE COM-LETE
lar4e $ool CI#"77C0 DRO: IMMEDIATE COM-LETE
lar4e $ool C(2#0FC" DRO: IMMEDIATE COM-LETE
lar4e $ool F7I("(FC DRO: IMMEDIATE COM-LETE
lar4e $ool F0F(F2F( DRO: IMMEDIATE COM-LETE
lar4e $ool F"11#C07 DRO: IMMEDIATE COM-LETE
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;12"
lar4e $ool 0C#1I100 DRO: IMMEDIATE COM-LETE
lar4e $ool 0#201"0" DRO: IMMEDIATE COM-LETE
lar4e $ool 1II07I1C DRO: IMMEDIATE COM-LETE
lar4e $ool 11FF001( DRO: IMMEDIATE COM-LETE
lar4e $ool 7177C"7" DRO: IMMEDIATE COM-LETE
I" roEs selec&e%'
S+L;
.<@ $till connected as the AMM user -rom your $>%EPlus session? eDecute the -ollowing
command and? immediately a-terward? determine the memory com'onent sizes and
the list o- resize o'erations/ You can use ammGB!er31'sBl -or that 'ur'ose/ Ahat
do you oser*eC
-ossi.le Answer: The same style o- growing and shrinking o- the memory
com'onents/
S+L; <amm_query?.sql
S+L; eGec &es&$4a5F"""""6M
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L;
S+L; col!)n COM- for)a& a#(
S+L;
S+L; selec& s!bs&r5COM-O<E<T8 "8 #"6 COM-8 C=RRE<T_SIRE CS8
=SER_S-ECIAIED_SIRE =S fro) v$)e)or3_%3na)*c_co)$onen&s Ehere
C=RRE<T_SIREX="M
COM- CS =S
999999999999 9999999999 9999999999
share% $oo 77"7"170 "
lar4e $ool 7177C"7" "
Vava $ool 0#201"0 "
SDA Tar4e& #77I01C7" "
DEAA=LT b! 0#201"0 "
-DA Tar4e& #(F7(2#(" "
C roEs selec&e%'
S+L;
S+L; selec& s!bs&r5COM-O<E<T8 "8 #"6 COM-8 AI<AL_SIRE8
O-ER_T@-E8 O-ER_MODE8 s&a&!s fro) v$)e)or3_res*He_o$s or%er b3
START_TIMEM
COM- AI<AL_SIRE O-ER_T@-E O-ER_MODE STAT=S
999999999999 9999999999 999999999 999999999 999999999
DEAA=LT b! 2C0C722( I<ITIALIR IMMEDIATE COM-LETE
I<D
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;121
REC@CLE b! " STATIC COM-LETE
LEE- b!ffe " STATIC COM-LETE
DEAA=LT 1( " STATIC COM-LETE
share% $oo IF02I0I( DRO: IMMEDIATE COM-LETE
share% $oo I#1"1#C7 DRO: IMMEDIATE COM-LETE
share% $oo CI#"77C0 STATIC COM-LETE
lar4e $ool 0#201"0 STATIC COM-LETE
lar4e $ool 0#201"0 DRO: IMMEDIATE COM-LETE
Vava $ool 0#201"0 STATIC COM-LETE
s&rea)s $o " STATIC COM-LETE
SDA Tar4e& #77I01C7" STATIC COM-LETE
-DA Tar4e& #(F7(2#(" STATIC COM-LETE
DEAA=LT b! 2C0C722( STATIC IMMEDIATE COM-LETE
DEAA=LT b! #""CC1(2C STATIC IMMEDIATE COM-LETE
ASM >!ffer " STATIC COM-LETE
DEAA=LT b! #"07FIC"" STATIC COM-LETE
DEAA=LT b! #"07FIC"" STATIC IMMEDIATE COM-LETE
DEAA=LT (L " STATIC COM-LETE
DEAA=LT 0L " STATIC COM-LETE
DEAA=LT 7L " STATIC COM-LETE
DEAA=LT #C " STATIC COM-LETE
DEAA=LT b! 2((I0C77 SHRI<L IMMEDIATE COM-LETE
share% $oo I2C2#IIC DRO: IMMEDIATE COM-LETE
DEAA=LT b! 77"7"170 SHRI<L IMMEDIATE COM-LETE
share% $oo 7177C"7" DRO: IMMEDIATE COM-LETE
share% $oo 77"7"170 DRO: DEAERRED COM-LETE
DEAA=LT b! 7177C"7" SHRI<L DEAERRED COM-LETE
DEAA=LT b! I2C2#IIC SHRI<L IMMEDIATE COM-LETE
lar4e $ool 7177C"7 DRO: IMMEDIATE COM-LETE
DEAA=LT b! IF02I0I( SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! I#1"1#C7 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! CI#"77C0 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! C(2#0FC" SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F7I("(FC SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F0F(F2F( SHRI<L IMMEDIATE COM-LETE
lar4e $ool #(F7(2#( DRO: IMMEDIATE COM-LETE
lar4e $ool #CIII(#C DRO: IMMEDIATE COM-LETE
lar4e $ool ("2I#F(" DRO: IMMEDIATE COM-LETE
lar4e $ool (F#CF7(0 DRO: IMMEDIATE COM-LETE
lar4e $ool (21C"#(7 DRO: IMMEDIATE COM-LETE
lar4e $ool 11FF001( DRO: IMMEDIATE COM-LETE
DEAA=LT b! 1II07I1C SHRI<L IMMEDIATE COM-LETE
lar4e $ool IF02I0I( DRO: IMMEDIATE COM-LETE
DEAA=LT b! 0C#1I100 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F"11#C07 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! F0F(F2F( SHRI<L IMMEDIATE COM-LETE
lar4e $ool 7177C"7" DRO: IMMEDIATE COM-LETE
lar4e $ool I2C2#IIC DRO: IMMEDIATE COM-LETE
DEAA=LT b! 0#201"0 SHRI<L IMMEDIATE COM-LETE
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;12!
DEAA=LT b! 7177C"7 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! #(F7(2#( SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! #CIII(#C SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! #CIII(#C SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! ("2I#F(" SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! (F#CF7(0 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! (21C"#(7 SHRI<L IMMEDIATE COM-LETE
DEAA=LT b! 11FF001( SHRI<L IMMEDIATE COM-LETE
lar4e $ool 11FF001( DRO: IMMEDIATE COM-LETE
lar4e $ool 1II07I1C DRO: IMMEDIATE COM-LETE
lar4e $ool 0#201"0" DRO: IMMEDIATE COM-LETE
lar4e $ool 0C#1I100 DRO: IMMEDIATE COM-LETE
lar4e $ool F"11#C07 DRO: IMMEDIATE COM-LETE
lar4e $ool F0F(F2F( DRO: IMMEDIATE COM-LETE
lar4e $ool F7I("(FC DRO: IMMEDIATE COM-LETE
lar4e $ool C(2#0FC" DRO: IMMEDIATE COM-LETE
lar4e $ool CI#"77C0 DRO: IMMEDIATE COM-LETE
lar4e $ool I#1"1#C7 DRO: IMMEDIATE COM-LETE
lar4e $ool I#1"1#C7 DRO: IMMEDIATE COM-LETE
DEAA=LT b! 0#201"0" SHRI<L IMMEDIATE COM-LETE
I" roEs selec&e%'
S+L; exit
$
..@ From a terminal window? restart 6nter'rise Manager !ataase Control/
$ emctl start dbconsole
Oracle En&er$r*se Mana4er ##4 Da&abase Con&rol Release
##'('"'#'"
Co$3r*4h& 5c6 #22C8 (""2 Oracle Cor$ora&*on' All r*4h&s
reserve%'
h&&$s.e%rsr1I$#'!s'oracle'co).##F7e)consoleabo!&A$$l*ca&*
on
S&ar&*n4 Oracle En&er$r*se Mana4er ##4 Da&abase Con&rol
'''''''''''''' s&ar&e%'
99999999999999999999999999999999999999999999999999999999999999
9999
Lo4s are 4enera&e% *n %*rec&or3
!"#a$$oracle$ro%!c&##'('"%bho)e_#e%rsr1I$#'!s'oracle'co
)_orcls3s)anlo4
$
.1@ (n 6nter'rise Manager look at the memory *ariations that ha''ened during this la/
Ahat do you oser*eC
a@ %ogged into 6nter'rise Manager as the $Y$!BA? click the $er*er ta/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;12+
.9@ 7n the $er*er taed 'age? click Memory Ad*isors in the !ataase Con-iguration
section/
.0@ 7n the Memory Ad*isors 'age? look at the -irst two gra'hics/
.3@ You should see modi-ications o- the memory com'onents in the second gra'h? that
the large 'ool grew and shrank/
.4@ %ogout and eDit -rom 6nter'rise Manager/
.;@ To clean u' your en*ironment? shut down your dataase instance? restore the original
S-AILE? turn on archi*ing and restart your orcl
$ cd ~/labs
dataase instance/ To do all that?
eDecute the a))_clean!$'sh scri't/
$ ./amm_cleanup.sh
Oracle En&er$r*se Mana4er ##4 Da&abase Con&rol Release
##'('"'#'"
Co$3r*4h& 5c6 #22C8 (""2 Oracle Cor$ora&*on' All r*4h&s
reserve%'
h&&$s.e%rsr1I$#'!s'oracle'co).##F7e)consoleabo!&A$$l*ca&*
on
S&o$$*n4 Oracle En&er$r*se Mana4er ##4 Da&abase Con&rol '''
''' S&o$$e%'
S+L,-l!s. Release ##'('"'#'" -ro%!c&*on on Th! Se$ 1 #2.(#.01
(""2
Co$3r*4h& 5c6 #27(8 (""28 Oracle' All r*4h&s reserve%'
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;12.
Connec&e% &o.
Oracle Da&abase ##4 En&er$r*se E%*&*on Release ##'('"'#'" 9
-ro%!c&*on
:*&h &he -ar&*&*on*n48 A!&o)a&*c S&ora4e Mana4e)en&8 OLA-8
Da&a M*n*n4
an% Real A$$l*ca&*on Tes&*n4 o$&*ons
S+L; S+L;
=ser %ro$$e%'
S+L;
Tables$ace %ro$$e%'
S+L;
Tables$ace %ro$$e%'
S+L; S+L; Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
S+L;
A*le crea&e%'
S+L; S+L; ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 07#(F2F(" b3&es
A*Ge% S*He #11I1F( b3&es
?ar*able S*He 1I1(2F"2C b3&es
Da&abase >!ffers #""CC1(2C b3&es
Re%o >!ffers F2C1IIC b3&es
Da&abase )o!n&e%'
S+L;
Da&abase al&ere%'
S+L;
Da&abase al&ere%'
S+L; D*sconnec&e% fro) Oracle Da&abase ##4 En&er$r*se E%*&*on
Release ##'('"'#'" 9 -ro%!c&*on
:*&h &he -ar&*&*on*n48 A!&o)a&*c S&ora4e Mana4e)en&8 OLA-8
Da&a M*n*n4
an% Real A$$l*ca&*on Tes&*n4 o$&*ons
Oracle En&er$r*se Mana4er ##4 Da&abase Con&rol Release
##'('"'#'"
Co$3r*4h& 5c6 #22C8 (""2 Oracle Cor$ora&*on' All r*4h&s
reserve%'
h&&$s.e%rsr1I$#'!s'oracle'co).##F7e)consoleabo!&A$$l*ca&*
on
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1*-1: :sing Auto2atic Me2or) Manage2ent
$continued%
Oracle Database 11g: Administration Workshop II A;120
S&ar&*n4 Oracle En&er$r*se Mana4er ##4 Da&abase Con&rol
''''''''''''''' s&ar&e%'
99999999999999999999999999999999999999999999999999999999999999
9999
Lo4s are 4enera&e% *n %*rec&or3
!"#a$$oracle$ro%!c&##'('"%bho)e_#e%rsr1I$#'!s'oracle'co
)_orcls3s)anlo4
$
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 122
4ractices %or :esson 1.
Practice 1.-1: Monitoring 0ervices
(n your dataase there are se*eral running a''lications/ You want to monitor the
resources that are eing used y each a''lication/ Create a ser*ice con-iguration -or each
a''lication or a''lication -unction that uses your dataase/
(n this 'ractice? you create the -ollowing con-iguration in the orcl dataase2
!ervice Name /sage Response Time &sec'9
:arning;Critical
SER?# Client ser*ice </0? ./<
.@ =se the D>MS_SER?ICE 'ackage to create a ser*ice called SER?#/ Then make sure
that you add your ser*ice name to your &nsna)es'ora -ile/
a@ The recommended method -or adding a ser*ice name to the &nsna)es'ora -ile
is to use &et Manager/ For this eDercise? eDecute the sv#
SER?# =
Ga%%'sh scri't/
)e*iew the &nsna)es'ora -ile at $ORACLE_HOMEne&EorPa%)*n to
con-irm that the -ollowing lines are included/ $ustitute the out'ut o- the
hos&na)e command -or Khos&na)e; elow/
5DESCRI-TIO< =
5ADDRESS = 5-ROTOCOL = TC-6
5HOST = Khos&na)e;'!a'oracle'co)65-ORT = #F(#66
5CO<<ECT_DATA =
5SER?ER = DEDICATED6
5SER?ICE_<AME = SER?#'eGa)$le'co)6
6
6
$ . oraenv
ORACLE_SID = [orcl] ? orcl
$ cd /home/oracle/labs
$ ./sv/_add.sh
e%rsr1I$#'!s'oracle'co)
$
@ =se the D>MS_SER?ICE'CREATE_SER?ICE 'rocedure to create a ser*ice/
BThe command is entered on one line/@
$ sqlplus / as sysdba
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1.-1: Monitoring 0ervices $continued%
Oracle Database 11g: Administration Workshop II A;123
S+L; 'V'C
1*60_0'#D&C'.C#'("'_0'#D&C'E20'#D/2C20'#D/.example.com2F
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; exit;
1@ A-ter you ha*e created your ser*ices? try connecting to your dataase y using your
ser*ice name/ Ahat ha''ensC AhyC
Answer: You cannot connect using your ser*ice ecause although it is de-ined? it is
not started on your instance/ You can *eri-y this y looking at the SER?ICE_<AME
initialization 'arameter and y looking at the ser*ices known to the listener/
$ lsnrctl services
LS<RCTL for L*n!G. ?ers*on ##'('"'#'" 9 -ro%!c&*on on (C9/=L9
(""2 #C.(1.0C
Co$3r*4h& 5c6 #22#8 (""28 Oracle' All r*4h&s reserve%'
Connec&*n4 &o 5ADDRESS=5-ROTOCOL=&c$65HOST=65-ORT=#F(#66
Serv*ces S!))ar3'''
Serv*ce WJASMW has # *ns&ance5s6'
Ins&ance WJASMW8 s&a&!s READ@8 has # han%ler5s6 for &h*s
serv*ce'''
Han%ler5s6.
WDEDICATEDW es&abl*she%.#""27 ref!se%." s&a&e.rea%3
LOCAL SER?ER
Serv*ce Worcl'!s'oracle'co)W has # *ns&ance5s6'
Ins&ance WorclW8 s&a&!s READ@8 has # han%ler5s6 for &h*s
serv*ce'''
Han%ler5s6.
WDEDICATEDW es&abl*she%.1CFI ref!se%." s&a&e.rea%3
LOCAL SER?ER
Serv*ce WorclOD>'!s'oracle'co)W has # *ns&ance5s6'
Ins&ance WorclW8 s&a&!s READ@8 has # han%ler5s6 for &h*s
serv*ce'''
Han%ler5s6.
WD"""W es&abl*she%." ref!se%." c!rren&." )aG.#"((
s&a&e.rea%3
DIS-ATCHER K)ach*ne. e%rsr1I$#'!s'oracle'co)8 $*%.
CC#";
5ADDRESS=5-ROTOCOL=&c$65HOST=e%rsr1I$#'!s'oracle'co)65-ORT=(2C
C266
Serv*ce Wrca&'eGa)$le'co)W has # *ns&ance5s6'
Ins&ance Wrca&W8 s&a&!s READ@8 has # han%ler5s6 for &h*s
serv*ce'''
Han%ler5s6.
WDEDICATEDW es&abl*she%.1 ref!se%." s&a&e.rea%3
LOCAL SER?ER
Serv*ce Wrca&OD>'eGa)$le'co)W has # *ns&ance5s6'
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1.-1: Monitoring 0ervices $continued%
Oracle Database 11g: Administration Workshop II A;125
Ins&ance Wrca&W8 s&a&!s READ@8 has # han%ler5s6 for &h*s
serv*ce'''
Han%ler5s6.
WD"""W es&abl*she%." ref!se%." c!rren&." )aG.#"((
s&a&e.rea%3
DIS-ATCHER K)ach*ne. e%rsr1I$#'!s'oracle'co)8 $*%.
("7"2;
5ADDRESS=5-ROTOCOL=&c$65HOST=e%rsr1I$#'!s'oracle'co)65-ORT=C("
CC66
The co))an% co)$le&e% s!ccessf!ll3
$
$ sqlplus / as sysdba
S+L; show parameter service
<AME T@-E ?AL=E
99999999999999999999999999999 99999999999 9999999999999999
serv*ce_na)es s&r*n4 orcl'oracle'co)
S+L; connect system<0'#D/
En&er $assEor%. oracle_9) <<< not displayed
ERROR.
ORA9#(F#0. T<S.l*s&ener %oes no& c!rren&l3 PnoE of serv*ce
reB!es&e% *n connec& %escr*$&or
:arn*n4. @o! are no lon4er connec&e% &o ORACLE'
S+L;
9@ 5ow would you make sure that you can connect using your ser*iceC !o it and
connect to your instance y using your ser*ice/
Answer: You must start your ser*ice on your instance/
$ connect / as sysdba
Connec&e%'
S+L; show parameter service
<AME T@-E ?AL=E
99999999999999999999999999999 99999999999 9999999999999999
serv*ce_na)es s&r*n4 orcl'!s'oracle'co)
S+L; 'V'C 1*60_0'#D&C'.0"(#"_0'#D&C'E20'#D/2F
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; show parameter service
<AME T@-E ?AL=E
9999999999999999999999999 99999999999 99999999999999999999
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1.-1: Monitoring 0ervices $continued%
Oracle Database 11g: Administration Workshop II A;126
serv*ce_na)es s&r*n4 SER?#'!s'oracle'co)
S+L; host lsnrctl services
LS<RCTL for L*n!G. ?ers*on ##'('"'#'" 9 -ro%!c&*on on (C9/=L9
(""2 #C.1".1C
Co$3r*4h& 5c6 #22#8 (""28 Oracle' All r*4h&s reserve%'
Connec&*n4 &o 5ADDRESS=5-ROTOCOL=&c$65HOST=65-ORT=#F(#66
Serv*ces S!))ar3'''
Serv*ce WJASMW has # *ns&ance5s6'
Ins&ance WJASMW8 s&a&!s READ@8 has # han%ler5s6 for &h*s
serv*ce'''
Han%ler5s6.
WDEDICATEDW es&abl*she%.#"#"F ref!se%." s&a&e.rea%3
LOCAL SER?ER
Serv*ce WSER?#'eGa)$le'co)W has # *ns&ance5s6'
Ins&ance WorclW8 s&a&!s READ@8 has # han%ler5s6 for &h*s
serv*ce'''
Han%ler5s6.
WDEDICATEDW es&abl*she%." ref!se%." s&a&e.rea%3
LOCAL SER?ER
Serv*ce Worcl'!s'oracle'co)W has # *ns&ance5s6'
Ins&ance WorclW8 s&a&!s READ@8 has # han%ler5s6 for &h*s
serv*ce'''
Han%ler5s6.
WDEDICATEDW es&abl*she%." ref!se%." s&a&e.rea%3
LOCAL SER?ER
Serv*ce WorclOD>'!s'oracle'co)W has # *ns&ance5s6'
Ins&ance WorclW8 s&a&!s READ@8 has # han%ler5s6 for &h*s
serv*ce'''
Han%ler5s6.
WD"""W es&abl*she%." ref!se%." c!rren&." )aG.#"((
s&a&e.rea%3
DIS-ATCHER K)ach*ne. e%rsr1I$#'!s'oracle'co)8 $*%.
CC#";
5ADDRESS=5-ROTOCOL=&c$65HOST=e%rsr1I$#'!s'oracle'co)65-ORT=(2C
C266
Serv*ce Wrca&'eGa)$le'co)W has # *ns&ance5s6'
Ins&ance Wrca&W8 s&a&!s READ@8 has # han%ler5s6 for &h*s
serv*ce'''
Han%ler5s6.
WDEDICATEDW es&abl*she%.1 ref!se%." s&a&e.rea%3
LOCAL SER?ER
Serv*ce Wrca&OD>'eGa)$le'co)W has # *ns&ance5s6'
Ins&ance Wrca&W8 s&a&!s READ@8 has # han%ler5s6 for &h*s
serv*ce'''
Han%ler5s6.
WD"""W es&abl*she%." ref!se%." c!rren&." )aG.#"((
s&a&e.rea%3
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1.-1: Monitoring 0ervices $continued%
Oracle Database 11g: Administration Workshop II A;13"
DIS-ATCHER K)ach*ne. e%rsr1I$#'!s'oracle'co)8 $*%.
("7"2;
5ADDRESS=5-ROTOCOL=&c$65HOST=e%rsr1I$#'!s'oracle'co)65-ORT=C("
CC66
The co))an% co)$le&e% s!ccessf!ll3
S+L;
S+L; connect system<0'#D/
En&er $assEor%. oracle_9) <<< not displayed
Connec&e%'
S+L; exit
0@ 6Decute the sv#_loa%'sh scri't as S@SD>A/ This scri't creates a new S?_=SER
user/ Then you connect to your instance as this user and the SER?# ser*ice/ Create
workload acti*ity y eDecuting the sv#_loa%('sBl scri't/ (- this scri't -inishes
e-ore you com'leted the neDt ste'? then use the sv#_sel'sBl
SELECT CO=<T5,6 AROM D>A_O>/ECTS8D>A_O>/ECTS8D>A_O>/ECTS
scri't to eDecutes the
-ollowing "uery2
$ cd ~/labs
$ ./sv/_load.sh
S+L; S+L; S+L; S+L; S+L; %ro$ !ser sv_!ser casca%e
,
ERROR a& l*ne #.
ORA9"#2#7. !ser SS?_=SERS %oes no& eG*s&
S+L; S+L; ( 1
=ser crea&e%'
S+L; S+L;
Dran& s!ccee%e%'
$
Note$ !o not wait -or the scri't to com'lete e-ore 'roceeding to the neDt ste'/
$ sqlplus sv_user<0'#D/
En&er $assEor%. oracle_9) <<< not displayed
Connec&e%'
S+L; <sv/_load=.sql
S+L; DECLARE
( & n!)berM
1 >EDI<
0 for * *n #''(""" loo$
F selec& co!n&5,6 *n&o & fro) %ba_obVec&sM
C en% loo$M
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1.-1: Monitoring 0ervices $continued%
Oracle Database 11g: Administration Workshop II A;131
I E<DM
7
3@ A-ter the eDecution starts? access the 6M To' Consumers 'age -rom the Per-ormance
taed 'age? and check i- SER?# is using more resources/ Also? check the statistics
on your ser*ice with ?$SER?ICE_STATS -rom a $>%EPlus session connected as
S@SD>A/
a@ 7n the home 'age? click the Per-ormance ta/ Towards the ottom o- the
Per-ormance 'age? click the $er*ices ta/
An Acti*e $ession gra'h with the acti*ity aggregated y ser*ice name is dis'layed/
The network ser*ice name o- each connection is recorded as a se'arate ser*ice/ $o all
the connections made without a ser*ice name are aggregated? as are all the
connections made as SER?#/
@ Click the To' Consumers link in the Additional Monitoring %inks section/
)e-resh the To' Consumers 7*er*iew 'age se*eral times/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1.-1: Monitoring 0ervices $continued%
Oracle Database 11g: Administration Workshop II A;13!
The names and numer o- ser*ices listed in the To' $er*ices Gra'h de'ends on the
numer and ty'e o- connections to the dataase/
c@ You can also see the detailed statistics y na*igating to the To' $er*ices ta I
$6)V. link I $tatistics ta/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1.-1: Monitoring 0ervices $continued%
Oracle Database 11g: Administration Workshop II A;13+
4@ (- the sv#_loa%('sBl scri't -inishes e-ore you com'leted this ste'? then use the
sv#_sel'sBl
S+L; <sv/_sel.sql
scri't to continue creating a workload/ U Ahen you com'leted the
tasks? make sure that you sto' your running workload y 'ressing Ctrl F C in your
terminal window/
S+L; selec& co!n&5,6 fro) %ba_obVec&s8%ba_obVec&s8%ba_obVec&s
,
ERROR a& l*ne #.
ORA9"#"#1. !ser reB!es&e% cancel of c!rren& o$era&*on
S+L; exit
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 13.
4ractices %or :esson 10
By de-ault? Automatic $>% Tuning eDecutes automatically during each nightly
maintenance window/ For this 'ractice? you simulate the eDecution o- Automatic $>%
Tuning? and eD'lore its results
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 130
Practice 1/-1: :sing Auto2atic 0;! 1uning
(n this 'ractice? you manually launch Automatic $>% Tuning to automatically tune a
small a''lication workload/ You then in*estigate the outcomes and con-iguration
'ossiilities/
.@ (n 6M? na*igate to $er*er I Automated Maintenance Tasks Bin the 7racle $cheduler
section@/
a@ To check i- the task settings are enaled? click Con-igure? Bno matter i- the status
is 6naled or !isaled@/
@ Toggle 6naled and !isaled? then click $how $>% when the Gloal $tatus is
6naled/
c@ )e*iew the command and click )eturn/
d@ 7n the Automated Maintenance Tasks Con-iguration 'age? click A''ly/
e@ Click the Con-igure utton neDt to Automatic $>% Tuning/
-@ $elect Yes -or JAutomatic (m'lementation o- $>% Pro-ilesK and click $how $>%/
g@ )e*iew the command and click )eturn/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;132
h@ 7n the Automatic $>% Tuning $ettings 'age? click A''ly/
You should recei*e a success message/
1@ (n a terminal window connected as the oracle user? 'oint to the ORCL
$ . oraenv
instance?
re*iew and eDecute the as&_se&!$'sh scri't /This scri't creates the AST user? turns
o-- automatic maintenance tasks? and dro's any eDisting 'ro-iles on "ueries eDecuted
y the AST user/
ORACLE_SID = [orcl] ? orcl
$ cat ast_setup.sh
NXb*nbash
N Aor &ra*n*n4 onl3 9 eGec!&e as oracle OS !ser
sBl$l!s as s3s%ba KKEOAX
se& echo on
%ro$ !ser as& casca%eM
crea&e !ser as& *%en&*f*e% b3 Woracle_0=WM
4ran& %ba &o as&M
al&er s3s&e) fl!sh share%_$oolM
99
99 T!rn off A=TOTASL
99
al&er s3s&e) se& W_enable_a!&o)a&*c_)a*n&enanceW="M
99
99 Clear o!& ol% eGec!&*ons of a!&o9sBl&!ne
99
eGec
%b)s_sBl&!ne'rese&_&!n*n4_&asP5SS@S_A=TO_S+L_T=<I<D_TASLS6M
99
99 Dro$ an3 $rof*les on AST B!er*es
99
%eclare
c!rsor $rof_na)es *s
selec& na)e fro) %ba_sBl_$rof*les Ehere sBl_&eG& l*Pe
STASTTSM
be4*n
for $rof_rec *n $rof_na)es loo$
%b)s_sBl&!ne'%ro$_sBl_$rof*le5$rof_rec'na)e6M
en% loo$M
en%M

Oracle Internal & Oracle cadem! "#e Onl!


Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;133
EOAX
$
$ ./ast_setup.sh
S+L; S+L; S+L; %ro$ !ser as& casca%e
,
ERROR a& l*ne #.
ORA9"#2#7. !ser SASTS %oes no& eG*s&
S+L;
=ser crea&e%'
S+L;
Dran& s!ccee%e%'
S+L; S+L;
S3s&e) al&ere%'
S+L; S+L; S+L; S+L;
S3s&e) al&ere%'
S+L; S+L; S+L; S+L; S+L;
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; S+L; S+L; S+L; S+L; ( 1 0 F C I 7
2
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; S+L;
$
9@ (n 're'aration -or the 'ractice? you should log in as the AST user with the oracle_0=
$ sqlplus ast
'assword and eDecute a workload/ 6Decute the as&_EorPloa%_s&rea)'sBl scri't/
This scri't eDecutes? multi'le times a "uery that is not correctly o'timized/ The "uery
in "uestion uses hints that -orce the o'timizer to 'ick a suo'timal eDecution 'lan/
The scri't eDecutes -or a''roDimately 9< to 4< seconds/ B7utput has .een reduced to
minimi/e clutter.@
En&er $assEor%. oracle_9) KKK no& %*s$la3e%
S+L; <ast_wor-load_stream.sql
S!n A!4 ( (1.1#.11 DMT9I (""2
no roEs selec&e%
no roEs selec&e%
no roEs selec&e%
'
'
'
no roEs selec&e%
no roEs selec&e%
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;135
S!n A!4 ( (1.1#.FF DMT9I (""2
S+L; exit
$
0@ Automatic $>% Tuning is im'lemented using an automated task that runs during
maintenance windows/ 5owe*er? you are not going to wait -or the neDt maintenance
window to o'en/ This might take too long/ (nstead? you will -orce the o'ening o- your
neDt maintenance window now/ This will automatically trigger the Automatic $>%
Tuning task/ )e*iew and eDecute the as&_r
$ cat ast_run.sh
!n'sh scri't to do that/ The scri'tNs
eDecution takes aout ten minutes Bmost likely@/
NXb*nbash
N Aor &ra*n*n4 onl3 9 eGec!&e as oracle OS !ser
%a&e
sBl$l!s as s3s%ba KKEOAX
se& echo on
se& servero!&$!& on
eGec %b)s_EorPloa%_re$os*&or3'crea&e_sna$sho&M
var*able E*n%oE varchar(5("6M
be4*n
selec& !$$er5&o_char5s3s%a&e8Sf)%a3S66]]S_:I<DO:S *n&o
.E*n%oE fro) %!alM
en%M

$r*n& E*n%oEM
99
99 O$en &he corres$on%*n4 )a*n&enance E*n%oE8 b!& E*&h o&her
cl*en&s %*sable%
99
al&er s3s&e) se& W_enable_a!&o)a&*c_)a*n&enanceW=#

eGec %b)s_a!&o_&asP_a%)*n'%*sable5 9
Sa!&o o$&*)*Her s&a&s collec&*onS8 n!ll8 .E*n%oE6M
eGec %b)s_a!&o_&asP_a%)*n'%*sable5 9
Sa!&o s$ace a%v*sorS8 n!ll8 .E*n%oE6M
eGec %b)s_sche%!ler'o$en_E*n%oE5.E*n%oE8 n!ll8 &r!e6M
99
99 Close &he )a*n&enance E*n%oE Ehen sBl&!ne *s %one
99
eGec %b)s_locP'slee$5C"6M
%eclare
r!nn*n4 n!)berM
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;136
be4*n
loo$
selec& co!n&5,6
*n&o r!nn*n4
fro) %ba_a%v*sor_eGec!&*ons
Ehere &asP_na)e = SS@S_A=TO_S+L_T=<I<D_TASLS an%
s&a&!s = SEOEC=TI<DSM
*f 5r!nn*n4 = "6 &hen
eG*&M
en% *fM
%b)s_locP'slee$5C"6M
en% loo$M
%b)s_sche%!ler'close_E*n%oE5.E*n%oE6M
en%M

al&er s3s&e) se& W_enable_a!&o)a&*c_)a*n&enanceW="

99 Re9enable &he o&her 4!3s so &he3 looP l*Pe &he3 are enable%
*n EM'
99 S&*ll &he3 E*ll be %*sable% beca!se Ee have se& &he
!n%erscore'
99
eGec %b)s_a!&o_&asP_a%)*n'enable5 9
Sa!&o o$&*)*Her s&a&s collec&*onS8 n!ll8 .E*n%oE6M
eGec %b)s_a!&o_&asP_a%)*n'enable5 9
Sa!&o s$ace a%v*sorS8 n!ll8 .E*n%oE6M
EOAX
%a&e
$
$ ./ast_run.sh
S!n A!4 ( (1.0(.F0 DMT9I (""2
S+L; S+L; S+L; S+L;
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; S+L; S+L; ( 1 0
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L;
:I<DO:
99999999999999999999999999999999
S=<DA@_:I<DO:
S+L; S+L; S+L; S+L; S+L; (
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;15"
S3s&e) al&ere%'
S+L; ;
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; S+L; ;
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; S+L;
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; S+L; S+L; S+L; S+L;
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; S+L; ( 1 0 F C I 7 2 #" ##
#( #1 #0 #F #C #I
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; (
S3s&e) al&ere%'
S+L; S+L; S+L; S+L; S+L; S+L; ;
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; S+L; ;
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; S+L;
S!n A!4 ( (1.01.FI DMT9I (""2
$
$ome o- your out'ut? like the A(&!7A? may look di--erent/
3@ 6Decute the as&_EorPloa%_s&rea)'sh scri't again/ Ahat do you oser*eC
a@ You should see that the eDecution time -or as&_EorPloa%_s&rea)'sh is much
-aster than the original eDecution/ This is 'roaly due to the -act that Automatic
$>% Tuning im'lemented a 'ro-ile -or your statement automatically/
$ sqlplus ast
En&er $assEor%. oracle_9) KKK no& %*s$la3e%
S+L; <ast_wor-load_stream.sql
S!n A!4 ( (1.07.F0 DMT9I (""2
no roEs selec&e%
no roEs selec&e%
no roEs selec&e%
'
'
'
no roEs selec&e%
no roEs selec&e%
S!n A!4 ( (1.02.#C DMT9I (""2
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;151
S+L; exit
$
4@ %ogged in as the AST
$ sqlplus ast
user? -orce the creation o- an AA) sna'shot/
En&er $assEor%. oracle_9) KKK no& %*s$la3e%
S+L; set echo on
S+L; exec dbms_wor-load_repository.create_snapshot;
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; exit
$
;@ 5ow can you con-irm that a $>% Pro-ile was automatically im'lementedC
a@ (n 6nter'rise Manager? na*igate to $er*er I Automated Maintenance Tasks
B7racle $cheduler@ I Automatic $>% Tuning/
@ 7n the Automatic $>% Tuning summary 'age? *iew the tuning results/
The task has already run in one maintenance window and has results ready to e
*iewed/
c@ %ook at the gra'hs on the Automatic $>% Tuning )esult $ummary 'age/ BI' you
do not see any graphs( return to step !( e,ecute the work load twice( then continue
with step 0 and 1.@
d@ Focus on understanding the 'ie chart and the ar gra'h neDt to it/ You should e
ale to get a -eeling -or the general -indings reakdown? as well as the numer o-
$>% 'ro-iles im'lemented y the task/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;15!
e@ Click View )e'ort to see a detailed $>%+le*el re'ort/
-@ Find and select the $>% that ran in the AST schema/ &ote the green check mark
meaning that the 'ro-ile was im'lemented/
g@ Click the View )ecommendations utton/
h@ Click the Com'are 6D'lain Plans eyeglass icon -or the $>% Pro-ile entry/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;15+
i@ $croll down the 'age/
,@ %ook at the old and new eD'lain 'lans -or the "uery/
k@ Then click the J)ecommendations -or $>% (!K locator link Bthe last o- the
readcrums on to' o- the 'age@ to return to the 're*ious screen/
l@ (n*estigate a $>% 'ro-ile/ Ahile still on the J)ecommendations -or S+L_IDK
'age? click the $>% teDt to go to the $>% !etails 'age -or this $>%/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;15.
m@ 7n the $>% !etails + Tuning 5istory 'age note the link to
S@S_A=TO_S+L_T=<I<D_TASL that is there to show that the $>% was tuned
y this tuning task/
n@ Click the Plan Control ta/
o@ &ote that a 'ro-ile was created automatically -or this $>%/ The ty'e o- A=TO
means it was automatically created/
'@ Click the $tatistics ta to take a look at the eDecution history -or this $>%/
"@ !e'ending on the s'eed o- your machine? you may not see two hash *alues/ (-
that is the case? ignore this ste' and the -ollowing one/ $elect )eal Time2 Manual
)e-resh -rom the View !ata and then each o- 'ossile two Plan 5ash Values -rom
the corres'onding dro'+down list/ Choose one a-ter the other and wait -or the
'age to re-resh each time/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;150
r@ !e'ending on the s'eed o- your en*ironment? you should see one statement with
a relati*ely high ela'sed time 'er eDecution? and one with *ery low ela'sed time
'er eDecution/ This shows the im'ro*ed 'lan/ (- you select All -rom the Plan 5ash
Values dro'+down list? you might not e ale to see the eDecution corres'onding
to the statement a-ter tuning on the $ummary gra'h/ This might e ecause the
workload was too short to eDecute/
8@ Generate a teDt re'ort -or more in+de'th in-ormation/ From the command line?
eDecute as&_&asP_re$or&'sh scri't/ Ahat do you oser*eC
a@ &otice the -irst "ueries that -etch eDecution name and o,ect numer -rom the
ad*isor schema? -ollowed y the -inal "uery that gets the teDt re'ort/ (n the teDt
re'ort? look -or the section aout the $>% 'ro-ile -inding and 'eruse the
Validation )esults section/ This shows you the eDecution statistics oser*ed
during test+eDecute and allows you to get more o- a -eeling aout the 'ro-ileNs
"uality/ You can also use the re$or&_a!&o_&!n*n4_&asP AP( to get re'orts
that s'an multi'le eDecutions o- the task/
$ cat ast_tas-_report.sh
NXb*nbash
N Aor &ra*n*n4 onl3 9 eGec!&e as oracle OS !ser
sBl$l!s as s3s%ba KKEOAX
se& echo on
se& lon4 #"""""""""
se& lon4ch!nPs*He #"""
se& servero!&$!& on
99
99 ChecP &he eGec!&*on na)es
99
al&er sess*on se& nls_%a&e_for)a& = SMMDD@@@@ HH(0.MI.SSSM
selec& eGec!&*on_na)e8 s&a&!s8 eGec!&*on_s&ar&
fro) %ba_a%v*sor_eGec!&*ons
Ehere &asP_na)e = SS@S_A=TO_S+L_T=<I<D_TASLS
or%er b3 eGec!&*on_s&ar&M
var*able las&_eGec varchar(51"6M
be4*n
selec& )aG5eGec!&*on_na)e6 Pee$ 5%ense_ranP las& or%er b3
eGec!&*on_s&ar&6
*n&o .las&_eGec
fro) %ba_a%v*sor_eGec!&*ons
Ehere &asP_na)e = SS@S_A=TO_S+L_T=<I<D_TASLSM
en%M

$r*n& .las&_eGec
99
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;152
99 A*n% &he obVec& ID for B!er3 AST E*&h sBl_*% b32)F)F2IHh#2
99
var*able obV_*% n!)berM
be4*n
selec& obVec&_*%
*n&o .obV_*%
fro) %ba_a%v*sor_obVec&s
Ehere &asP_na)e = SS@S_A=TO_S+L_T=<I<D_TASLS an%
eGec!&*on_na)e = .las&_eGec an%
&3$e = SS+LS an%
a&&r# = Sb32)F)F2IHh#2SM
en%M

$r*n& .obV_*%
99
99 De& a &eG& re$or& &o %r*ll %oEn on &h*s one B!er3
99
se& $a4es*He "
selec& %b)s_sBl&!ne're$or&_a!&o_&!n*n4_&asP5
.las&_eGec8 .las&_eGec8 STEOTS8 ST@-ICALS8 SALLS8 .obV_*%6
fro) %!alM
EOAX
$
$ ./ast_tas-_report.sh
S+L; S+L; S+L; S+L; S+L; S+L; S+L; S+L; S+L;
Sess*on al&ere%'
S+L; S+L; ( 1 0
EOEC=TIO<_<AME STAT=S EOEC=TIO<_START
999999999999999999999999999999 99999999999 9999999999999999999
EOEC_#IC COM-LETED "7"1(""2 #7.11.02
S+L; S+L; S+L; S+L; ( 1 0 F C I
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; S+L;
LAST_EOEC
99999999999999999999999999999999
EOEC_#IC
S+L; S+L; S+L; S+L; S+L; S+L; S+L; ( 1 0 F C
I 7 2 #"
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;153
S+L; S+L;
O>/_ID
9999999999
1
S+L; S+L; S+L; S+L; S+L; S+L; ( 1 DE<ERAL I<AORMATIO<
SECTIO<
99999999999999999999999999999999999999999999999999999999999999
99999999999999999
T!n*n4 TasP <a)e .
S@S_A=TO_S+L_T=<I<D_TASL
T!n*n4 TasP OEner . S@S
:orPloa% T3$e . A!&o)a&*c H*4h9Loa%
S+L :orPloa%
Sco$e . COM-REHE<SI?E
Dlobal T*)e L*)*&5secon%s6 . 1C""
-er9S+L T*)e L*)*&5secon%s6 . #(""
Co)$le&*on S&a&!s . COM-LETED
S&ar&e% a& . "7"1(""2 #7.11.02
Co)$le&e% a& . "7"1(""2 #7.10.#1
<!)ber of Can%*%a&e S+Ls . 1
C!)!la&*ve Ela$se% T*)e of S+L 5s6 . F1
99999999999999999999999999999999999999999999999999999999999999
99999999999999999
ObVec& ID . 1
Sche)a <a)e. AST
S+L ID . b32)F)F2IHh#2
S+L TeG& . selec& ,J =SE_<L5s c6 A=LL5s6 A=LL5c6 AST ,
c'c!s&_*%8
s!)5s'B!an&*&3_sol%6 fro) sh'sales s8
sh'c!s&o)ers c Ehere
s'c!s&_*% = c'c!s&_*% an% c'c!s&_*% K ( 4ro!$ b3
c'c!s&_*%
99999999999999999999999999999999999999999999999999999999999999
99999999999999999
AI<DI<DS SECTIO< 5( f*n%*n4s6
99999999999999999999999999999999999999999999999999999999999999
99999999999999999
#9 S+L -rof*le A*n%*n4 5see eG$la*n $lans sec&*on beloE6
99999999999999999999999999999999999999999999999999999999
A $o&en&*all3 be&&er eGec!&*on $lan Eas fo!n% for &h*s
s&a&e)en&'
S+L $rof*le WS@S_S+L-ROA_"#((e""22ab1""""W Eas crea&e%
a!&o)a&*call3 for
&h*s s&a&e)en&'
Reco))en%a&*on 5es&*)a&e% benef*&. 27'0IT6
999999999999999999999999999999999999999999
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;155
9 An a!&o)a&*call39crea&e% S+L $rof*le *s $resen& on &he
s3s&e)'
<a)e. S@S_S+L-ROA_"#((e""22ab1""""
S&a&!s. E<A>LED
?al*%a&*on res!l&s
999999999999999999
The S+L $rof*le Eas &es&e% b3 eGec!&*n4 bo&h *&s $lan an%
&he or*4*nal $lan
an% )eas!r*n4 &he*r res$ec&*ve eGec!&*on s&a&*s&*cs' A $lan
)a3 have been
onl3 $ar&*all3 eGec!&e% *f &he o&her co!l% be r!n &o
co)$le&*on *n less &*)e'
Or*4*nal -lan :*&h S+L -rof*le T
I)$rove%
9999999999999 9999999999999999 99
99999999
Co)$le&*on S&a&!s. COM-LETE COM-LETE
Ela$se% T*)e5!s6. #2#"IC ("7
22'72 T
C-= T*)e5!s6. #C"IIF (""
22'7I T
=ser IO T*)e5!s6. " "
>!ffer De&s. (F0# 12
27'0C T
-h3s*cal Rea% ReB!es&s. " "
-h3s*cal :r*&e ReB!es&s. " "
-h3s*cal Rea% >3&es. " "
-h3s*cal :r*&e >3&es. " "
RoEs -rocesse%. " "
Ae&ches. " "
EGec!&*ons. # #
<o&es
99999
#' The or*4*nal $lan Eas f*rs& eGec!&e% &o Ear) &he b!ffer
cache'
(' S&a&*s&*cs for or*4*nal $lan Eere avera4e% over neG& 0
eGec!&*ons'
1' The S+L $rof*le $lan Eas f*rs& eGec!&e% &o Ear) &he
b!ffer cache'
0' S&a&*s&*cs for &he S+L $rof*le $lan Eere avera4e% over
neG& 2 eGec!&*ons'
(9 In%eG A*n%*n4 5see eG$la*n $lans sec&*on beloE6
99999999999999999999999999999999999999999999999999
The eGec!&*on $lan of &h*s s&a&e)en& can be *)$rove% b3
crea&*n4 one or )ore
*n%*ces'
Reco))en%a&*on 5es&*)a&e% benef*&. 2"'27T6
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;156
999999999999999999999999999999999999999999
9 Cons*%er r!nn*n4 &he Access A%v*sor &o *)$rove &he
$h3s*cal sche)a %es*4n
or crea&*n4 &he reco))en%e% *n%eG'
crea&e *n%eG SH'IDO$$_"""#"""# on SH'SALES5WC=ST_IDW6M
Ra&*onale
999999999
Crea&*n4 &he reco))en%e% *n%*ces s*4n*f*can&l3 *)$roves
&he eGec!&*on $lan
of &h*s s&a&e)en&' HoEever8 *& )*4h& be $referable &o r!n
WAccess A%v*sorW
!s*n4 a re$resen&a&*ve S+L EorPloa% as o$$ose% &o a s*n4le
s&a&e)en&' Th*s
E*ll alloE &o 4e& co)$rehens*ve *n%eG reco))en%a&*ons
Eh*ch &aPes *n&o
acco!n& *n%eG )a*n&enance overhea% an% a%%*&*onal s$ace
cons!)$&*on'
99999999999999999999999999999999999999999999999999999999999999
99999999999999999
EO-LAI< -LA<S SECTIO<
99999999999999999999999999999999999999999999999999999999999999
99999999999999999
#9 Or*4*nal :*&h A%V!s&e% Cos&
999999999999999999999999999999
-lan hash val!e. 0""FC#C7IC
99999999999999999999999999999999999999999999999999999999999999
999999999999999999
9999999999999999999
] I% ] O$era&*on ] <a)e ] RoEs ] >3&es ]
Cos& 5TC-=6] T*)e
] -s&ar&] -s&o$ ]
99999999999999999999999999999999999999999999999999999999999999
999999999999999999
9999999999999999999
] " ] SELECT STATEME<T ] ] # ] #1 ]
721 5#6] ""."".#
# ] ] ]
] # ] HASH DRO=- >@ ] ] # ] #1 ]
721 5#6] ""."".#
# ] ] ]
] ( ] <ESTED LOO-S ] ] # ] #1 ]
72( 5#6] ""."".#
# ] ] ]
], 1 ] TA>LE ACCESS A=LL ] C=STOMERS ] # ] F ]
0"F 5#6] "".""."
F ] ] ]
] 0 ] -ARTITIO< RA<DE ALL] ] # ] 7 ]
077 5(6] "".""."
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;16"
C ] # ] (7 ]
], F ] TA>LE ACCESS A=LL ] SALES ] # ] 7 ]
077 5(6] "".""."
C ] # ] (7 ]
99999999999999999999999999999999999999999999999999999999999999
999999999999999999
9999999999999999999
-re%*ca&e Infor)a&*on 5*%en&*f*e% b3 o$era&*on *%6.
999999999999999999999999999999999999999999999999999
1 9 f*l&er5WCW'WC=ST_IDWK(6
F 9 f*l&er5WSW'WC=ST_IDWK( A<D WSW'WC=ST_IDW=WCW'WC=ST_IDW6
(9 =s*n4 S+L -rof*le
99999999999999999999
-lan hash val!e. 1"I"I77((I
99999999999999999999999999999999999999999999999999999999999999
999999999999999999
999999999999999999999999999999999999999
] I% ] O$era&*on ] <a)e
] RoEs ] >3&es ]
Cos& 5TC-=6] T*)e ] -s&ar&] -s&o$ ]
99999999999999999999999999999999999999999999999999999999999999
999999999999999999
999999999999999999999999999999999999999
] " ] SELECT STATEME<T ]
] # ] #1 ]
FF 5(6] "".""."# ] ] ]
] # ] HASH DRO=- >@ ]
] # ] #1 ]
FF 5(6] "".""."# ] ] ]
] ( ] <ESTED LOO-S ]
] # ] #1 ]
F0 5"6] "".""."# ] ] ]
] 1 ] -ARTITIO< RA<DE ALL ]
] # ] 7 ]
F0 5"6] "".""."# ] # ] (7 ]
] 0 ] TA>LE ACCESS >@ LOCAL I<DEO RO:ID] SALES
] # ] 7 ]
F0 5"6] "".""."# ] # ] (7 ]
] F ] >ITMA- CO<?ERSIO< TO RO:IDS ]
] ] ]
] ] ] ]
], C ] >ITMA- I<DEO RA<DE SCA< ] SALES_C=ST_>IO
] ] ]
] ] # ] (7 ]
], I ] I<DEO =<I+=E SCA< ] C=STOMERS_-L
] # ] F ]
" 5"6] "".""."# ] ] ]
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;161
99999999999999999999999999999999999999999999999999999999999999
999999999999999999
999999999999999999999999999999999999999
-re%*ca&e Infor)a&*on 5*%en&*f*e% b3 o$era&*on *%6.
999999999999999999999999999999999999999999999999999
C 9 access5WSW'WC=ST_IDWK(6
f*l&er5WSW'WC=ST_IDWK(6
I 9 access5WSW'WC=ST_IDW=WCW'WC=ST_IDW6
f*l&er5WCW'WC=ST_IDWK(6
19 =s*n4 <eE In%*ces
99999999999999999999
-lan hash val!e. #7I#I2CF10
99999999999999999999999999999999999999999999999999999999999999
999999999999999999
999999999999999999999999999999999999999
] I% ] O$era&*on ] <a)e
] RoEs ] >3&es ]
Cos& 5TC-=6] T*)e ] -s&ar&] -s&o$ ]
99999999999999999999999999999999999999999999999999999999999999
999999999999999999
999999999999999999999999999999999999999
] " ] SELECT STATEME<T ]
] # ] #1 ]
F 5"6] "".""."# ] ] ]
] # ] SORT DRO=- >@ <OSORT ]
] # ] #1 ]
F 5"6] "".""."# ] ] ]
] ( ] <ESTED LOO-S ]
] ] ]
] ] ] ]
] 1 ] <ESTED LOO-S ]
] # ] #1 ]
F 5"6] "".""."# ] ] ]
], 0 ] I<DEO RA<DE SCA< ] C=STOMERS_-L
] # ] F ]
( 5"6] "".""."# ] ] ]
], F ] I<DEO RA<DE SCA< ] IDO$$_"""#"""#
] # ] ]
( 5"6] "".""."# ] ] ]
] C ] TA>LE ACCESS >@ DLO>AL I<DEO RO:ID] SALES
] # ] 7 ]
1 5"6] "".""."# ] RO:ID ] RO:ID ]
99999999999999999999999999999999999999999999999999999999999999
999999999999999999
999999999999999999999999999999999999999
-re%*ca&e Infor)a&*on 5*%en&*f*e% b3 o$era&*on *%6.
999999999999999999999999999999999999999999999999999
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;16!
0 9 access5WCW'WC=ST_IDWK(6
F 9 access5WSW'WC=ST_IDW=WCW'WC=ST_IDW6
f*l&er5WSW'WC=ST_IDWK(6
99999999999999999999999999999999999999999999999999999999999999
99999999999999999
S+L; S+L;
$
:@ (n*estigate how to con-igure Automatic $>% Tuning with 6nter'rise Manager/
a@ %ogged into 6nter'rise Manager as the S@S
user? na*igate to $er*er I Automated
Maintenance Tasks/
@ The chart here shows times in the 'ast when each client was eDecuted? and times
in the -uture when they are scheduled to run again/
c@ Modi-y the gra'hNs egin and end 'oints with the widgets in the u''er right/
d@ Click the Con-igure utton/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;16+
7n the Automated Maintenance Tasks Con-iguration 'age? you can disale indi*idual
clients and change which windows they run in/
e@ !isale the Automatic $>% Tuning client entirely and click $how $>%/
-@ )e*iew the commands and then click )eturn/
g@ 7n the Automated Maintenance Tasks Con-iguration 'age? click A''ly/ You
should recei*e a success message/
h@ Click the Automated Maintenance Tasks locator link/
i@ &otice the -oridden sign right neDt to the task name/
,@ Click Con-igure/
k@ 6nale the task again/
l@ 7'tionally? click $how $>l? re*iew the commands and then click )eturn/
m@ Then click A''ly to enale Automatic $>% Tuning/ You should recei*e a success
message/
n@ &a*igate to the Automatic $>% Tuning 'age/ (- you are on the Automated
Maintenance Tasks Con-iguration 'age? click the Con-igure utton -or Automatic
$>% Tuning/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 1/-1: :sing Auto2atic 0;! 1uning $continued%
Oracle Database 11g: Administration Workshop II A;16.
o@ 7n the Automatic $>% Tuning $ettings 'age? select &o in -ront o- the JAutomatic
(m'lementation o- $>% Pro-ilesK -ield? and click $how $>%/
'@ )e*iew the command? click )eturn? and then click A''ly/ You should recei*e a
success message/
.<@ 7PT(7&A%2 You can in*estigate how to con-igure Automatic $>% Tuning using
P%L$>% looking at the -ollowing scri't2 as&_)an!al_conf*4'sh and scri't/
Note$ (n your case? the task eDecutes "uickly ecause the workload to take into
account is really small/ 5owe*er? you could use the as&_
*n&err!$&_&asP'sh
scri't -rom another session to sto' the task? should it last too long/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 160
4ractices %or :esson 12
You recei*ed com'laints that certain atch ,os are using too many system resources and
that a s'eci-ic user is known to start data warehouse 'rocesses during regular usiness
hours/ You decide to use the !ataase )esource Manager -or etter system+resource
utilization and control/
Your -irst e--ort to alance the situation includes creating an A--=SER consumer grou'
and assigning it to the de-ault DEAA=LT_-LA< resource 'lan/ You then ma' a cou'le o-
7racle users and your ma,or 7$ user to resource grou's/ Acti*ate the resource 'lan and
test your assignments/ )egularly click $how $>% to re*iew all statements that are new to
you/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A ; 162
Practice 14-1: Managing Resources
(n this 'ractice? you create an A--=SER consumer grou' and assign it to the de-ault
DEAA=LT_-LA< resource 'lan/ Then you ma' a cou'le o- 7racle users and your ma,or
7$ user to resource grou's/ Acti*ate the resource 'lan and test your assignments/
%og in as the S@S user Bwith oracle_0= 'assword? connect as S@SD>A@ and 'er-orm
the necessary tasks through 6nter'rise Manager !ataase Control or through $>%EPlus/
All scri'ts -or this 'ractice are in the ho)eoraclelabs directory/
Ahene*er you o'en a new terminal window? eDecute the oraenv scri't to set
en*ironment *ariales -or the orcl dataase/
.@ =sing 6nter'rise Manager !ataase Control? create a resource grou' called
A--=SER/ At this 'oint? do not add users to the grou'/
a@ (n 6nter'rise Manager? select $er*er I Consumer Grou's Bin the )esource
Manager section@/
@ 7n the Consumer Grou's 'age? click the Create utton/
c@ 6nter A--=SER as Consumer Grou' and ensure that the $cheduling Policy is set
to )ound )oin/
Question : Ahat does the RO=<D9RO>I< 'arameter *alue meanC
-ossi.le Answer: RO=<D9RO>I< indicates that CP= resources are -airly allocated to
the A--=SER consumer grou'? according to the acti*e resource 'lan directi*es/
d@ 7'tionally? click $how $>%? re*iew the statements? and then click )eturn
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;163
The ind *ariales are not dis'layed -or security reasons/
e@ 7n the Create )esource Consumer Grou' 'age? click 7# to create the consumer
grou'/
-@ A con-irmation message a''ears and the new consumer grou' is dis'layed/ A-ter
con-irming its creation? click the J!ataase (nstance2orcl/us/oracle/comK link/
1@ Add the A--=SER and LO:_DRO=- consumer grou's to the DEAA=LT_-LA<
resource 'lan/ Change the le*el 9 CP= resource allocation 'ercentages2 4<V -or the
A--=SER consumer grou' and 0<V -or the LO:_DRO=- consumer grou'/
a@ (n 6nter'rise Manager? select $er*er I Plans/
@ 7n the )esource Plans 'age? select DEAA=LT_-LA< and click the 6dit utton/
c@ Click Modi-y/
d@ 7n the $elect Grou'sL$u'lans 'age? mo*e A--=SER and LO:_DRO=- to the
J)esource Allocations/K
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;165
e@ Click 7#/
-@ 6nter C" -or A--=SER %e*el 9 and 0" -or LO:_DRO=- %e*el 9/
g@ Click $how $>%/
1'C$(#'
s$f*le?al!e D(#CT(#=5#"""6M
sco$e?al!e D(#CT(#=5#"6 .= SMEMOR@SM
$lan<a)e D(#CT(#=5#""6 .=?M
*';&!
%b)s_reso!rce_)ana4er'clear_$en%*n4_area56M
%b)s_reso!rce_)ana4er'crea&e_$en%*n4_area56M
%b)s_reso!rce_)ana4er'crea&e_$lan_%*rec&*ve5
plan =; ?8
4ro!$_or_s!b$lan =; ?8
comment =; ?8
)4)&_$# =; ?8 )4)&_$( =; ?8 )4)&_$1 =; ?8 )4)&_$0 =; ?8
)4)&_$F =; ?8 )4)&_$C =; ?8 )4)&_$I =; ?8 )4)&_$7 =; ? 8
$arallel_%e4ree_l*)*&_$# =; ? 8
sE*&ch_*o_reBs =; ? 8
sE*&ch_*o_)e4ab3&es =; ?
8
ac&*ve_sess_$ool_$# =; ?8
B!e!e*n4_$# =; ?8
sE*&ch_4ro!$ =; ?8
sE*&ch_&*)e =; ?8
sE*&ch_es&*)a&e =; case ? when SfalseS then false when
S&r!eS then true else false end8
)aG_es&_eGec_&*)e =; ?8
!n%o_$ool =; ? 8
)aG_*%le_&*)e =; ?8
)aG_*%le_blocPer_&*)e =; ?8
sE*&ch_for_call =; case ? when SfalseS then false when
S&r!eS then true else false end
6M
%b)s_reso!rce_)ana4er'crea&e_$lan_%*rec&*ve5
plan =; ?8
4ro!$_or_s!b$lan =; ?8
comment =; ?8
)4)&_$# =; ?8 )4)&_$( =; ?8 )4)&_$1 =; ?8 )4)&_$0 =; ?8
)4)&_$F =; ?8 )4)&_$C =; ?8 )4)&_$I =; ?8 )4)&_$7 =; ? 8
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;166
$arallel_%e4ree_l*)*&_$# =; ? 8
sE*&ch_*o_reBs =; ? 8
sE*&ch_*o_)e4ab3&es =; ?
8
ac&*ve_sess_$ool_$# =; ?8
B!e!e*n4_$# =; ?8
sE*&ch_4ro!$ =; ?8
sE*&ch_&*)e =; ?8
sE*&ch_es&*)a&e =; case ? when SfalseS then false when
S&r!eS then true else false end8
)aG_es&_eGec_&*)e =; ?8
!n%o_$ool =; ? 8
)aG_*%le_&*)e =; ?8
)aG_*%le_blocPer_&*)e =; ?8
sE*&ch_for_call =; case ? when SfalseS then false when
S&r!eS then true else false end
6M
%b)s_reso!rce_)ana4er's!b)*&_$en%*n4_area56M
select value into s$f*le?al!e from v$$ara)e&er where na)e =
Ss$f*leSM
&% s$f*le?al!e &0 !" !)$$ then
'V'C)"' &66'1&("'
Sal&er s3s&e) se& reso!rce_)ana4er_$lan = S]]$lan<a)e]]S sco$e
=>OTHSM
'!1 &%M
%b)s_reso!rce_)ana4er'sE*&ch_$lan5 $lan_na)e =; ? 8 s*% =; ? 8
alloE_sche%!ler_$lan_sE*&ches =; %($0' 6M
'!1M
h@ )e*iew the code? then click )eturn/
i@ 7n the 6dit )esource Plan2 !6AF=%TGP%A& 'age? click A''ly to assign the
A--=SER and the %7AGG)7=P consumer grou's to the DEAA=LT_-LA<
resource 'lan/ BYou acti*ate this 'lan later/@
,@ You should recei*e a message? that your u'date was success-ul/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!""
9@ Con-igure Consumer Grou' Ma''ings? so that the HR 7racle user elongs to the
A--=SER consumer grou'? and the SCOTT user to the LO:_DRO=- consumer
grou'/ For the SCOTT user? con-irm that his ORACLE_=SER attriute has a higher
'riority than the CLIE<T_OS_=SER attriute/
a@ (n 6nter'rise Manager? select $er*er I Consumer Grou' Ma''ings/
@ $elect 7racle =ser and click the JAdd )ule -or $elected Ty'eK utton/
c@ 7n the Consumer Grou' Ma''ings 'age? ensure that A--=SER is selected as
J$elected Consumer Grou'/K
d@ Mo*e the HR user into the $elected 7racle =ser region? and then click 7#/
e@ You should recei*e a success message/ 7n the Consumer Grou' Ma''ings
General 'age? click $how $>%/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!"1
-@ )e*iew the statements and click )eturn/
g@ Click A''ly to assign the HR user to the A--=SER consumer grou'/
h@ $elect 7racle =ser again? and click the JAdd )ule -or $elected Ty'eK utton/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!"!
i@ $elect LO:_DRO=- -rom the $elected Consumer Grou' dro'+down list? and
mo*e SCOTT into the $elected 7racle =ser area? and then click 7#/
,@ You should recei*e a success message But do not yet a''ly your changes/@ 7n
the Consumer Grou' Ma''ings 'age? click the Priorities ta/
k@ Con-irm that J7racle =serK has a higher 'riority than JClient 7$ =ser/K
l@ Click A''ly to assign the SCOTT user to the LO:_DRO=- consumer grou'/
You should recei*e a success message/
0@ Con-igure Consumer Grou' Ma''ings so that the oracle 7$ user elongs to the
S@S_DRO=- consumer grou'/
a@ )eturn to the Consumer Grou' Ma''ings UGeneral 'age/
@ $elect Client 7$ =ser and click the JAdd )ule -or $elected Ty'eK utton/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!"+
c@ $elect S@S_DRO=- -rom the $elected Consumer Grou' dro'+down list? mo*e
oracle into the $elected Client 7$ =ser area? and click 7#/
You should recei*e a success message/
d@ 7'tionally? click $how $>%? re*iew the statements? and click )eturn/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!".
e@ Click A''ly to assign the oracle 7$ user to the S@S_DRO=- consumer grou'/
You should recei*e a success message/
3@ Assign the -M 7racle user to the -ollowing consumer grou's2 A--=SER?
LO:_DRO=-? and S@S_DRO=-/
a@ (n 6nter'rise Manager? select $er*er I =sers Bin the $ecurity section@/
@ $elect the -M user and click the 6dit utton/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!"0
c@ Click the Consumer Grou's Pri*ileges ta/ (- you see an error regarding the
'assword -or the -M user? enter oracle_0= in oth the 'assword -ields/
d@ Click the 6dit %ist utton/
e@ Mo*e the A--=SER? LO:_DRO=-? and S@S_DRO=- consumer grou's to
$elected Consumer Grou's and click 7#/
-@ Click $how $>%/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!"2
g@ )e*iew the statements and click )eturn/
h@ Click A''ly to assign the -M user to these consumer grou's/
You should recei*e a success message/
4@ Acti*ate the DEAA=LT_-LA< resource 'lan/
a@ (n 6nter'rise Manager? select $er*er I Plans/
@ 7n the )esource Plans 'age? select DEAA=LT_-LA<? select Acti*ate -rom the
Actions dro'+down list? and click Go/
c@ Click Yes to con-irm your acti*ation/
You should see a success message/
;@ Test the consumer grou' ma''ings/ $tart two $>%EPlus sessions2 the -irst with the
s3s&e)oracle_0=^orcl connect string and the second with the
sco&&oracle_0=^orcl connect string/
a@ As the oracle user in a terminal window? eDecute the oraenv scri't to set
en*ironment *ariales -or the orcl dataase/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!"3
$ . oraenv
ORACLE_SID = [orcl] ? orcl
$
Your out'ut may e di--erent de'ending on your 're*iously eDecuted tasks/
@ To start a $>%EPlus session with the s3s&e)oracle_0=^orcl connect
string and to set your $>% 'rom't to JF()$T?K enter2
$ sqlplus system<orcl
En&er $assEor%. oracle_9) <<< not displayed
S+L; 0'" 0:$,#6," 8%&#0"W8
AIRST;
c@ As the oracle user in a terminal window? eDecute the oraenv scri't to set
en*ironment *ariales -or the orcl dataase/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
$
Your out'ut may e di--erent de'ending on your 're*iously eDecuted tasks/
d@ To start a $>%EPlus session with the sco&&oracle_0=^orcl connect string
and to set your $>% 'rom't to J$6C7&!?K enter2
$ sqlplus scott<orcl
En&er $assEor%. oracle_9) <<< not displayed
S+L; 0'" 0:$,#6," 80'C!1W8
SECO<D;
e@ (n your AIRST $>%EPlus session? enter2
AIRST;<query_rsc_groups.sql
SCHEMA<AME RESO=RCE_CO<S=MER_DRO=-
999999999999999999999999999999 999999999999999999999999999999
99
D>S<M- OTHER_DRO=-S
D>S<M- OTHER_DRO=-S
D>S<M- OTHER_DRO=-S
SCOTT LO:_DRO=-
AIRST;
-@ Question: To which consumer grou' does the SCOTT user elongC
Anser: SCOTT is in the LO:_DRO=- consumer grou'/
Note$ Your out'ut -or this ste' Band the -ollowing ste's@ may not look eDactly
like the out'ut shown/ The in-ormation o- concern here is -or the s'eci-ic users
eing mentioned/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!"5
g@ (n the SECO<D terminal window? connect as the -M user with the oracle_0=
SECO<D;connect pm<orcl
'assword2
En&er $assEor%. oracle_9) <<< not displayed
Connec&e%'
SECO<D;
h@ (n your AIRST $>%EPlus session? enter JK to eDecute the 're*ious $>%
statement again/
AIRST;/
SCHEMA<AME RESO=RCE_CO<S=MER_DRO=-
999999999999999999999999999999 9999999999999999999999999999999
9
D>S<M- OTHER_DRO=-S
D>S<M- OTHER_DRO=-S
D>S<M- OTHER_DRO=-S
-M S@S_DRO=-
AIRST;
i@ Question: To which consumer grou' does the -M user elongC
Anser: -M is in the S@S_DRO=- consumer grou'/
,@ (n the SECO<D terminal window? connect as the OE user with the oracle_0=
SECO<D;connect oe<orcl
'assword22
En&er $assEor%. oracle_9) <<< not displayed
Connec&e%'
SECO<D;
k@ (n your AIRST $>%EPlus session? enter JK to eDecute the 're*ious $>%
statement again/
AIRST;/
SCHEMA<AME RESO=RCE_CO<S=MER_DRO=-
999999999999999999999999999999 9999999999999999999999999999999
D>S<M- OTHER_DRO=-S
D>S<M- OTHER_DRO=-S
D>S<M- OTHER_DRO=-S
OE OTHER_DRO=-S
AIRST; exit
l@ 6Dit oth the $>%EPlus sessions/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!"6
m@ Question: Ahen testing your OE 7racle user? you notice that OE is in the
OTHER_DRO=-S consumer grou'/ Ahy is thatC
-ossi.le Answer: The OE user is not eD'licitly assigned to another consumer
resource grou'/
8@ )e*ert to your original con-iguration y deacti*ating the DEAA=LT_-LA< resource
grou'? locking accounts? undoing all consumer grou' ma''ings? and -inally y
deleting the A--=SER resource grou'/
a@ To deacti*ate the DEAA=LT_-LA< resource 'lan in 6nter'rise Manager? select
$er*er I Plans/
@ 7n the )esource Plans 'age? select the DEAA=LT_-LA<? select !eacti*ate -rom
the Actions dro'+down list? and click Go/
c@ Click Yes to con-irm your deacti*ation/
You should recei*e a success message/
d@ To recon-igure or undo all consumer grou' ma''ings? re*iew and eDecute the
rsc_clean!$'sh
$ cat rsc_cleanup.sh
scri't -rom your working directory2
N Oracle Da&abase ##4. A%)*n*s&ra&*on :orPsho$ II
N Oracle Server Technolo4*es 9 C!rr*c!l!) Develo$)en&
N
N ,,,Tra*n*n4 $!r$oses onl3,,,
N ,,,<o& a$$ro$r*a&e for $ro%!c&*on !se,,,
N
N Th*s scr*$& s!$$or&s &he Reso!rce Mana4er $rac&*ce sess*on'
N S&ar& &h*s scr*$& connec&e% as OS !ser. oracle'
sBl$l!s W as s3s%baW KK EOA
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!1"
-ROM-T !n%o lab s&e$ F
>EDI<
%b)s_reso!rce_)ana4er_$r*vs'revoPe_sE*&ch_cons!)er_4ro!$5
revoPee_na)e =; S-MS8
cons!)er_4ro!$ =; SA--=SERS
6M
E<DM

>EDI<
%b)s_reso!rce_)ana4er_$r*vs'revoPe_sE*&ch_cons!)er_4ro!$5
revoPee_na)e =; S-MS8
cons!)er_4ro!$ =; SLO:_DRO=-S
6M
E<DM

>EDI<
%b)s_reso!rce_)ana4er_$r*vs'revoPe_sE*&ch_cons!)er_4ro!$5
revoPee_na)e =; S-MS8
cons!)er_4ro!$ =; SS@S_DRO=-S
6M
E<DM

-ROM-T !n%o lab s&e$ 0


>EDI<
%b)s_reso!rce_)ana4er'clear_$en%*n4_area56M
%b)s_reso!rce_)ana4er'crea&e_$en%*n4_area56M
%b)s_reso!rce_)ana4er'se&_cons!)er_4ro!$_)a$$*n45
%b)s_reso!rce_)ana4er'cl*en&_os_!ser8
SORACLES8
<=LL
6M
%b)s_reso!rce_)ana4er's!b)*&_$en%*n4_area56M
E<DM

-ROM-T !n%o lab s&e$ 1


>EDI<
%b)s_reso!rce_)ana4er'clear_$en%*n4_area56M
%b)s_reso!rce_)ana4er'crea&e_$en%*n4_area56M
%b)s_reso!rce_)ana4er'se&_cons!)er_4ro!$_)a$$*n45
%b)s_reso!rce_)ana4er'oracle_!ser8
SHRS8
<=LL
6M
%b)s_reso!rce_)ana4er'se&_cons!)er_4ro!$_)a$$*n45
%b)s_reso!rce_)ana4er'oracle_!ser8
SSCOTTS8
<=LL
6M
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!11
%b)s_reso!rce_)ana4er'se&_cons!)er_4ro!$_)a$$*n45
%b)s_reso!rce_)ana4er'oracle_!ser8
SS@SS8
<=LL
6M
%b)s_reso!rce_)ana4er'se&_cons!)er_4ro!$_)a$$*n45
%b)s_reso!rce_)ana4er'oracle_!ser8
SS@STEMS8
<=LL
6M
%b)s_reso!rce_)ana4er's!b)*&_$en%*n4_area56M
E<DM

-ROM-T !n%o lab s&e$ (


>EDI<
%b)s_reso!rce_)ana4er'clear_$en%*n4_area56M
%b)s_reso!rce_)ana4er'crea&e_$en%*n4_area56M
%b)s_reso!rce_)ana4er'%ele&e_$lan_%*rec&*ve5SDEAA=LT_-LA<S8
SA--=SERS6M
%b)s_reso!rce_)ana4er'%ele&e_$lan_%*rec&*ve5SDEAA=LT_-LA<S8
SLO:_DRO=-S6M
%b)s_reso!rce_)ana4er's!b)*&_$en%*n4_area56M
%b)s_reso!rce_)ana4er'sE*&ch_$lan5 $lan_na)e =; SS8 s*% =;
SorclS8 alloE_sche%!ler_$lan_sE*&ches =; AALSE 6M
E<DM

eG*&
EOA
$ ./rsc_cleanup.sh
S+L; S+L; S+L; !n%o lab s&e$ F
S+L; S+L; ( 1 0 F C I
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; ( 1 0 F C I
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; ( 1 0 F C I
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; !n%o lab s&e$ 0
S+L; S+L; ( 1 0 F C I 7 2 #" ##
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; !n%o lab s&e$ 1
S+L; S+L; ( 1 0 F C I 7 2 #" ##
#( #1 #0 #F #C #I #7 #2 (" (# (( (1 (0
(F (C
Oracle Internal & Oracle cadem! "#e Onl!
Practice 14-1: Managing Resources $continued%
Oracle Database 11g: Administration Workshop II A;!1!
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L; !n%o lab s&e$ (
S+L; S+L; ( 1 0 F C I 7 2
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
$
e@ To delete the A--=SER resource grou' in 6nter'rise Manager? select $er*er I
Consumer Grou's/
-@ 7n the Consumer Grou's 'age? select A--=SER and click the !elete utton/
g@ Con-irm your deletion y clicking Yes/
You should recei*e a success message/
h@ 6Dit 6nter'rise Manager and close all terminal windows/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A;!1+
4ractices %or :esson 13
(n these 'ractices? you eD'lore 7racle $cheduler ca'ailities/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A;!1.
Practice 15-1: Creating 0chedu(er Co2-onents
(n this 'ractice? you use 6nter'rise Manager !ataase Control to create $cheduler o,ects
in the ORCL dataase instance and automate tasks/
Ahile logged in to the dataase as the 5) user in !ataase Control? create a sim'le ,o
that runs a $>% scri't2
General2
&ame2 CREATE_LOD_TA>LE_/O>
7wner2 HR
!escri'tion2 Create the SESSIO<_HISTOR@ tale -or the neDt 'art o- this
'ractice
%ogging %e*el2 R=<S
Command Ty'e2 P%L$>%
P%L$>% Block2 >EDI< eGec!&e *))e%*a&e5Screa&e &able
sess*on_h*s&or35sna$_&*)e TIMESTAM- :ITH LOCAL TIME RO<E8
n!)_sess*ons <=M>ER6S6M E<DM
$chedule2
)e'eating2 Do no& Re$ea&
$tart2 I))e%*a&el3
7'tions2
&o s'ecial o'tions
.@ As the S@S user? grant CO<<ECT? RESO=RCE? and D>A roles to the HR user/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
$ sqlplus / as sysdba
Connec&e%'
S+L; grant connectC resourceC dba to hr;
Dran& s!ccee%e%'
1@ %og in to 6nter'rise Manager !ataase Control as the HR user with the oracle_0=
'assword/
9@ To create a ,o? na*igate to $er*er I Jos Bin the 7racle $cheduler region@/
a@ 7n the $cheduler Jos 'age? click the Create utton/
@ 7n the Create Jo + General 'age? enter and con-irm the -ollowing *alues2
&ame2 CREATE_LOD_TA>LE_/O>
$chema2 HR
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!10
6naled2 @es
!escri'tion2 Create the SESSIO<_HISTOR@ tale
%ogging %e*el2 Lo4 Vob r!ns onl3 5R=<S6
Command Ty'e2 P%L$>% Block
P%L$>% Block2
be4*n
eGec!&e *))e%*a&e
5Screa&e &able sess*on_h*s&or35
sna$_&*)e TIMESTAM- :ITH LOCAL TIME RO<E8
n!)_sess*ons <=M>ER6S6M
en%M
c@ 7n the $chedule -older ta? enter and con-irm the -ollowing *alues2
Timezone2 Your2local2time/one
)e'eating2 Do no& Re$ea&
$tart2 I))e%*a&el3
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!12
d@ Click $how $>% i- you want to *iew the $>% statement de-ining your ,o/
e@ )e*iew the statements BYour time zone might e di--erent/@ and click )eturn/
-@ Click 7# to create the ,o/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!13
g@ (- the ,o does not a''ear on the $cheduler Jos 'age? click the )e-resh utton
until it succeeds/ U Also? you may not see it JrunningK? ut already with the %ast
)un $tatus o- S=CCEEDED
0@ Create a 'rogram called LOD_SESS_CO=<T_-RDM that logs the current numer o-
dataase sessions into a tale/ =se the -ollowing code2
/
DECLARE
sess_co!n& <=M>ERM
>EDI<
SELECT CO=<T5,6 I<TO sess_co!n& AROM ?$SESSIO<M
I<SERT I<TO sess*on_h*s&or3 ?AL=ES 5s3s&*)es&a)$8
sess_co!n&6M
COMMITM
E<DM
a@ %ogged into 6nter'rise Manager as the 5) user? na*iagate to $er*er I Programs
or click the Programs in the )elated %inks section on the $cheduler Jos 'age/
@ 7n the $cheduler Programs 'age? click the Create utton/
c@ 7n the Create Program 'age? enter and con-irm the -ollowing *alues2
&ame2 LOD_SESS_CO=<T_-RDM
$chema2 HR
6naled2 Yes
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!15
Ty'e2 -LS+L_>LOCL
$ource2
DECLARE
sess_co!n& <=M>ERM
>EDI<
SELECT CO=<T5,6 I<TO sess_co!n& AROM ?$SESSIO<M
I<SERT I<TO sess*on_h*s&or3 ?AL=ES 5s3s&*)es&a)$8
sess_co!n&6M
COMMITM
E<DM
d@ Click $how $>%/
e@ )e*iew the statements? and then click )eturn/
-@ Click 7# to create the 'rogram/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!16
You should see the 'rogram on the $cheduler Programs 'age/
3@ Create a schedule named SESS_=-DATE_SCHED owned y HR that eDecutes e*ery
three seconds/ =se $>%EPlus and the D>MS_SCHED=LER'CREATE_SCHED=LE
'rocedure to create the schedule/
>EDI<
D>MS_SCHED=LER'CREATE_SCHED=LE 5
sche%!le_na)e =; SSESS_=-DATE_SCHEDS8
s&ar&_%a&e =; S@STIMESTAM-8
re$ea&_*n&erval =; SARE+=SECO<DL@MI<TER?AL=1S8
co))en&s =; SEver3 &hree secon%sS6M
E<DM

)eturn to 6nter'rise Manager !ataase Control and *eri-y that the


SESS_=-DATE_SCHED schedule was created/
<int$ You may ha*e to re-resh the 'age -or the $chedule to a''ear/
a@ (n a terminal window? enter2
$ sqlplus hr
En&er $assEor%. oracle_9) <<< not displayed
@ (n your $>%EPlus session? enter2
*';&!
1*60_0CT'1)$'#.C#'("'_0CT'1)$' E
schedule_name >W 20'00_),1("'_0CT'12C
start_date >W 070"&6'0"(6,C
repeat_interval >W 2%#':>0'C!1$7;&!"'#D($>?2C
comments >W 2'very three seconds2F;
'!1;
/
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
c@ (n 6nter'rise Manager? select $er*er I $chedules/
d@ Veri-y that the SESS_=-DATE_SCHED schedule has een created/ BYou may
ha*e to re-resh the 'age -or the $chedule to a''ear/@
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!!"
4@ =sing 6nter'rise Manager !ataase Control? create a ,o named
%7GG$6$$(7&$GJ7B that uses the %7GG$6$$GC7=&TGP)GM 'rogram and the
$6$$G=P!AT6G$C56! schedule/ Make sure that the ,o uses F=%% logging/
a@ (n 6nter'rise Manager? select $er*er I Jos? and then click the Create utton/
@ 7n the Create Jo 'age? enter and con-irm the -ollowing *alues2
&ame2 LOD_SESSIO<S_/O>
7wner2 HR
Enable%. @es
!escri'tion2 Count sessions with 5)/%7GG$6$$GC7=&TGP)GM
%ogging le*el2 Lo4 ever3&h*n4 5A=LL6
c@ Click Change Command Ty'e? and on the $elect Command 7'tion 'age? select
Program &ame? and enter HR'LOD_SESS_CO=<T_-RDM in the -ield neDt to it?
or use the %ooku' B-lashlight@ icon to select the 'rogram/
d@ Click 7#/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!!1
e@ Back on the Create Jo 'age? click the $chedule ta/
-@ Change the $chedule Ty'e to J=se Pre+!e-ined $chedule?K and select the
HR'SESS_=-DATE_SCHED schedule y using the -lashlight icon/
g@ Click $how $>%/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!!!
h@ )e*iew the statements and then click )eturn/
i@ 7n the Create Jo 'age? click 7# to create the ,o/
You should recei*e a success message and see the ,o on the $cheduler Jos 'age/
&ote that it "uicly accumulates 're*ious runs? ecause it eDecutes e*ery three
seconds/
;@ (n your $>%EPlus session? check the HR'SESSIO<_HISTOR@ tale -or rows/
a@ 6nter2
S+L; 0'$'C" J %#6 0'00&!_T&0"#7 #1'# *7 snap_time;
Your result looks di--erent ut the second *alues should e three seconds a'art2
S<A-_TIME
99999999999999999999999999999999999999999999999999999999999999
<=M_SESSIO<S
999999999999
1#9/=L9"2 "1'"I'FF'#"#(22 -M
0#
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!!+
1#9/=L9"2 "1'"I'F7'"22#20 -M
0#
Question: (- there are rows in the tale? are the time stam's three seconds a'artC
Answer: Yes? there are rows/ Yes? the time stam's are three seconds a'art/
8@ =se 6nter'rise Manager !ataase Control to alter the $6$$G=P!AT6G$C56!
schedule -rom e*ery three seconds to e*ery three minutes/ Then use $>%EPlus to
*eri-y that the rows are now eing added e*ery three minutes2 "uery the
5)/$6$$(7&G5($T7)Y tale? ordered y the $&APGT(M6 column/
a@ (n 6nter'rise Manager? select $er*er I $chedules/
@ Click the SESS_=-DATE_SCHED link/
c@ 7n the View $chedule 'age? click 6dit/
d@ Change the descri'tion to J6*ery three minutes/K
e@ Change A*ailale to $tart to (mmediately/
-@ Change the *alue in the )e'eat dro'+down list -rom By $econds to -# "inutes/
g@ 6nsure that the inter*al is 9 and then click $how $>%/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!!.
h@ )e*iew the statements? click )eturn? and then click A''ly/
You should recei*e a success message/
:@ (n your $>%EPlus session? "uery the HR'SESSIO<_HISTOR@ tale? ordered y the
S<A-_TIME column/ BAait -or three minutes a-ter you u'date the schedule/@ 6nter2
S+L; 0'$'C" J %#6 T#.0'00&!_T&0"#7 #1'# *7 snap_time;
Your result looks di--erent But the minute *alues should e three minutes a'art@2
S<A-_TIME
99999999999999999999999999999999999999999999999999999999999999999999
<=M_SESSIO<S
99999999999999
1#9/=L9"2 "1'#"'12'#7F#"1 -M
0#
1#9/=L9"2 "1'#1'17'2(I7CC -M
0#
.<@ This is #our mandator# cleanup tas76 =se 6nter'rise Manager to dro' the
LOD_SESSIO<S_/O> and CREATE_LOD_TA>LE_/O> ,os? the
LOD_SESS_CO=<T_-RDM 'rogram? and the SESS_=-DATE_SCHED schedule/
=se $>%EPlus to dro' the SESSIO<_HISTOR@ tale? and eDit -rom your session/
Note$ Make sure that you do not delete the wrong schedule/
a@ (n 6nter'rise Manager? select $er*er I Jos/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!!0
@ Aith the LOD_SESSIO<S_/O> ,o selected? click the !elete utton/
c@ $elect J!ro' the ,o and sto' any running instance?K and then click Yes/
d@ Go ack to the $cheduler Jos 'age? select CREATE_LOD_TA>LE_/O>? and
click !elete/ $elect J!ro' the ,o and sto' any running instance?K and then click
Yes/
e@ Click the !ataase (nstance readcrum at the u''er+le-t corner o- the 'age to
return to the $er*er 'age/ Then click Programs/
-@ Aith the LOD_SESS_CO=<T_-RDM 'rogram selected? click the !elete utton/
Click Yes to con-irm/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-1: Creating 0chedu(er Co2-onents $continued%
Oracle Database 11g: Administration Workshop II A;!!2
g@ Click $chedules in the )elated %inks section
h@ Aith the SESS_=-DATE_SCHED schedule selected? click the !elete utton/
"ake sure that you do not delete the wrong schedule.
i@ $elect J(- there are de'endent o,ects? it will not e dro''ed?K and then click Yes
to con-irm/
,@ (n your $>%EPlus session as the 5) user? delete the $6$$(7&G5($T7)Y tale?
and then eDit the session/ 6nter2
S+L; 1#, "(*$' session_history ,)#;';
Table %ro$$e%'
S+L; 'V&"
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A;!!3
Practice 15-2: Creating !ightweight 0chedu(er 7obs
(n this o'tional 'ractice? you create and run a lightweight scheduler ,o/ View the
metadata -or a lightweight scheduler ,o/ &a*igate to your $HOMElabs directory/
.@ Create a ,o tem'late -or the lightweight ,o/ The tem'late must e a P%L$>%
'rocedure or a P%L$>% lock/ )un the cr_&es&_lo4'sBl scri't to create the
&es&_lo4 tale/ Then run $ro4_#'sBl/ The $ro4_#'sBl scri't in the
$HOMElabs directory creates a ,o tem'late/
Note$ The ,o tem'late has a suset o- the attriutes o- a scheduler 'rogram/ Most o-
the attriutes o- a tem'late cannot e changed -or the ,o/
a@ &a*igate to the labs
$ cd ~/labs
directory/
$
@ 6Decute the cr_&es&_lo4'sBl and $ro4_#'sBl scri'ts as the s3s&e)
user/ The 'assword -or the s3s&e) user is oracle_0=
$ sqlplus system
/
En&er $assEor%. oracle_9) <<< not displayed
S+L; <cr_test_log.sql
S+L; 99 clean!$ $rev*o!s r!ns
S+L; 99 3o! E*ll see an error &he f*rs& &*)e &h*s scr*$& *s
r!n
S+L; %ro$ &able s3s&e)'&es&_lo4M
%ro$ &able s3s&e)'&es&_lo4
,
ERROR a& l*ne #.
ORA9""20(. &able or v*eE %oes no& eG*s&
S+L;
S+L; 99 crea&e a &able &o hol% &*)*n4 *nfor)a&*on
S+L;
S+L; crea&e &able s3s&e)'&es&_lo4
( 5Vob_&3$e ?ARCHAR(5#"68
1 &*)e)arP ?ARCHAR(5#"68
0 ac&_&*)e TIMESTAM- E*&h TIME RO<E6
F
Table crea&e%'
S+L; <prog_/.sql
S+L; REM Aor &ra*n*n4 onl3
S+L; se& echo on
S+L;
S+L; >EDI<
( 99 Th*s E*ll $ro%!ce an error &he f*rs&
1 99 &*)e *& *s r!n s*nce -ROD_# %oes no& eG*s&
0
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-2: Creating !ightweight 0chedu(er 7obs $continued%
Oracle Database 11g: Administration Workshop II A;!!5
F D>MS_SCHED=LER'DRO-_-RODRAM 5
C $ro4ra)_na)e =; SWS@STEMW'W-ROD_#WS6M
I E<DM
7
>EDI<
,
ERROR a& l*ne #.
ORA9(I0IC. WS@STEM'-ROD_#W %oes no& eG*s&
ORA9"CF#(. a& WS@S'D>MS_ISCHEDW8 l*ne (I
ORA9"CF#(. a& WS@S'D>MS_SCHED=LERW8 l*ne C#
ORA9"CF#(. a& l*ne F
S+L; >EDI<
( D>MS_SCHED=LER'CREATE_-RODRAM5
1 $ro4ra)_na)e=;SWS@STEMW'W-ROD_#WS
0 8$ro4ra)_ac&*on=;SDECLARE
F &*)e_noE DATEM
C >EDI<
I I<SERT I<TO &es&_lo4
?AL=ES5SSL:TSS8SSDO<ESS8S@STIMESTAM-6M
7 E<DMS
2 8 $ro4ra)_&3$e=;S-LS+L_>LOCLS
#" 8 n!)ber_of_ar4!)en&s=;"8
## co))en&s=;SInser& a &*)es&a)$ *n&o &he &es&_lo4S
#( 8enable%=;TR=E6M
#1 E<DM
#0
'
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L;
1@ Create a lightweight ,o? using the P%L$>% AP(/ The ,o will run the )3_$ro4
a@ %ogged into $>%EPlus as the system user? eDecute the )3_lE&_Vob'sBl
scri't/
tem'late daily with an inter*al o- 1? starting immediately/
Note$ 6M does not eD'ose the /O>_ST@LE setting at this time/
S+L; <my_lwt_Pob.sql
S+L; REM Aor &ra*n*n4 onl3
S+L; se& echo on
S+L; >EDI<
( 99 &he %ro$ $roce%!re E*ll 4*ve an% error &he f*rs&
&*)e
1 99 &h*s scr*$& *s r!n
0 s3s'D>MS_SCHED=LER'DRO-_/O>5S)3_lE&_VobS6M
F E<DM
C
>EDI<
,
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-2: Creating !ightweight 0chedu(er 7obs $continued%
Oracle Database 11g: Administration Workshop II A;!!6
ERROR a& l*ne #.
ORA9(I0IF. WS@STEM'M@_L:T_/O>W )!s& be a Vob
ORA9"CF#(. a& WS@S'D>MS_ISCHEDW8 l*ne (#1
ORA9"CF#(. a& WS@S'D>MS_SCHED=LERW8 l*ne CF#
ORA9"CF#(. a& l*ne 0
S+L;
S+L; DECLARE
( Vobna)e ?ARCHAR(51"6M
1 >EDI<
0 99 Crea&e &he /ob
F Vobna)e .= S)3_lE&_VobSM
C s3s'%b)s_sche%!ler'crea&e_Vob5
I Vob_na)e =; SWS@STEMW'WM@_L:T_/O>WS8
7 $ro4ra)_na)e =; SWS@STEMW'W-ROD_#WS8
2 Vob_class =; SWDEAA=LT_/O>_CLASSWS8
#" Vob_s&3le =; SLIDHT:EIDHTS8
## re$ea&_*n&erval =; SARE+=DAIL@MI<TER?AL=(S8
#( co))en&s =; SL*4h&Ee*4h& VobS8
#1 enable% =; TR=E6M
#0 E<DM
#F
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L;
9@ Check the $cheduler metadata *iews =SER_SCHED=LER_/O>S? _-RODRAMS?
D>A_/O>S/ $elect /O>_<AME? /O>_ST@LE? and -RODRAM_<AME -rom
=SER_SCHED=LER_/O>S/
S+L; C$ program_name format a/=
S+L; 0'$'C" Pob_nameC Pob_styleC program_name %#6
)0'#_0CT'1)$'#_X*0;
/O>_<AME /O>_ST@LE -RODRAM_<AME
999999999999999999999999999999 99999999999 999999999999
M@_L:T_/O> LIDHT:EIDHT -ROD_#
0@ Check the 6nter'rise Manager $cheduler Jos 'age? -ind the M@_L:T_/O>? and
*iew the attriutes/
a@ %og into 6nter'rise Manager as the S@STEM user with the oracle_0= 'assword/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-2: Creating !ightweight 0chedu(er 7obs $continued%
Oracle Database 11g: Administration Workshop II A;!+"
@ &a*igate to the $cheduler Jos 'age/ Then click the 5istory ta/
c@ View the history o- M@_L:T_/O>/
d@ Click the Jo &ame to *iew the ,o attriutes/
e@ Click 7#/
3@ 7n the $cheduler Jos? All 'age? delete the M@_L:T_/O> ,o
a@ &a*igate to the $cheduler Jos? All 'age? select the M@_L:T_/O> ,o and click
!elete/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-2: Creating !ightweight 0chedu(er 7obs $continued%
Oracle Database 11g: Administration Workshop II A;!+1
@ 7n the Con-irmation 'age? select J!ro' the ,o and any running instance/K Click
Yes/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A;!+!
Practice 15-*: Monitoring the 0chedu(er
-ac7ground$ Because your ,o tasks are regularly increasing? you decide to automate
routine tasks/ You -irst monitor eDisting scheduler elements? and then you create
scheduler com'onents and test them/
(n this 'ractice? use 6nter'rise Manager !ataase Control to de-ine and monitor the
$cheduler and automate tasks/ Click $how $>% regularly to re*iew all statements that are
new to you/
%og in as the S@S user Bwith oracle_0=
.@ %og in to 6nter'rise Manager !ataase Control as the S@S user with the
'assword? connect as S@SD>A@ or as HR user
Bwith oracle_0= 'assword? connect as <or)al@? as indicated/ Per-orm the necessary
tasks either through 6nter'rise Manager !ataase Control or through $>%EPlus/ All
scri'ts -or this 'ractice are in the ho)eoraclelabs directory/
oracle_0=
'assword? connect as S@SD>A
CO<<ECT role
? and check the -ollowing roles -or the HR user2
RESO=RCE role
D>A role
Because you are going to use the HR user to administer ,os through !ataase
Control? you need to make sure that HR is registered as a 'ossile administrator/
a@ (n 6nter'rise Manager? na*iaget to $er*er I =sers Bin the $ecurity section@/
@ 7n the =sers 'age? select the HR user and click 6dit/
c@ 7n the 6dit =ser 'age? click the )oles ta/
d@ (- the roles are not yet selected? then click the 6dit %ist utton on the right side o-
the 'age/ 7n the Modi-y )oles 'age? make sure that the D>A? CO<<ECT? and
RESO=RCE roles are selected/ Click 7#? then click A''ly/
e@ Click the $etu' link in the u''er+right region o- the 'age/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-*: Monitoring the 0chedu(er $continued%
Oracle Database 11g: Administration Workshop II A;!++
-@ 7n the 6nter'rise Manager Con-iguration 'age? click the Administrators link/
g@ 7n the Administrators 'age? click the Create utton/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-*: Monitoring the 0chedu(er $continued%
Oracle Database 11g: Administration Workshop II A;!+.
h@ 7n the Create Administrators2 Pro'erties 'age? enter HR as &ame? ensure that the
Grant $6%6CTGCATA%7GG)7%6 is selected and click )e*iew/
i@ 7n the Create Administrator 5)2 )e*iew 'age? click the Finish utton/
You should recei*e a success message
,@ Click the %ogout link at the u''er+right corner o- the 'age/
1@ %og in to 6nter'rise Manager !ataase Control as the HR user/ 7n the $er*er taed
'age? click the Jos link in the !ataase $cheduler region/ Are there any ,osC
a@ Click the %ogin utton to log in as the HR user/
@ 6nter HR as username? oracle_0=
c@ (n 6nter'rise Manager? na*igate to $er*er I Jos/
as 'assword? Connect As <or)al? and click
%ogin/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-*: Monitoring the 0chedu(er $continued%
Oracle Database 11g: Administration Workshop II A;!+0
Question: Are there any ,osC
-ossi.le Answer: There are some ,os/
9@ Click Programs in the )elated %inks section/
Question: Are there any eDisting 'rogramsC
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-*: Monitoring the 0chedu(er $continued%
Oracle Database 11g: Administration Workshop II A;!+2
Answer: There are some eDisting 'rograms/
0@ Click $chedules in the )elated %inks section/
Question: Are there any eDisting schedulesC
Answer: There are three schedules2 >SL<_MAI<TAI<_STATS_SCHED8
AILE_:ATCHER_SCHED=LE and DAIL@_-=RDE_SCHED=LE'
3@ Click Aindows in the )elated %inks section/ )e*iew the $cheduler Aindows 'age in
6nter'rise Manager/ Are there any eDisting windowsC Ahich resource 'lan is
associated with each windowC
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-*: Monitoring the 0chedu(er $continued%
Oracle Database 11g: Administration Workshop II A;!+3
Question : Are there any eDisting windowsC Are any enaledC
Answer: There are se*eral windows/ All are enaled eDce't :EEL<IDHT_:I<DO:
and :EELE<D_:I<DO:/
4@ Click the MO<DA@_:I<DO: link/ Answer the "uestions? then click 7#/
Question : At which time does this window o'enC
-ossi.le Answer: .< PM
Question 3: For how long does it stay o'enC
-ossi.le Answer: -or 0 hours
;@ Click Jo Classes in the )elated %inks section and re*iew them/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-*: Monitoring the 0chedu(er $continued%
Oracle Database 11g: Administration Workshop II A;!+5
Question : Are there any eDisting ,o classesC
-ossi.le Answer: There are many ,o classes/
Question 3: Ahich resource consumer grou' is associated with the
DEAA=LT_/O>_CLASS ,o classC
-ossi.le Answer: &one/
8@ 7n the $cheduler Jo classes 'age? click the ORA$AT_/C=RD_OS link/
Question : Ahich resource consumer grou' is associated with the ,o classC
-ossi.le Answer: ORA$AT_/C=RD_OS is associated with
ORA$A=TOTASL_=RDE<T_DRO=-/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 15-*: Monitoring the 0chedu(er $continued%
Oracle Database 11g: Administration Workshop II A;!+6
Question 3: For which task is this ,o class usedC
-ossi.le Answer: For automatic o'timizer statistics collection
:@ Click 7#? and then eDit 6nter'rise Manager/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A;!."
4ractices %or :esson 15
-ac7ground$ To 're'are -or an u'coming merger? you want to set the warning and
critical thresholds to a lower *alue than the de-ault/ 6nsure that you recei*e early
warnings to gi*e you more time to react/ Ahen you -inish your test case? dro' the
tales'ace that you used/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A;!.1
Practice 16-1: Managing 0torage
Access the orcl
.@ =sing the D>MS_SER?ER_ALERT'SET_THRESHOLD 'rocedure? reset the
dataasewide threshold *alues -or the Tales'ace $'ace =sage metric/ Connect to a
$>%EPlus session and eDecute the -ollowing 'rocedure2
dataase as the S@S user Bwith the oracle_0= 'assword? connect as
S@SD>A@ and 'er-orm the necessary tasks through 6nter'rise Manager !ataase Control
or through $>%EPlus/ All scri'ts -or this 'ractice are in the ho)eoraclelabs
directory/
$ . oraenv
ORACLE_SID = [orcl] ? orcl
$ cd ~/labs
$ sqlplus / as sysdba
S+L; exec 1*60_0'#D'#_($'#".0'"_"T#'0T$1EA
dbms_server_alert.tablespace_pct_fullCA
!)$$C!)$$C!)$$C!)$$C/C/C!)$$CA
dbms_server_alert.obPect_type_tablespaceC!)$$F;
W W W
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L;
1@ From your $>%EPlus session? check the dataasewide threshold *alues -or the
Tales'ace $'ace =sage metric using the -ollowing command2
S+L; 0'$'C" warning_valueCcritical_value
%#6 dba_thresholds
UT'#' metrics_name>2"ablespace 0pace )sage2
(!1 obPect_name &0 !)$$;
:AR<I<D_?AL=E
99999999999999999999999999999999999999999999999999999999999999999999
CRITICAL_?AL=E
99999999999999999999999999999999999999999999999999999999999999999999
7F
2I
9@ Create a new tales'ace called T>SALERT with a .1< MB -ile called
&bsaler&'%bf/ Make sure that this tales'ace is locally managed and uses
Automatic $egment $'ace Management/ !o not make it autoeDtensile? and do not
s'eci-y any thresholds -or this tales'ace/ =se 6nter'rise Manager !ataase Control
to create it/ (- this tales'ace already eDists in your dataase? dro' it -irst? including its
-iles/
a@ %ogged into 6nter'rise Manager as the S@S user? na*igate to $er*er I
Tales'aces/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!.!
@/ Click the Create utton/
c@ 6nter T>SALERT as the name? and click the Add utton in the !ata-iles region/
d@ 6nter or con-irm the -ollowing *alues? then click Continue
Name =alue
$torage Ty'e A!&o)a&*c S&ora4e Mana4e)en&
!isk Grou' DATA
Tem'late DATAAILE
Alias name &bsaler&
File $ize #(" M>
)euse 6Disting File TR=E
A=T76WT6&! AALSE
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!.+
e@ Click Continue
-@ 7n the Crate tales'ace 'age? click $how $>%/
g@ )e*iew the $>% and then click )eturn/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!..
h@ Click 7# to create the tales'ace/ You should recei*e a success message/
0@ (n 6nter'rise Manager? change the Tales'ace $'ace =sage thresholds o- the
T>SALERT tales'ace/ $et its warning le*el to 33 'ercent and its critical le*el to ;<
'ercent/
a@ 7n the Tales'aces 'age? select T>SALERT? click 6dit? and then click
Thresholds/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!.0
@ $elect $'eci-y Thresholds? and enter FF as Aarning BV@ and I" as Critical BV@
under the $'ace =sed section/ Then click $how $>%/
c@ )e*iew the statement and click )eturn/
d@ 7n the 6dit Tales'ace2 TB$A%6)T? click A''ly to modi-y the threshold *alues/
You should recei*e a success message/
3@ )eturn to your $>%EPlus session and check the new threshold *alues -or the
T>SALERT tales'ace/ (n your $>%EPlus session? enter2
S+L; select warning_valueCcritical_value
from dba_thresholds
where metrics_name>2"ablespace 0pace )sage2 and
obPect_name>2"*0($'#"2;
:AR<I<D_?AL=E
99999999999999999999999999999999999999999999999999999999999999
CRITICAL_?AL=E
99999999999999999999999999999999999999999999999999999999999999
FF
I"
4@ (n your $>%EPlus session? "uery the reason and resol!&*on columns -rom
D>A_ALERT_HISTOR@ -or the T>SALERT tales'ace/
S+L; select reasonCresolution
from dba_alert_history
where obPect_name>2"*0($'#"2;
The result should e Bi- you are re'eating this 'ractice? look at the last row@2
REASO<
RESOL=T
99999999999999999999999999999999999999999999999999999999 9999
999
Threshol% *s !$%a&e% on )e&r*cs WTables$ace S$ace =sa4eW
cleare%
S+L; exit
$
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!.2
;@ From the labs
$ cd ~/labs
directory? re*iew and eDecute the se4_a%vsr_se&!$'sh scri't
that creates and 'o'ulates new tales in the T>SALERT tales'ace/
L cat seg_advsr_setup.sh
NXb*nsh
N Aor &ra*n*n4 onl38 eGec!&e as oracle OS !ser
sBl$l!s nolo4 KKEOA
connec& as s3s%ba
al&er s3s&e) se& %*sP_as3nch_*o = AALSE sco$e = s$f*leM
sh!&%oEn *))e%*a&eM
s&ar&!$
se& echo on
crea&e &able e)$lo3ees# &ables$ace &bsaler& as selec& , fro)
hr'e)$lo3eesM
crea&e &able e)$lo3ees( &ables$ace &bsaler& as selec& , fro)
hr'e)$lo3eesM
crea&e &able e)$lo3ees1 &ables$ace &bsaler& as selec& , fro)
hr'e)$lo3eesM
crea&e &able e)$lo3ees0 &ables$ace &bsaler& as selec& , fro)
hr'e)$lo3eesM
crea&e &able e)$lo3eesF &ables$ace &bsaler& as selec& , fro)
hr'e)$lo3eesM
al&er &able e)$lo3ees# enable roE )ove)en&M
al&er &able e)$lo3ees( enable roE )ove)en&M
al&er &able e)$lo3ees1 enable roE )ove)en&M
al&er &able e)$lo3ees0 enable roE )ove)en&M
al&er &able e)$lo3eesF enable roE )ove)en&M
>EDI<
AOR * *n #''#" LOO-
*nser& *n&o e)$lo3ees# selec& , fro) e)$lo3ees#M
*nser& *n&o e)$lo3ees( selec& , fro) e)$lo3ees(M
*nser& *n&o e)$lo3ees1 selec& , fro) e)$lo3ees1M
*nser& *n&o e)$lo3ees0 selec& , fro) e)$lo3ees0M
*nser& *n&o e)$lo3eesF selec& , fro) e)$lo3eesFM
co))*&M
E<D LOO-M
E<DM

*nser& *n&o e)$lo3ees# selec& , fro) e)$lo3ees#M


*nser& *n&o e)$lo3ees( selec& , fro) e)$lo3ees(M
*nser& *n&o e)$lo3ees1 selec& , fro) e)$lo3ees1M
co))*&M
eG*&
EOA
$
$ ./seg_advsr_setup.sh
S+L; Connec&e%'
S+L;
S3s&e) al&ere%'
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!.3
S+L; Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
S+L; ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 07#(F2F(" b3&es
A*Ge% S*He #11I1(0 b3&es
?ar*able S*He 17F7I7"1C b3&es
Da&abase >!ffers 77"7"170 b3&es
Re%o >!ffers F2C1IIC b3&es
Da&abase )o!n&e%'
Da&abase o$ene%'
S+L; S+L;
Table crea&e%'
S+L;
Table crea&e%'
S+L;
Table crea&e%'
S+L;
Table crea&e%'
S+L;
Table crea&e%'
S+L; S+L;
Table al&ere%'
S+L;
Table al&ere%'
S+L;
Table al&ere%'
S+L;
Table al&ere%'
S+L;
Table al&ere%'
S+L; S+L; ( 1 0 F C I 7 2 #" ##
-LS+L $roce%!re s!ccessf!ll3 co)$le&e%'
S+L;
#"2FC7 roEs crea&e%'
S+L;
#"2FC7 roEs crea&e%'
S+L;
#"2FC7 roEs crea&e%'
S+L;
Co))*& co)$le&e'
S+L;
8@ Check the -ullness le*el o- the T>SALERT tales'ace y using !ataase Control or
$>%EPlus/ The current le*el should e around 4<V/ Aait a -ew minutes and check
that the warning le*el is reached -or the T>SALERT tales'ace/ BI' you are too 'ast
and recei4e erros( 5ust use your .rowser6s Re'resh .utton( or select your destintion
again.7
a@ %ogged into $>%EPlus as the S@S
$ sqlplus / as sysdba
user? enter2
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!.5
S+L; select sumEbytesF J/44 //=.@=M/=4
from dba_extents
where tablespace_name>2"*0($'#"2;
S=M5>@TES6,#""#(F7(2#("
999999999999999999999999
C"
S+L;
@ 6nter the -ollowing "uery/ Your results should e similar to the -ollowing2
S+L; select reason
from dba_outstanding_alerts
where obPect_name>2"*0($'#"2;
REASO<
99999999999999999999999999999999999999999999999999999999999999
Tables$ace [T>SALERT] *s [C" $ercen&] f!ll
S+L;
Note$ (- your result is2 no rows selected? wait a little longer and re'eat the "uery/
c@ (n 6nter'rise Manager on the Tales'aces 'age? see =sed BV@/
d@ &a*igate to the !ataase home 'age/ You should see the new alert in the $'ace
$ummary section/ (t might take se*eral minutes -or the alert to a''ear/
:@ (n your $>%EPlus session? eDecute the inserts elow to add more data to T>SALERT/
Aait a -ew moments and *iew the critical le*el in oth the dataase and !ataase
Control/ Veri-y that T>SALERT -ullness is around ;3V/
a@ 6Decute the -ollowing commands2
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!.6
S+L; insert into employees9 select J from employees9;
#"2FC7 roEs crea&e%'
S+L; commit;
S+L; insert into employees. select J from employees.;
#"2FC7 roEs crea&e%'
S+L; commit;
S+L;
@ Aait a -ew minutes and *iew the critical le*el in oth the dataase and !ataase
Control/ Veri-y that T>SALERT -ullness is around ;3V/ (n $>%EPlus? enter2
S+L; select sumEbytesF J/44 //=.@=M/=4
from dba_extents
where tablespace_name>2"*0($'#"2;
S=M5>@TES6,#""#(F7(2#("
999999999999999999999999
IF
c@ Check the outstanding alrets/ You may need to wait a -ew minutes/
S+L; select reasonC message_level
from dba_outstanding_alerts
where obPect_name>2"*0($'#"2;
REASO< MESSADE_LE?EL
99999999999999999999999999999999999999999999 9999999999999
Tables$ace [T>SALERT] *s [IF $ercen&] f!ll #
d@ (n 6nter'rise Manager?na*igate to $er*er I Tales'aces 'age? amd re*iew =sed
BV@/
e@ &a*igate to the !ataase home 'age/ You should see the new alert in the $'ace
$ummary region/ (t will take se*eral minutes -or the change in status to take
e--ect/ &ote the red -lag instead o- the yellow one/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!0"
.<@ (n your $>%EPlus session? eDecute the -ollowing delete statements to delete rows
-rom tales in T>SALERT/ These statements will take se*eral minutes to com'lete/
Then eDit your $>%EPlus session/
S+L; delete employees/;
(#2#1C roEs %ele&e%'
S+L; commit;
Co))*& co)$le&e'
S+L; delete employees=;
(#2#1C roEs %ele&e%'
S+L; commit;
Co))*& co)$le&e'
S+L; delete employees?;
(#2#1C roEs %ele&e%
S+L; commit;
Co))*& co)$le&e'
S+L; exit
$
..@ &ow? run the $egment Ad*isor -or the T>SALERT tales'ace in 6nter'rise Manager/
Make sure that you run the Ad*isor in Com'rehensi*e mode without time limitation/
Acce't and im'lement its recommendations/ A-ter the recommendations ha*e een
im'lemented? check whether the -ullness le*el o- T>SALERT is elow 33V/
a@ From the !ataase home 'age? select Ad*isor Central under )elated %inks and
then click $egment Ad*isor/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!01
@ 7n the $egment Ad*isor2 $co'e 'age? select Tales'aces and click &eDt/
c@ 7n the $egment Ad*isor2 7,ects 'age? click Add? select TB$A%6)T/ Click 7#
and then click $how Ad*anced 7'tions/
d@ (n the 7'tions section? click %imited and enter ?4 -or Time %imit Bmins@
e@ Then click &eDt/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!0!
-@ 7n the $egment Ad*isor2 $chedule 'age? make sure (mmediately is selected/
$elect your 'ro'er timezone and click &eDt/
g@ 7n the $egment Ad*isor2 )e*iew 'age? click $how $>%/
Crea&e &asP an% obVec&s scr*$&
DECLARE
&asPna)e varchar(5#""6M
&asP%esc varchar(5#(76M
&asP_*% n!)berM
obVec&_*% n!)berM
&*)eL*)*& varchar(5(F6M
n!)Da3sToRe&a*n varchar(5(F6M
obVec&<a)e varchar(5#""6M
obVec&T3$e varchar(5#""6M
>EDI<
&asPna)e .= SSEDME<TAD?_F"1101#SM
&asP%esc .=SDe& shr*nP a%v*ce base% on obVec& 4roE&h &ren%SM
n!)Da3sToRe&a*n .=S1"SM
%b)s_a%v*sor'crea&e_&asP5SSe4)en& A%v*sorS8?8&asPna)e8&asP%esc
8<=LL6M
%b)s_a%v*sor'crea&e_obVec&5&asPna)e8 STA>LES-ACES8 ST>SALERTS8
S S8 S S8 <=LL8 obVec&_*%6M
%b)s_a%v*sor'se&_&asP_$ara)e&er5&asPna)e8 SRECOMME<D_ALLS8
STR=ES6M
&*)eL*)*& .=S#7""SM
%b)s_a%v*sor'se&_&asP_$ara)e&er5&asPna)e8 STIME_LIMITS8
&*)eL*)*&6M
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!0+
%b)s_a%v*sor'se&_&asP_$ara)e&er5&asPna)e8 SDA@S_TO_EO-IRES8
n!)Da3sToRe&a*n6M
E<D
M
EGec!&e &asP scr*$&
DECLARE
&asPna)e varchar(5#""6M
>EDI<
&asPna)e .= SSEDME<TAD?_F"1101#SM
%b)s_a%v*sor'rese&_&asP5&asPna)e6M
%b)s_a%v*sor'eGec!&e_&asP5&asPna)e6M
E<DM
h@ )e*iew the statements and click )eturn/
i@ Back on the $egment Ad*isor2 re*iew 'age? the $umit utton/
,@ This takes you ack to the Ad*isor Central 'age/ Click the SEDME<TAD?_xxxxx
k@ 7n the $egment Ad*isor Task 'age? click the )ecommendation !etails utton /
link in the &ame column/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!0.
l@ (- needed? click your rowserNs )e-resh utton until you see recommendations -or
the T>SALERT
m@ Click )ecommendation !etails/
tales'ace/
n@ Click the $elect All link and then click the $hrink utton/
o@ 7n the $hrink $egment2 7'tions 'age? make sure that you click the JCom'act
$egments and )elease $'aceK o'tion utton/ Click $how $>%/
'@ )e*iew the statements and click )eturn/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!00
"@ 7n the $hrink $egment2 7'tions 'age? click (m'lement/
r@ 7n the $hrink $egment2 $chedule 'age? click the $umit utton/
s@ 7n the $cheduler Jos 'age? click the *Q8*+RI-$2nnn link/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!02
t@ 7n the View Jo 'age? scroll to the ottom o- the 'age/ =nder 7'eration !etail?
you should see that the ,o succeeded/ B(- itNs still running? use your rowserNs
)e-resh utton@/ Then click 7#/
.1@ Aait a -ew minutes and check that there are no longer any outstanding alerts -or the
T>SALERT tales'ace/ Then na*igate to the !ataase home 'age/ You should see
Prolem Tales'aces2 </
.9@ )etrie*e the history o- the T>SALERT Tales'ace $'ace =sage metric -or the last 10
hours/
a@ 7n the !ataase home 'age? select All Metrics in the )elated %inks region/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!03
@ 6D'and the Tales'aces Full category? and click the Tales'ace $'ace =sed BV@
link/
c@ Make sure that you select )eal Time2 Manual )e-resh -rom the View !ata dro'down
list/ Then click the T>SALERT link/
d@ This takes you to the Tales'ace $'ace =sed BV@2 Tales'ace &ame TB$A%6)T
'age/ $elect J%ast 10 hoursK -rom the View !ata dro'+down list/
e@ View entries in the Alert 5istory/
.0@ )eset the dataasewide de-ault thresholds -rom the Tales'ace $'ace =sage metric
-or
a@ 7n the Tales'ace $'ace =sed BV@2 Tales'ace &ame TB$A%6)T 'age? click
the 6dit Tales'ace link in the related %inks section/
@ This o'ens the 6dit Tales'ace2 TB$A%6)T 'age/ Click the Thresholds ta/
c@ Click =se !ataase !e-ault Thresholds o'tion in the $'ace =sed BV@ section/
Then click $how $>%/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 16-1: Managing 0torage $continued%
Oracle Database 11g: Administration Workshop II A;!05
d@ )e*iew the statement and click return/
e@ 7n the 6dit Tales'ace2 TB$A%6)T? Thresholds 'age? click the A''ly utton/
You should recei*e a success message/
.3@ Note$ This is #our mandator# cleanup step/ Because you ha*e -inished with your
test case? *iew and eDecute the se4_a%vsr_clean!$'sh scri't -rom the labs
directory to dro' your T>SALERT tales'ace/
$ cat seg_advsr_cleanup.sh
NXb*nsh
N Aor &ra*n*n4 onl38 eGec!&e as oracle OS !ser
sBl$l!s nolo4 KKEOA
connec& as s3s%ba
al&er s3s&e) se& %*sP_as3nch_*o = TR=E sco$e = s$f*leM
sh!&%oEn *))e%*a&eM
s&ar&!$
%ro$ &ables$ace &bsaler& *ncl!%*n4 con&en&s an% %a&af*lesM
eG*&
EOA
$
$ ./seg_advsr_cleanup.sh
S+L; Connec&e%'
S+L;
S3s&e) al&ere%'
S+L; Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
S+L; ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 07#(F2F(" b3&es
A*Ge% S*He #11I1(0 b3&es
?ar*able S*He 17F7I7"1C b3&es
Da&abase >!ffers 77"7"170 b3&es
Re%o >!ffers F2C1IIC b3&es
Da&abase )o!n&e%'
Da&abase o$ene%'
S+L;
Tables$ace %ro$$e%'
S+L;
$
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A;!06
4ractices %or :esson 16
Physical disks with 0 #B+sectors are now a*ailale/ Although this largely concerns only
the o'erating system? the 7racle ser*er is aware o- them and uses them automatically
when you create new dataases/
5owe*er? as a !BA you might ha*e dataases? which were created on 3.1+ytes disks/ (n
this 'ractice? you learn aout how to 'er-orm an o--line migration -rom 3.1+ytes disks
to 0 #B+sector disks/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A;!2"
Practice 18-1: Managing 0-ace for the Database
(n this 'ractice? you *iew a demonstration o- using 0 #B+sector disks/ The -ocus is on
'er-orming an o--line migration o- redo log grou's -orm 3.1+ytes to 0 #B+sector disks/
.@ Click the oracleZs Ho)e icon on your deskto'/
1@ &a*igate to the ho)eoracle%e)os0Pb_%*sPs directory/
9@ !oule+click the 0Pb_%*sPs_v*eEle&_sEf'h&)l -ile/
0@ (n the )un or !is'lay window? click !is'lay and *iew the 'resentation/
3@ =se the controls at the ottom o- the *iewlet window to start? 'ause and sto' the
'resentation? as suits your 'ersonal learning style/
4@ =ninterru'ted *iewing o- the demos takes aout ten minutes/ Ahen you ha*e -inished
*iewing the 'resentation? close your Ae rowser window/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A;!21
4ractices %or :esson !"
-ac7ground2 You are res'onsile -or an acti*e dataase that cannot e shut down/ (t is
running in ARCHI?ELOD mode/ &ow you are re"uested to du'licate this dataase? -or
testing 'ur'oses/
To setu' a working en*ironment -or your du'licated dataase? you2
N Add two disks to your !ATA disk grou'/
N 6nsure that the orcl source dataase is in ARCHI?ELOD mode with a ; GB -ast
reco*ery area/
N $et u' %b&es& as the net ser*ice name -or your 'lanned %b&es& dataase/
N =se 7racle &et Manager to con-igure the LISTE<ER with the %b&es& and
orcl dataase ser*ices/
N Clone a dataase y using )MA&/ $tart the du'lication 'rocess in 6nter'rise
Manager/
N Test access
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II A;!2!
Practice 29-1: Du-(icating a Database
(n this 'ractice? you clone a dataase and use additional utilities to setu' a working
en*ironment/ To simulate this en*ironment? assume that your acti*e dataase is orcl
Bwhich is stored in A$M@/
.@ Be-ore you start cloning your dataase? add the last two A$M disks to the !ATA disk
grou'/
a@ From a gra'hical terminal window? connected as user oracle? set u' your
en*ironment to use the FA$M instance? and eDecute asmca/
$ . oraenv
ORACLE_SID = [orcl] ? 3(06
The Oracle base for
ORACLE_HOME=!"#a$$oracle$ro%!c&##'('"4r*% *s
!"#a$$oracle
$
$ asmca
@ 7n the Con-igure A$M2 !isk Grou's su'age? select !ATA disk grou'/
c@ )ight click/
d@ $elect Add disks/
e@ 7n the Add !isks 'age? select oth 7)Cl2A$M!($#.1 and
7)C%2A$M!($#.9/
-@ Click 7#/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!2+
g@ 7n the in-ormation window that a''ears? click 7#/
h@ Back to the Con-igure A$M2 !isk Grou's su'age? click 6Dit/
i@ 7n the A$M Con-iguration Assistant window? click Yes/
1@ Check the A$M acti*ities and wait until the realance o'eration is -inished2
a@ %og in to 6nter'rise Manager as user S@S/
@ 7n the 5ome 'age? click the FA$M link in the General section/
c@ 7n the A$M 5ome 'age? click the !isk Grou's ta/
d@ You may ha*e to log in to the A$M instance i- you ha*e not 're*iously done it
and sa*ed credentials2
N 7n the Automatic $torage Management %ogin 'age? enter S@S in the
=sername -ield? oracle_0= in the Password -ield? and S@SASM in the
Connect As -ield/
N $elect $a*e as Pre-erred Credential/ Then click %ogin/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!2.
e@ 7n the !isk Grou's su 'age? click the !ATA link/
-@ 7n the !isk Grou'2 !ATA 'age? click at the Pending 7'erations -ield in the
General section/
g@ Click )e-resh and :ait until the rebalance operation is finished6
h@ Then click the dataase ta/
9@ To ensure that you are 'ointing to the orcl dataase and that this dataase is in
ARCHI?ELOD mode with a ; GB -ast reco*ery area? eDecute the
r)an_arch*velo4'sh scri't -rom a terminal window in your working directory/
$ . oraenv
ORACLE_SID = [JASM] ? orcl
The Oracle base for
ORACLE_HOME=!"#a$$oracle$ro%!c&##'('"%bho)e_# *s
!"#a$$oracle
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!20
$ ./rman_archivelog.sh
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Aor %e)o $!r$oses O<L@.
, Enable ARCHI?ELOD )o%e for %a&abase
The scr*$& )a3 a$$ear &o han4 a& &he S+L $ro)$&
Ehen &he %a&abase *s sh!&&*n4 %oEn an% be*n4
o$ene%' :a*& a feE )*n!&es an% *& sho!l% $ro4ress'
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
S+L; S+L;
S3s&e) al&ere%'
S+L; S+L; Da&abase close%'
Da&abase %*s)o!n&e%'
ORACLE *ns&ance sh!& %oEn'
S+L; ORACLE *ns&ance s&ar&e%'
To&al S3s&e) Dlobal Area 07#(F2F(" b3&es
A*Ge% S*He #11I1(0 b3&es
?ar*able S*He 120(CCC00 b3&es
Da&abase >!ffers I2C2#IIC b3&es
Re%o >!ffers F2C1IIC b3&es
Da&abase )o!n&e%'
S+L;
Da&abase al&ere%'
S+L;
Da&abase al&ere%'
S+L; Da&abase lo4 )o%e Arch*ve Mo%e
A!&o)a&*c arch*val Enable%
Arch*ve %es&*na&*on =SE_D>_RECO?ER@_AILE_DEST
Ol%es& onl*ne lo4 seB!ence #F
<eG& lo4 seB!ence &o arch*ve #I
C!rren& lo4 seB!ence #I
S+L;
$
0@ $et u' %b&es& as the net ser*ice name -or your 'lanned %b&es& dataase/
a@ (n a gra'hical terminal window as the oracle user? set u' your en*ironment to
'oint to your orcl
$ . oraenv
instance and in*oke the ne&ca utility/
ORACLE_SID = [orcl] ? orcl
$ netca
The 7racle &et Con-iguration Assistant B&6TCA@ o'ens a window/
@ 7n the Aelcome 'age? select J%ocal &et $er*ice &ame con-iguration?K and click &eDt/
c@ 7n the &et $er*ice &ame Con-iguration 'age? select Add and click &eDt/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!22
d@ (n the $er*ice &ame -ield? enter %b&es& and click &eDt/
e@ 7n the &et $er*ice &ame Con-iguration? $elect Protocols 'age? select TCP and
click &eDt/
-@ 7n the &et $er*ice &ame Con-iguration? TCPL(P Protocol 'age? enter #our host
name? -or eDam'le? e%rsr1I$#'!s'oracle'co)? select J=se the standard 'ort
numer o- .31.?K and then click &eDt/
g@ 7n the &et $er*ice &ame Con-iguration? Test 'age? select J&o? do not testK
Because your %b&es& dataase does not yet eDist@ and click &eDt/
h@ 7n the &et $er*ice &ame Con-iguration? &et $er*ice &ame 'age? enter %b&es&
as &et $er*ice &ame? and then click &eDt/
i@ Click &o in answer to the "uestion JAould you like to con-igure another net
ser*ice nameCK and then click &eDt/
,@ Ahen you see the com'letion message? click &eDt again/
k@ Finally? click Finish/
3@ =se 7racle &et Manager to con-igure the LISTE<ER with the %b&es& and orcl
dataase ser*ices/
a@ (n a gra'hical terminal window as the oracle user? set u' your en*ironment to
'oint to your JASM
$ . oraenv
instance and in*oke the ne&)4r utility/
ORACLE_SID = [orcl] ? 3(06
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!23
The Oracle base for
ORACLE_HOME=!"#a$$oracle$ro%!c&##'('"4r*% *s
!"#a$$oracle
$ netmgr
@ The 7racle &et Manager o'ens a window/ Click the JFK icon? right e-ore the
word J%ocal?K then click the JFK icon? right e-ore the word J%istenersK to eD'and
the nodes in the na*igation tree until you see the listener? called JLISTE<ER/K
c@ First select LISTE<ER in the le-t 'art o- the window then? select !ataase
$er*ices -rom the dro'+down in the right 'art o- the window/
d@ Click the Add !ataase utton/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!25
e@ 6nter or con-irm the -ollowing *alues2
Gloal !ataase &ame2 %b&es&
7racle 5ome !irectory2 Lu"#a$$oracle$ro%!c&##'('"4r*%
$(!2 %b&es&
-@ Click the Add !ataase utton again/
g@ 6nter the -ollowing *alues2
Gloal !ataase &ame2 orcl
7racle 5ome !irectory2 !"#a$$oracle$ro%!c&##'('"4r*%
$(!2 orcl
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!26
h@ From the 7racle &et Manager menu ar? select File I $a*e &etwork
Con-iguration? then File I 6Dit/
4@ Clone a dataase y using )MA&/ $tart the du'lication 'rocess in 6nter'rise
Manager/
a@ %og in to 6nter'rise Manager as the S@S user with the oracle_0= 'assword and
connect as S@SD>A/
@ &a*igate to !ata Mo*ement I Clone !ataase Bin the Mo*e !ataase Files
section@/
c@ 7n the Clone !ataase2 $ource Ty'e 'age? select JA running dataaseK and J=se
)eco*ery Manager B)MA&@ to co'y dataase -ilesK and then click Continue/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!3"
d@ 7n the Clone !ataase2 $ource 7'tions 'age? enter or con-irm oracle as the
username and 'assword? click J$a*e as Pre-erred Credential?K and then click
&eDt/
e@ 7n the Clone !ataase2 $elect !estination 'age? enter %b&es& oth as Gloal
!ataase &ame and as (nstance &ame? and select Automatic $torage
Management BA$M@ -rom the !ataase $torage dro' down list/ Then click &eDt/
-@ (- the Clone !ataase2 A$M (nstance %ogin 'age a''ears? enter oracle_0= as
S@S 'assword? and click %ogin/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!31
g@ 7n the Clone !ataase2 !estination 7'tions 'age? enter or con-irm DATA as
!ataase Area? ARA as the Flash )eco*ery Area? and enter ("""
h@ You recei*e a warming that the F)A is smaller then twice the dataase size/
Because you 'lan to rarely use the F)A o- this test dataase? click Yes to
continue/
as the Flash
)eco*ery Area $ize/ Then click &eDt/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!3!
i@ 7n the Clone !ataase2 !ataase Con-iguration 'age2
$elect JCon-igure 6nter'rise Manager !ataase Control -or this dataaseK?
Con-irm
!"#a$$oracle$ro%!c&##'('"%bho)e_#ne&EorPa%)*n as
the

Con-iguration File %ocation/


6nter or con-irm !"#a$$oracle$ro%!c&##'('"%bho)e_#
6nter oracle_0= siD times in all 'assword -ields? and enter FF"F as 5TTP
'ort/
in the
%istener 7racle 5ome -ield/
Click &eDt/
,@ (- you recei*e a warning? that the sBlne&'ora -ile or the l*s&ener'ora -ile
do not eDist? acce't the warning y clicking Yes/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!3+
k@ 7n the Clone !ataase2 $chedule 'age? ensure that the ,o starts immediately and
click &eDt/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!3.
l@ 7n the Clone !ataase2 )e*iew 'age? re*iew the !etails? including the !ataase
$torage and click $umit Jo/
m@ Aait on the JClone !ataase ,o is eing sumittedK 'age/
n@ The Clone !ataase2 Con-irmation 'age should dis'lay a success message/ Click
the View $tatus to trans-er to the Jo Acti*ity 'age/
o@ This takes you to the 6Decution 'age/ 7ccasionally? click your rowserNs reload
utton? to dis'lay the ,o 'rogress until you recei*e a success message/ BThe
eDecution time -or your ,o de'ends on your hardware and a*ailale system
resources/@
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!30
'@ $croll to the ottom o- the 'age to see the eDecuted ste's/ $ome o- the eDecuted
ste's ha*e out'ut logs? -or eDam'le2
N $ource Pre'aration shows the initialization 'arameters o- the source dataase/
N !estination Pre'aration shows %b&es&
N !u'licate dataase contains )MA& o'erations/
listener and ser*ice in-ormation/
N )eco*er !ataase shows restarting o- the %b&es&
N Add Tem'orary Files also shows out'ut -rom 6nter'rise Manager
con-iguration/
dataase/
N Check !ataase and Mask data each log into the new du'licated dataase/
;@ Test the access to your cloned dataases in $>%EPlus/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!32
a@ Connected as the oracle user in a gra'hical terminal session? ensure that you are
'ointing to the orcl dataase/
$ . oraenv
ORACLE_SID = [JASM] ? orcl
$
@ Connect as the S@S user to your orcl dataase and eDecute the -ollowing "uery2
select dbidC nameC createdC open_mode
from vLdatabase;
$ sqlplus / as sysdba
S+L; select dbidC nameC createdC open_mode from vLdatabase;
D>ID <AME CREATED O-E<_MODE
9999999999 999999999 9999999999999999999 99999999999999999999
#((#171(10 ORCL (""29"I91".#2.(#.17 READ :RITE
S+L;
c@ &ow connect as the S@STEM user with the oracle_0= 'assword to your %b&es&
dataase and eDecute the 'receding "uery/ 6Dit -rom $>%EPlus/
S+L; connect system<dbtest
En&er $assEor%. oracle_9) <<< not displayed
Connec&e%'
S+L; select dbidC nameC createdC open_mode from vLdatabase;
D>ID <AME CREATED O-E<_MODE
9999999999 999999999 9999999999999999999 99999999999999999999
#"7CI(1221 D>TEST (""29"79"(.#2.#(.(F READ :RITE
S+L; exit
$
8@ Aith the dbca utility? delete the DBTEST dataase ecause it is no longer needed
a/ (n a terminal window?s$tart dbca/
$ dbca
/ Click &eDt on the Aelcome 'age/
c/ Choose !elete a !ataase on the 7'erations 'age/
d/ $elect dbtest -rom the list o- dataases to delete/ Then click Finish/
Oracle Internal & Oracle cadem! "#e Onl!
Practice 29-1: Du-(icating a Database $continued%
Oracle Database 11g: Administration Workshop II A;!33
e/ Con-irm the delete o'eration y clicking Yes/
-/ A-ter the delete o'eration is -inished? click &o when asked i- you want to 'er-orm
another %bca
o'eration/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Internal & Oracle cadem! "#e Onl!
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming *ablespace
4oint;in;*ime (eco'ery
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; !
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Ob<ecti'es
'ter completin( t%i# le##on- !o& #%o&ld be able to0
P Bi#t )%at operation# occ&r )%en !o& per'orm table#pace
point5in5time reco1er! H$S2I$4I
P De'ine t%e terminolo(! &#ed )it% $S2I$4
P Identi'! t%e circ&m#tance# )%ere $S2I$4 i# a (ood
#ol&tion
P Determine t%e correct tar(et time 'or t%e point5in5time
reco1er!
P Identi'! t%o#e #it&ation# )%ere $S2I$4 cannot be &#ed-
and %o) to )or3 aro&nd t%em
P 2er'orm a&tomated $S2I$4
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; +
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
*ablespace 4oint;in;*ime (eco'ery =*S4I*(>:
Concepts
P $S2I$4 enable# !o& to A&ic3l! reco1er one or more
table#pace# to an earlier time.
P $S2I$4 doe# not a''ect t%e #tate o' ot%er table#pace# or
ob/ect# in t%e databa#e.
*ablespace 4oint;in;*ime (eco'ery =*S4I*(>: Concepts
)MA& automatic tales'ace 'oint+in+time reco*ery BT$P(T)@ enales you to "uickly
reco*er one or
more tales'aces in an 7racle dataase to an earlier time? without a--ecting the state o- the
other
tales'aces and o,ects in the dataase/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; .
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
*ablespace 4oint;in;*ime (eco'ery =*S4I*(>:
*erminology
P $ar(et time0 $%e point in time or SC7 t%at t%e table#pace
)ill be reco1ered to
P 4eco1er! #et0 Data 'ile# t%at compo#e t%e table#pace# to
be reco1ered
P &+iliar! #et0 Data 'ile# reA&ired 'or t%e $S2I$4 o' t%e
reco1er! #et t%at are not part o' t%e reco1er! #et. It
t!picall! incl&de#0
Q SYSTEM table#pace
Q "ndo #e(ment table#pace#
Q $emporar! table#pace
P &+iliar! de#tination0 Di#3 location to #tore 'ile#
*ablespace 4oint;in;*ime (eco'ery =*S4I*(>: *erminology
The -ollowing terminology is used when discussing T$P(T)2
X Target time$ The 'oint in time or system change numer B$C&@ that the tales'ace will e
reco*ered to during T$P(T)
X Recover# set$ !ata -iles com'osing the tales'aces to e reco*ered
X Au>iliar# set$ !ata -iles re"uired -or T$P(T) o- the reco*ery set that are not themsel*es
'art o-
the reco*ery set/ The auDiliary set ty'ically includes2
+ A co'y o- the SYSTEM tales'ace
+ !ata -iles containing undo segments -rom the target instance
+ (n some cases? a tem'orary tales'ace? used during the eD'ort o- dataase o,ects -rom the
auDiliary instance
X Au>iliar# destination$ A location on disk that can e used to store any o- the auDiliary set
data
-iles? control -iles? and online logs o- the auDiliary instance during T$P(T)/ Files stored in
the
auDiliary destination can e deleted a-ter T$P(T) is com'lete/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 0
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
*ablespace 4oint;in;*ime (eco'ery: Architecture
*arget database
Au7iliary instance
(-A)
Data %ile
backups
Archi'ed
redo log %iles (eco'ered tablespace
1
!
Control %ile
(estore
(eco'er
(estore
*ablespace 4oint;in;*ime (eco'ery: Architecture
(n the diagram? the -ollowing T$P(T) entities are shown2
X Target database$ Contains the tales'ace to e reco*ered
X Control file$ Pro*ides acku' in-ormation to )MA&
X -ac7up sets$ Come -rom the target dataase and are the source o- the reconstructed
tales'ace
X Archived redo logs$ Come -rom the target dataase and are the source o- the reconstructed
tales'ace
X Au>iliar# instance$ (s the 7racle dataase instance used during the reco*ery 'rocess to
'er-orm
the reco*ery
)MA& 'er-orms the -ollowing ste's during tales'ace 'oint+in+time reco*ery2
./ )estores a acku' control -ile -rom a 'oint in time e-ore the target time to the auDiliary
instance/ (t restores the data -iles -or the reco4ery set to the target dataase and the data -iles
-or
the au,iliary set to the auDiliary instance/
1/ )eco*ers the restored data -iles to the s'eci-ied 'oint in time
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 2
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
*ablespace 4oint;in;*ime (eco'ery: Architecture
*arget database
Au7iliary
instance
(-A)
(eco'ered
tablespace
. +
?7port
%ile
Control %ile
0
?7port
4oint to reco'ered tablespace metadata
Import metadata
*ablespace 4oint;in;*ime (eco'ery Architecture =continued>
9/ 6D'orts the dictionary metadata aout o,ects in the reco*ered tales'ace to the target
dataase
0/ (ssues SWITCH commands on the target dataase so that the target dataase control -ile
'oints to
the data -iles in the reco*ery set that were reco*ered on the auDiliary instance
3/ (m'orts the dictionary metadata -rom the auDiliary instance to the target instance? allowing
the
reco*ered o,ects to e accessed
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 3
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
When to ,se *S4I*(
P $S2I$4 can be &#ed in t%e 'ollo)in( #it&ation#0
Q $o reco1er data lo#t a'ter an erroneo&# TRUNCATE TABLE
#tatement
Q $o reco1er 'rom lo(ical corr&ption o' a table
Q $o &ndo t%e e''ect# o' a batc% /ob or D8B #tatement# t%at
%a1e a''ected onl! a part o' t%e databa#e
Q $o reco1er a lo(ical #c%ema to a di''erent point 'rom t%e re#t
o' t%e p%!#ical databa#e
P $S2I$4 &#e# tran#portable table#pace# and Data 2&mp-
pro1idin( t%e 'ollo)in( ne) capabilitie# and 'eat&re#0
Q $S2I$4 can be &#ed to reco1er a dropped table#pace.
Q $S2I$4 can be per'ormed repeatedl! to point#5in5time
be'ore t%e table#pace )a# bro&(%t online )it%o&t reA&irin( a
reco1er! catalo(.
When to ,se *S4I*(
)MA& T$P(T) can e used to2
X )eco*er data lost a-ter an erroneous TRUNCATE TABLE statement
X )eco*er -rom logical corru'tion o- a tale
X =ndo the e--ects o- an incorrect atch ,o or another data mani'ulation language B!M%@
statement that has a--ected only a suset o- the dataase
X )eco*er a logical schema to a di--erent 'oint in time than other 'arts o- the 'hysical
dataase
Prior to 7racle !ataase ..g )elease1? T$P(T) used eD'ort and im'ort -or 'rocessing/
T$P(T) now
uses trans'ortale tales'aces and !ata Pum'/ Because o- this change to the underlying
technology?
T$P(T) can e used to reco*er a dro''ed tales'ace/ (n addition? T$P(T) can e 'er-ormed
re'eatedly to di--erent 'oints in time without the need -or a reco*ery catalog/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 5
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4reparing %or *S4I*(
$o prepare 'or $S2I$4- per'orm t%e 'ollo)in( #tep#0
P Determine t%e correct tar(et time.
P Determine )%at i# needed in t%e reco1er! #et.
P Identi'! and pre#er1e ob/ect# t%at )ill be lo#t a'ter $S2I$4.
4reparing %or *S4I*(
Be-ore 'er-orming T$P(T)? you need to determine the correct target time -or your reco*ery/
You
need to determine whether you need additional tales'aces in your reco*ery set/ You should
e*aluate
what o,ects will e lost as a result o- the T$P(T) o'eration and determine how you want to
'reser*e
those o,ects/
6ach o- these ste's is discussed in more detail in this lesson/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 6
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Determining the Correct *arget *ime
P *o& cannot per'orm $S2I$4 a #econd time &nle## !o& are
&#in( a reco1er! catalo(.
P 'ter !o& per'orm $S2I$4 and brin( t%e table#pace online-
!o& cannot &#e a bac3&p 'rom an earlier time.
P "#e t%e 'ollo)in( met%od# to determine t%e correct tar(et
time0
Q Dla#%bac3 E&er!
Q Dla#%bac3 $ran#action E&er!
Q Dla#%bac3 6er#ion E&er!
P Simple alternati1e to $S2I$40 Dla#% bac3 data Hi' #till
a1ailable a# &ndoI.
Determining the Correct *arget *ime
(t is eDtremely im'ortant that you choose the right target time or $C& -or T$P(T)/ A-ter you
'er-orm T$P(T) and ring a tales'ace online? you cannot use any acku' -rom a time
earlier than
the moment you rought the tales'ace online/ (n 'ractice? this means that you cannot make
a second
attem't at T$P(T) i- you choose the wrong target time the -irst time? unless you are using a
reco*ery
catalog/ 5owe*er? i- you ha*e a reco*ery catalog? you can 'er-orm re'eated T$P(T)
o'erations to
di--erent target times/
The current control -ile does not contain a record o- an older incarnation o- the reco*ered
tales'ace
i- you do not use a reco*ery catalog/ )eco*ery with a current control -ile that in*ol*es the
tales'ace
cannot use a acku' taken 'rior to the time when you rought the tales'ace online/
5owe*er? you
can 'er-orm incom'lete reco*ery o- the whole dataase to any time 'rior to or e"ual to the
time when
you rought the tales'ace online i- you can restore a acku' control -ile -rom e-ore that
time/
You can use 7racle Flashack >uery? 7racle Flashack Transaction >uery? and 7racle
Flashack
Version >uery to in*estigate changes to your dataase and to hel' determine the correct
target time
-or T$P(T)/
Note$ Aith the Flashack tools and the data still a*ailale as undo data? it is usually much
sim'ler to
use the Flashack tools -or undoing unwanted changes Brather than T$P(T)@/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 1"
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Determining the *ablespaces
%or the (eco'ery Set
P "#e t%e TS_PITR_CHECK 1ie) to identi'! relation#%ip#
t%at #pan reco1er! #et bo&ndarie#.
P I' ob/ect# in t%e table#pace t%at !o& are reco1erin( %a1e
relation#%ip# )it% ob/ect# in ot%er table#pace#- !o& can0
Q dd t%e table#pace t%at contain# t%e related ob/ect# to t%e
reco1er! #et
Q S&#pend t%e relation#%ip 'or t%e d&ration o' $S2I$4
Q 4emo1e t%e relation#%ip
P "#e t%e DBMS_TTS.TRANSPORT_SET_CHECK proced&re
to determine )%et%er t%e table#pace# in t%e reco1er! #et
are #el'5contained.
Determining the *ablespaces %or the (eco'ery Set
(- you are unsure whether you ha*e accounted -or all o,ects that ha*e relationshi's with the
o,ects
in the tales'aces you are 'er-orming the T$P(T) o'eration -or? you can use the
TS_PITR_CHECK
*iew to identi-y any additional o,ects/ Ahen you "uery this *iew? in-ormation aout any
o,ects that
will 're*ent you -rom 'roceeding with T$P(T) is dis'layed/ The reason why tales'ace
'oint+intime
reco*ery cannot 'roceed is dis'layed in the REASON column o- the TS_PITR_CHECK
*iew/
As an eDam'le? i- you are 'lanning to 'er-orm T$P(T) -or the USERS and EXAMPLE
tales'aces?
eDecute the -ollowing "uery to determine whether there are any relationshi's with o,ects in
other
tales'aces that are not accounted -or2
SELECT * FROM SYS.TS_PITR_CHECK
WHERE (TS1_NAME IN ('USERS','EXAMPLE')
AND TS2_NAME NOT IN ('USERS','EXAMPLE'))
OR (TS1_NAME NOT IN ('USERS','EXAMPLE')
AND TS2_NAME IN ('USERS','EXAMPLE'));
)e-er to the Oracle 9ata.ase :ackup and Reco4ery User6s ;uide -or additional eDam'les
using the
TS_PITR_CHECK *iew/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 11
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Identi%ying (elationships *hat Span (eco'ery Set
/oundaries
"#e DBMS_TTS.TRANSPORT_SET_CHECK to en#&re t%at
$S2I$4 )ill be #&cce##'&l0
SELECT *
FROM SYS.TS_PITR_CHECK
WHERE (
TS1_NAME IN ('USERS','EXAMPLE')
AND TS2_NAME NOT IN ('USERS','EXAMPLE'))
OR (
TS1_NAME NOT IN ('USERS','EXAMPLE')
AND TS2_NAME IN ('USERS','EXAMPLE'));
DBMS_TTS.TRANSPORT_SET_CHECK ('USERS', 'EXAMPLE');
SELECT * FROM TRANSPORT_SET_VIOLATIONS;
Identi%ying (elationships /et1een Ob<ects *hat Span the (eco'ery Set
/oundaries
Be-ore 'er-orming T$P(T)? you must determine the reco*ery set/ (- o,ects in the
tales'aces you
need to reco*er ha*e relationshi's with o,ects in other tales'aces? you need to make
'ro*isions -or
those o,ects/
Prior to 7racle !ataase ..g )elease 1? you used the SYS.TS_PITR_CHECK *iew to
identi-y
relationshi's etween o,ects that s'an the reco*ery set oundaries/ &ow you should use the
DBMS_TTS.TRANSPORT_SET_CHECK 'rocedure and "uery the
TRANSPORT_SET_VIOLATIONS *iew/
Note$ )MA& T$P(T) automatically eDecutes the DBMS_TTS.TRANSPORT_SET_CHECK
'rocedure -or the reco*ery set tales'aces and *eri-ies that the "uery against
TRANSPORT_SET_VIOLATIONS returns no rows/ (- the "uery returns rows? )MA& sto's
T$P(T)
'rocessing and any tales'ace containment *iolations must e resol*ed e-ore T$P(T) can
'roceed/
You can eDecute the 'rocedure and "uery the *iew as descried ao*e as a 'recautionary
measure/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 1!
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Identi%ying Ob<ects *hat Will /e :ost
P Ob/ect# created in t%e table#pace a'ter t%e tar(et reco1er!
time are lo#t.
P E&er! TS_PITR_OBJECTS_TO_BE_DROPPED to
determine )%ic% ob/ect# )ill be lo#t 'ollo)in( $S2I$4.
P "#e E+port prior to $S2I$4 and Import 'ollo)in( $S2$I4
to pre#er1e and re5create t%e lo#t ob/ect#.
Identi%ying Ob<ects *hat Will be :ost
>uery the TS_PITR_OBJECTS_TO_BE_DROPPED *iew to determine whether there are
any
o,ects that will e lost as a result o- 'er-orming tales'ace 'oint+in+time reco*ery/
As an eDam'le? you are 'er-orming T$P(T) -or the USERS and EXAMPLE tales'aces to
the target
time o- A'ril 9? 1<<4 at 829<2<< AM/ (ssue the -ollowing "uery to determine whether there
are any
o,ects that will e lost -ollowing your T$P(T)2
SELECT OWNER, NAME, TABLESPACE_NAME,
TO_CHAR(CREATION_TIME, 'YYYY-MM-DD:HH24:MI:SS')
FROM TS_PITR_OBJECTS_TO_BE_DROPPED
WHERE TABLESPACE_NAME IN ('USERS','EXAMPLE')
AND CREATION_TIME >
TO_DATE('2006-APR-03:08:30:00','YY-MON-DD:HH24:MI:SS')
ORDER BY TABLESPACE_NAME, CREATION_TIME;
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 1+
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming /asic (-A) *S4I*(
P D&ll! a&tomated $S2I$4
Q Speci'! an a&+iliar! de#tination.
Q 487 mana(e# all a#pect# o' $S2I$4.
Q $%i# i# t%e recommended met%od.
P C&#tomi.ed $S2I$4 )it% an a&tomatic a&+iliar! in#tance
Q $%i# i# ba#ed on '&ll! a&tomated $S2I$4.
Q C&#tomi.e t%e location o' 'ile#.
Q Speci'! initiali.ation parameter#.
Q Speci'! c%annel con'i(&ration#.
P $S2I$4 &#in( !o&r o)n a&+iliar! in#tance
Q Con'i(&re and mana(e t%e a&+iliar! in#tance.
4er%orming /asic (-A) *S4I*(
You ha*e the -ollowing o'tions when 'er-orming T$P(T)2
X (ull# automated T!P8TR$ $'eci-y an auDiliary destination? and )MA& manages all
as'ects o-
the T$P(T) o'eration/ This is the sim'lest way to 'er-orm T$P(T)? and is recommended
unless
you s'eci-ically need more control o*er the location o- reco*ery set -iles a-ter T$P(T) or
auDiliary set -iles during T$P(T)? or control o*er the channel con-igurations or some other
as'ect o- your auDiliary instance/
X Customi?ed T!P8TR with an automatic au>iliar# instance$ T$P(T) is ased on the
eha*ior
o- -ully automated T$P(T)? 'ossily still using an auDiliary destination/ You can customize
one
or more as'ects o- the eha*ior? such as the location o- auDiliary set or reco*ery set -iles/
You
can s'eci-y initialization 'arameters or channel con-igurations -or the auDiliary instance
created
and managed y )MA&/
X T!P8TR with #our own au>iliar# instance$ $et u'? start? sto'? and clean u' the auDiliary
instance used in T$P(T)/ (n addition? you can manage the T$P(T) 'rocess y using some o-
the
methods a*ailale in customized T$P(T) with an automatic auDiliary instance/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 1.
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming 8ully Automated *S4I*(
1. Con'i(&re c%annel# reA&ired 'or $S2I$4 on t%e tar(et
in#tance.
2. Speci'! t%e a&+iliar! de#tination &#in( t%e AUXILIARY
DESTINATION option.
=. Cac3 &p t%e reco1ered table#pace# and brin( t%em online.
RMAN> CONNECT TARGET
RMAN> RECOVER TABLESPACE users, example
> UNTIL TIME '2007-06-29:08:00:00'
> AUXILIARY DESTINATION
> '/u01/app/oracle/oradata/aux';
4er%orming 8ully Automated *S4I*(
(n addition to the 're'aration re"uirements discussed earlier in the lesson? when you 'er-orm
-ully
automated T$P(T)? you must2
X Con-igure any channels re"uired -or T$P(T) on the target instance
X $'eci-y a destination -or )MA& to use -or the auDiliary set o- data -iles and other auDiliary
instance -iles
A-ter T$P(T) has com'leted? ack u' the reco*ered tales'aces and ring them online/ You
cannot
use acku's o- any tales'aces that 'artici'ate in T$P(T) taken 'rior to T$P(T) a-ter you
'er-orm
T$P(T)/
Note$ This time -ormat assumes that NLS_DATE_FORMAT is set to 'yyyy-mmdd:
hh24:mi:ss' and NLS_LANG is set to AMERICAN_AMERICA.WE8MSWIN1252/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 10
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
,sing Image Copies %or 8aster *S4I*(
4er%ormance
CONFIGURE AUXNAME i# replaced b! SET NEWNAME 'or
reco1er! #et data 'ile#0
CONFIGURE AUXNAME FOR DATAFILE
'$ORACLE_BASE/oradata/orcl/users01.dbf'
TO '/backup/users01.dbf';
RECOVER TABLESPACE users UNTIL SEQUENCE 1300 THREAD 1;
RUN
{
SET NEWNAME FOR DATAFILE
'$ORACLE_BASE/oradata/orcl/users01.dbf'
TO '/backup/users01.dbf';
RECOVER TABLESPACE users UNTIL SEQUENCE 1300 THREAD 1;
}
,sing Image Copies %or 8aster (-A) *S4I*( 4er%ormance
You can im'ro*e T$P(T) 'er-ormance y directing )MA& to use the eDisting image co'ies
o- the
reco*ery set and auDiliary set data -iles/ This techni"ue enales )MA& to ski' restoring the
data -iles
-rom a acku'/
Prior to 7racle !ataase ..g )elease 1? you used the -ollowing techni"ues to s'eci-y the
eDistence o-
an image co'y o- a data -ile2
X CONFIGURE AUXNAME command -or image co'ies o- reco*ery set data -iles or auDiliary
set
data -iles
X SET NEWNAME command -or image co'ies o- auDiliary set data -iles
&ow you should use the CONFIGURE AUXNAME command only with image co'ies o-
auDiliary set
data -iles/ You should use the SET NEWNAME command -or image co'ies o- reco*ery set
data -iles or
auDiliary set data -iles/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 12
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
,sing ?nterprise -anager to 4er%orm *S4I*(
,sing ?nterprise -anager to 4er%orm *S4I*(
You can also use 6nter'rise Manager to 'er-orm T$P(T)/ &a*igate to A*ailaility I
Per-orm
)eco*ery/ (n the =ser !irected )eco*ery section? select Tales'aces -rom the )eco*ery
$co'e dro'down
menu/
There are three o'erations you can 'er-orm? -or tales'aces2
X Recover to current time or a previous point in time$ )estores the data -iles -or the
tales'ace?
i- needed/ This o'eration then uses redo to reco*er to the time you s'eci-y2 either the current
time or a time in the 'ast/ This is the comination o- the -ollowing two o'erations/
X Restore tablespaces$ 7nly restore the data -iles -or the tales'ace/ &o reco*ery is
'er-ormed/
X Recover from previousl# restored tablespaces$ Per-orm reco*ery Bredo a''lication@ only?
o-
the tales'aceNs data -iles/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 13
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
(-A) *S4I*( 4rocessing
487 per'orm# t%e 'ollo)in( #tep#0
1. Create# t%e a&+iliar! in#tance- #tart# it- and connect# to it
2. $a3e# t%e table#pace# t%at )ill be reco1ered o''line
=. 4e#tore# a bac3&p control 'ile 'rom a point in time be'ore
t%e tar(et time to t%e a&+iliar! in#tance
4. 4e#tore# t%e data 'ile# 'rom t%e reco1er! #et and t%e
a&+iliar! #et to t%e a&+iliar! in#tance
5. 4eco1er# t%e re#tored data 'ile# to t%e #peci'ied time
6. Open# t%e a&+iliar! databa#e )it% t%e RESETLOGS option
(-A) *S4I*( 4rocessing
The ste's that )MA& carries out to 'er-orm T$P(T) are listed in this slide and the neDt/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 15
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
(-A) *S4I*( 4rocessing
7. E+port# t%e dictionar! metadata abo&t ob/ect# in t%e
reco1ered table#pace# to t%e tar(et databa#e
@. S%&t# do)n t%e a&+iliar! in#tance
9. Import# t%e dictionar! metadata 'rom t%e a&+iliar! in#tance
to t%e tar(et in#tance
10.Delete# all a&+iliar! #et 'ile#
(-A) *S4I*( 4rocessing =continued>
A-ter )MA& com'letes the last ste'? the T$P(T) 'rocess is com'lete/ The reco*ery set data
-iles are
returned to the state they were in at the s'eci-ied target time/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; 16
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming (-A) *S4I*( 1ith an (-A)-anaged
Au7iliary Instance
P 4ename or relocate !o&r reco1er! #et data 'ile#.
P Speci'! a location ot%er t%an t%e a&+iliar! de#tination 'or
#ome or all o' t%e a&+iliar! #et data 'ile#.
P Create ima(e cop! bac3&p# o' !o&r data 'ile# in ad1ance
o' $S2I$4.
P "#e a di''erent c%annel con'i(&ration 'or t%e a&+iliar!
in#tance.
P Speci'! di''erent initiali.ation parameter# 'or !o&r 487mana(ed
a&+iliar! in#tance.
4er%orming (-A) *S4I*( 1ith an (-A);-anaged Au7iliary Instance
(- you want to customize )MA& T$P(T)? you can use an )MA&+managed auDiliary
instance and
make the -ollowing changes2
X )ename the reco*ery set data -iles using SET NEWNAME so that they are not restored and
reco*ered in their original locations/
X Control the location o- your auDiliary set data -iles y s'eci-ying new names -or indi*idual
-iles
with SET NEWNAME and using DB_FILE_NAME_CONVERT to 'ro*ide rules -or
con*erting
data -ile names in the target dataase to data -ile names -or the auDiliary dataase/
X =se eDisting image co'ies o- the reco*ery set and auDiliary set data -iles on disk rather than
restoring them -rom acku' -or -aster )MA& T$P(T) 'er-ormance/
Note$ )e-er to the Oracle 9ata.ase :ackup and Reco4ery User6s ;uide -or additional
in-ormation/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; !"
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming (-A) *S4I*( ,sing @our O1n
Au7iliary Instance
P 7ot recommended- b&t #&pported
P 2er'orm t%e 'ollo)in( #tep#0
1. Create an Oracle pa##)ord 'ile 'or t%e a&+iliar! in#tance.
2. Create an initiali.ation parameter 'ile 'or t%e a&+iliar!
in#tance.
=. 6eri'! Oracle 7et connecti1it! to t%e a&+iliar! in#tance.
4. Start t%e a&+iliar! in#tance in NOMOUNT mode.
5. Connect t%e 487 client to t%e tar(et and a&+iliar!
in#tance#.
6. E+ec&te t%e RECOVER TABLESPACE command.
4er%orming (-A) *S4I*( ,sing @our O1n Au7iliary Instance
7racle recommends that you allow )MA& to manage the creation and destruction o- the
auDiliary
instance used during )MA& T$P(T)/ 5owe*er? creating and using your own auDiliary
instance is
su''orted/
To create an 7racle instance suitale -or use as an auDiliary instance? 'er-orm the -ollowing
ste's2
./ Create an 7racle 'assword -ile -or the auDiliary instance y using the orapwd utility/
1/ Create a teDt initialization 'arameter -ile -or the auDiliary instance/
9/ Veri-y 7racle &et connecti*ity to the auDiliary instance using a *alid net ser*ice name/
To 'er-orm T$P(T)? com'lete the -ollowing ste's2
0/ $tart the auDiliary instance in NOMOUNT mode/
3/ Connect the )MA& client to target and auDiliary instances/
4/ 6Decute the RECOVER TABLESPACE command/
)e-er to the Oracle 9ata.ase :ackup and Reco4ery User6s ;uide -or a detailed eDam'le/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; !1
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
*roubleshooting (-A) *S4I*(
P Dile name con'lict#0 En#&re t%at t%ere are no name
con'lict# )%en &#in( SET NEWNAME- CONFIGURE
AUXNAME- and DB_FILE_NAME_CONVERT.
P 487 cannot identi'! table#pace# )it% &ndo #e(ment#0
"#e t%e UNDO TABLESPACE cla&#e.
P 4e#tartin( a man&al a&+iliar! in#tance a'ter $S2I$4
'ail&re0 S%&t do)n and re#tart in NOMOUNT mode.
*roubleshooting (-A) *S4I*(
(ile name conflicts$ (- your use o- SET NEWNAME? CONFIGURE AUXNAME? and
DB_FILE_NAME_CONVERT cause multi'le -iles in the auDiliary or reco*ery sets to ha*e
the same
name? you recei*e an error during T$P(T)/ To correct the 'rolem? s'eci-y di--erent *alues
-or these
'arameters to eliminate the du'licate name/
)MA& cannot identi-y tales'aces with undo segments2 !uring T$P(T)? )MA& needs
in-ormation
aout which tales'aces had undo segments at the T$P(T) target time/ This in-ormation is
usually
a*ailale in the reco*ery catalog? i- one is used/ (- there is no reco*ery catalog? or i- the
in-ormation
is not -ound in the reco*ery catalog? )MA& 'roceeds assuming that the set o- tales'aces
with undo
segments at the target time is the same as the set o- tales'aces with undo segments at the
'resent
time/ (- this assum'tion is not correct? the T$P(T) o'eration -ails and an error is re'orted/ To
're*ent
this -rom ha''ening? 'ro*ide a list o- tales'aces with undo segments at the target time in the
UNDO
TABLESPACE clause/
)estarting manual auDiliary instance a-ter T$P(T) -ailure2 (- you are managing your own
auDiliary
instance and there is a -ailure in T$P(T)? then e-ore you can retry T$P(T)? you must shut
down the
auDiliary instance? correct the 'rolem? and 'ut the auDiliary instance ack in NOMOUNT
mode/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II / ; !!
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Summary
In t%i# le##on- !o& #%o&ld %a1e learned %o) to0
P Bi#t )%at operation# occ&r )%en !o& per'orm table#pace
point5in5time reco1er! H$S2I$4I
P De'ine t%e terminolo(! &#ed )it% $S2I$4
P Identi'! t%e circ&m#tance# )%ere $S2I$4 i# a (ood
#ol&tion
P Determine t%e correct tar(et time 'or t%e point5in5time
reco1er!
P Identi'! t%o#e #it&ation# )%ere $S2I$4 cannot be &#ed-
and %o) to )or3 aro&nd t%em
P 2er'orm a&tomated $S2I$4
Oracle Internal & Oracle cadem! "#e Onl!
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming ,ser;-anaged /ackup and
(eco'ery
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; !
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Ob<ecti'es
'ter completin( t%i# le##on- !o& #%o&ld be able to0
P De#cribe t%e di''erence bet)een &#er5mana(ed and
#er1er5mana(ed bac3&p and reco1er!
P 2er'orm &#er5mana(ed complete databa#e reco1er!
P 2er'orm &#er5mana(ed incomplete databa#e reco1er! Oracle
Internal &
Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; +
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
*ypes o% /ackup and (eco'ery 4ractices
$!pe# o' databa#e bac3&p and reco1er! are0
P "#er5mana(ed0 Doe# not &#e 487.
Q "#e# OS command# to mo1e 'ile# aro&nd
Q 4eA&ire# DC to man&all! maintain bac3&p acti1it! record#
P Ser1er5mana(ed0 "#e# 487
*ypes o% /ackup and (eco'ery 4ractices
There are two methods you can use to reco*er your dataase/ You can use )MA&? and take
ad*antage o- its automatic reco*ery ca'ailities/ (t can restore the a''ro'riate -iles and ring
the
dataase ack to a current state y using *ery -ew commands/ You can also reco*er
manually/ This is
called user<managed reco4ery/ =ser+managed reco*ery entails mo*ing the -iles around using
7$
commands? and then issuing the reco*ery commands in $>%EPlus/
Both o- these methods use restore and reco*ery 'rocesses/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; .
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming a ,ser;-anaged
/ackup o% the Database
A(CAIV?:OG
modeB
Shut do1n& 4ut tablespaces into backup mode&
Copy %iles&
)o @es
4er%orming a ,ser;-anaged /ackup o% the Database
You can ack u' the dataase y using 7$ commands to make co'ies o- the data -iles/ The
course o-
action de'ends on whether the dataase is in A)C5(V6%7G mode or not/ (- it is? then you
can kee'
the dataase o'en and a*ailale y 'utting each tales'ace into acku' mode e-ore co'ying
its data
-iles/ 7therwise? you ha*e to shut down the dataase e-ore co'ying the data -iles/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 0
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
*he )eed %or /ackup -ode
Database block
A D-: statement updates
a database block:
Di%%erent parts o% the block are
1ritten to at di%%erent times:
t1 t2 t*
Copy
data %ile
1hile
online
I% the block is copied at time t2# then the block is fractured&
*he )eed %or /ackup -ode
Ahen a lock is eing written to as 'art o- the eDecution o- a data mani'ulation language
B!M%@
statement? there could e se*eral 'arts o- the lock a--ected/ &ot all o- the modi-ications to
the lock
ha''en at the same time? so there is the 'ossiility o- inconsistency in the lock at certain
times/
$u''ose time t3 re'resents the time etween when di--erent 'arts o- the lock are written to/
(-? at
time t3? the lock is co'ied as 'art o- the eDecution o- an 7$ co'y command? then the lock
is
considered -ractured/ Also? the 7$ co'y command does not necessarily co'y the -ile header
-irst? so
it must e -rozen -or the duration o- the co'y eDecution/
)MA& has the means to deal with this 'rolem/ (- a -ractured lock is read? it kee's
rereading it until
it is consistent/
5owe*er? i- an 7$ command such as the %inuD c' command is co'ying the data -ile? the
-ractured
lock is not recognized as such? and the co'y o- the lock is not consistent/ (n order to
remedy this?
'ut the tales'ace? or e*en the entire dataase? into what is called .ackup mode/ The e--ect o-
doing
this is that additional redo is generated/ An image o- each lock? e-ore it is modi-ied? is
written to
the redo log/ Then? during reco*ery o- locks in that data -ile? the e-ore image o- a -ractured
lock
can e used -or the asis o- reco*ery and the additional redo data is a''lied to it/ (n order to
reduce
the o*erhead associated with maintaining eDtra redo data? 7racle recommends 'utting one
tales'ace
at a time into acku' mode? while its data -iles are eing co'ied/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 2
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Identi%ying 8iles to -anually /ackup
!@03 select name from vAdatafileB
NA"E
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
;u+D;app;oracle;oradata;RC0;datafile;oD5mf5s#stem5.,m7#1Df56dbf
;u+D;app;oracle;oradata;RC0;datafile;oD5mf5s#sau>5.,m7#1Dp56dbf
;u+D;app;oracle;oradata;RC0;datafile;oD5mf5undotbsD5.,m7#1EF56dbf
;u+D;app;oracle;oradata;RC0;datafile;oD5mf5users5.,m7#1F,56dbf
;u+D;app;oracle;oradata;RC0;datafile;oD5mf5e>ample5.,ml%cmh56dbf
;u+D;app;oracle;oradata;RC0;datafile;surve#+D6dbf
!@03 select name from vAcontrolfileB
NA"E
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
;u+D;app;oracle;oradata;RC0;controlfile;oD5mf5.,mlDf1>56ctl
;u+D;app;oracle;flash5recover#5area;RC0;controlfile;oD5mf5.,mlDf7756ctl
Identi%ying 8iles to -anually /ackup
=ser+managed acku's re"uire you to know the data -ile names and locations on disk? so you
know
what -iles need to e co'ied/ (denti-y the data -iles to e acked u' y "uerying the
VO!ATAF(%6
*iew/ (denti-y the control -ile location y "uerying the VOC7&T)7%F(%6 *iew/ 7nly one
o- the
multi'leDed control -iles needs to e acked u'? ecause they are identical/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 3
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
-anually /acking ,p a NARC<8=E0G Database
P S%&t do)n t%e databa#e in#tance0
!@03 !</TD:N 8""ED8ATE
A cp ARAC0E5-A!E;RC0;datafile;G6dbf H
3 ;u+%;bac7up;datafile
!@03 !TART/P
P Cop! t%e data 'ile# to t%e bac3&p location0
P Cop! t%e control 'ile# to t%e bac3&p location0
P Start t%e in#tance and open t%e databa#e0
A cp ARAC0E5-A!E;RC0;controlfile;G6ctl H
3 ;u+%;bac7up;controlfile
-anually /acking ,p a NARC<8=E0G Database
You can make a consistent? whole dataase acku' o- a &7A)C5(V6%7G dataase y
shutting down
the dataase and co'ying all the data -iles and the control -ile to a acku' directory/ Because
the
action o- co'ying the -iles is done using 7$ commands Bin this case? the %inuD c'
command@? the
dataase must e shut down -irst/ This 'uts it in a consistent state/ (- your dataase is running
in
&7A)C5(V6%7G mode? this is your only o'tion/ 7therwise? in A)C5(V6%7G mode? you
can make
inconsistent acku's? which allows you to lea*e the dataase running while you take the
acku'/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 5
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
-anually /acking ,p an ARC<8=E0G Database
!@03 A0TER TA-0E!PACE users -EG8N -ACI/PB
P Identi'! table#pace# and t%eir data 'ile#0
A cp ARAC0E5<"E;oradata;orcl;usersG6dbf ;u+%;bac7up;datafile
P Cop! t%e data 'ile# 'or t%at table#pace to t%e bac3&p location0
P Crin( t%e table#pace o&t o' bac3&p mode0
!@03 A0TER TA-0E!PACE users END -ACI/PB
!@03 select file5nameJ tablespace5name from dba5data5filesB
(80E5NA"E TA-0E!PACE5NA"E
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCC
;u+D;app;oracle;oradata;orcl;users+D6dbf /!ER!
;u+D;app;oracle;oradata;orcl;users+%6dbf /!ER!
;u+D;app;oracle;oradata;orcl;undotbsD6dbf /NDT-!D
;u+D;app;oracle;oradata;orcl;s#sau>+D6dbf !K!A/L
;u+D;app;oracle;oradata;orcl;s#stem+D6dbf !K!TE"
;u+D;app;oracle;oradata;orcl;e>ample+D6dbf ELA"P0E
Dor eac% table#pace0
P 2&t t%e table#pace into bac3&p mode0
-anually /acking ,p an ARC<8=E0G Database
(- the dataase is in A)C5(V6%7G mode? then you do not necessarily ha*e to shut it down
e-ore
co'ying the -iles/ You end u' with an inconsistent acku'? ut the a''lication o- redo data
reco*ers it
to a consistent state/
!tarting -ac7up "ode$ You do ha*e to 'ut each o- the data -iles into acku' mode e-ore
co'ying
them? though/ !o this using the B6G(& BAC#=P clause o- the A%T6) TAB%6$PAC6 and
A%T6)
!ATABA$6 commands/ 5ere is the syntaD -or each2
A%T6) TAB%6$PAC6 <tablespace> B6G(& BAC#=PM
A%T6) !ATABA$6 B6G(& BAC#=PM
The A%T6) TAB%6$PAC6 command a--ects only those data -iles that elong to that
tales'ace/
A%T6) !ATABA$6 a--ects all data -iles in the dataase/
Ending -ac7up "ode$ (t is im'ortant to ring the data -iles out o- acku' mode/ You
cannot ha*e
any data -iles in acku' mode at the time the dataase is shut down/ (- you attem't to shut
down the
dataase in that state? you will recei*e an error/ Also? ecause acku' mode causes additional
redo to
e generated? there is eDtra load on the system/ There is no reason to ha*e any data -iles in
acku'
mode i- you are not acti*ely acking them u'/
Note$ (n addition? you need to archi*e out the current redo log -iles? and ack them u' sa-ely
as well/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 6
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
/acking ,p the Control 8ile
!@03 A0TER DATA-A!E -ACI/P CNTR0(80E T
%3 4;u+D;bac7up;controlfile6ba74B
Database altered6
Cac3 &p t%e control 'ile0
P # an ima(e cop!- to a #peci'icall! named 'ile0
P C! (eneratin( a #cript t%at re5create# it- in a trace 'ile0
!@03 A0TER DATA-A!E -ACI/P CNTR0(80E T TRACEB
Database altered6
/acking ,p the Control 8ile
You should ack u' the control -ile e*ery time you make a structural change to the dataase/
=se one
o- the commands shown in the slide to do this/ The -irst command creates a inary co'y o-
the -ile/
You can o'tionally su''ly the )6=$6 keyword i- the acku' -ile already eDists and you
want to
o*erwrite it/
The second command makes a 'lain teDt *ersion o- the control -ile? which is actually a scri't
that
creates the control -ile when run/ The resulting scri't is written to the diagnostics trace
directory?
such as2
O7)AC%6GBA$6LdiagLrdmsLorclLorclLtrace
You can also s'eci-y a name -or the trace -ile y using the A$ Q-ilenameQ clause/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 1"
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming ,ser;-anaged
Complete Database (eco'ery: O'er'ie1
"#er5mana(ed complete databa#e reco1er!0
P 4eco1er# t%e databa#e to t%e mo#t recent SC7
P Can be done )it% t%e entire databa#e at once- or a data
'ile or table#pace at a time
P 4eA&ire# a c&rrent or bac3&p control 'ile
P 4eA&ire# bac3&p# o' all 'ile# to be reco1ered
P 4eA&ire# all arc%i1e lo(# &p to t%e pre#ent
4er%orming Complete Database (eco'ery: O'er'ie1
Com'lete dataase reco*ery rings the dataase ack to its most current state/ You can
reco*er the
entire dataase? or a single tales'ace or data -ile at a time/ You must ha*e a current or
acku'
control -ile in order to 'er-orm com'lete dataase reco*ery/ You must also ha*e acku's
a*ailale
-or all -iles in need o- media reco*ery or you must ha*e all archi*ed redo log -iles that were
generated since the data -ile was added to the dataase/ )e-er to the Oracle 9ata.ase
:ackup and
Reco4ery User6s ;uide -or additional in-ormation aout re+creating data -iles when acku's
are not
a*ailale/
You must ha*e all the archi*e logs a*ailale? -rom the 'oint in time the acku's were taken?
to the
'resent/ (- you do not ha*e all o- them? you can reco*er only to the last 'oint in time when
redo is
a*ailale/ (- no archi*e logs are re"uired? then only online redo logs are a''lied/
>uery the -ollowing *iews2
X =AREC=ER5(80E$ To see which -iles need media reco*ery
X =AREC=ERK50G$ To see which archi*e logs are re"uired to 'er-orm reco*ery
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 11
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming Complete Closed Database
(eco'ery: O'er'ie1
Database
openB
Shut do1n&
)o
@es
9uery %or %iles to reco'er&
9uery %or needed archi'e logs&
(estore damaged %iles and archi'e logs&
(epair hard1are&
-ount database&
Open database&
(eco'er data %iles&
(estore needed %iles
4er%orming Complete Closed Database (eco'ery: O'er'ie1
=nder certain circumstances? such as damage to a -ile elonging to the $Y$T6M tales'ace?
the
instance shuts down automatically/ 6*en i- the instance kee's running? and there are
'rolems with
other data -iles? you may decide there is no *alue is kee'ing the dataase runningM too many
dataase
o,ects are a--ected/ (n that case? shut down the dataase to 'er-orm the reco*ery/
(- the dataase is still o'en? you can "uery the VO)6C7V6)GF(%6 *iew to see which data
-iles are
in need o- reco*ery? and a-ter you restored them? "uery VO)6C7V6)YG%7G to see which
archi*e
logs are re"uired/ That will tell you which -iles need to e restored -rom acku'? i- any/
Then shut down the dataase/ %ook into the media -ailure to determine the cause o- the
'rolem/
)e'air the 'rolem so that you can restore the -iles -rom acku'/ For eDam'le? you may need
to
re'lace a disk dri*e/
&ow you can 'er-orm the reco*ery using the )6C7V6) command/ %imit the sco'e o- the
reco*ery to
only what is needed? such as data -ile or tales'ace/ (- needed? reco*er the entire dataase/
Then o'en
the dataase/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 1!
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Identi%ying (eco'ery;(elated 8iles
!@03 !E0ECT fileMJ error (R" vArecover5fileB
!@03 !E0ECT archive5name (R" vArecover#5logB
P Identi'! data 'ile# t%at need to be reco1ered0
P Identi'! arc%i1e lo( 'ile# t%at are reA&ired to complete
reco1er!0
Identi%ying (eco'ery;(elated 8iles
(- the dataase is still o'en? "uery the -iles as descried elow/ 7therwise? attem't to start the
instance and mount the dataase to issue the "ueries/
(n order to determine which data -iles re"uire reco*ery? "uery the VO)6C7V6)GF(%6 *iew/
The
6))7) column indicates why the -ile re"uires reco*ery/ (- this column has any *alue other
than
7FF%(&6 &7)MA%? then it needs reco*ery/ To see the whole 'icture o- which data -iles
and
tales'aces are a--ected? ,oin VO!ATAF(%6 and VOTAB%6$PAC6 in this "uery/ 5ere is an
eDam'le2
$6%6CT r/F(%6Y? d/&AM6 d-Gname? t/&AM6 ts'Gname?
d/$TAT=$? r/6))7)? r/C5A&G6Y? r/T(M6
F)7M VO)6C7V6)GF(%6 r? VO!ATAF(%6 d? VOTAB%6$PAC6 t
A56)6 t/T$Y Z d/T$Y
A&! d/F(%6Y Z r/F(%6YM
This tells you the eDtent o- the damage? hel'ing you decide what the o,ects o- the
)6C7V6)
command should e/
The VO)6C7V6)YG%7G *iew shows which archi*e log -iles are needed to 'er-orm the
reco*ery/ (-
the list shows -iles that ha*e since een mo*ed o-- the de-ault archi*e log location? then you
ha*e to
restore them to some location e-ore 'er-orming reco*ery/
A-ter recording the results o- these "ueries? shut down the dataase/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 1+
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
(estoring (eco'ery;(elated 8iles
Data %iles
Archi'e logs
;dis7D;datafile6dbf ;dis7%;datafile6dbf
N08NE
1
!
+
(estoring (eco'ery;(elated 8iles
A-ter determining what data -iles and archi*e log -iles are re"uired? restore them to
a''ro'riate disk
locations/ )estore a data -ile y co'ying it -rom the acku' location? as in this eDam'le2
O c' Ldisk1Lacku'Ldata-ileLsur*ey<./d- [
I O7)AC%6GBA$6LoradataL7)C%Ldata-ileLsur*ey<./d-
(- any archi*e logs are needed -or reco*ery? check whether they are still in the de-ault disk
location
-or archi*e logs/ They may not e? i- they ha*e een mo*ed to ta'e or another disk dri*e? -or
eDam'le/ (- they ha*e een mo*ed? they need to e restored? either to the de-ault archi*e log
location
or to a tem'orary location/ (- there is enough s'ace a*ailale in the de-ault location Bwhich is
s'eci-ied y the %7GGA)C5(V6G!6$TG. initialization 'arameter@? then restore them there/
7therwise? you can 'ut them on some other disk location/ Ahen it is time to restore? you can
s'eci-y
that alternate location to -ind archi*e log -iles/
(- you had to mo*e a data -ile? that -act has to e recorded in the control -ile/ That is done y
eDecuting the A%T6) !ATABA$6 )6&AM6 F(%6 command? as shown in the -ollowing
eDam'le2
$>%I A%T6) !ATABA$6 )6&AM6 F(%6
1I QLu<.La''LoracleLoradataL7)C%Ldata-ileLsur*ey<./d-Q T7
9I QLnewdiskL7)C%Ldata-ileLsur*ey<./d-QM
Note$ You must start the instance and mount the dataase e-ore eDecuting the A%T6)
!ATABA$6
)6&AM6 F(%6 command/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 1.
(estoring (eco'ery;(elated 8iles =continued>
(- you ha*e not yet done so? mount the dataase and ring all the data -iles online/ You can
check the
status o- each data -ile y "uerying the VO!ATAF(%6 *iew/ Bring the data -iles online y
using a
command like the -ollowing2
$>%I A%T6) !ATABA$6 !ATAF(%6 [
1 I QLnewdiskL7)C%Ldata-ileLsur*ey<./d-Q 7&%(&6M
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 10
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Applying (edo Data
!@03 REC=ER A/T"AT8C (R" 4;u+D;arch5temp4 DATA-A!EB
1. ppl! redo data &#in( t%e )6C7V6) command0
ppl! eac% redo lo(
)it%o&t promptin(. lternate location 'or
re#tored arc%i1e lo( 'ile#
Co&ld be !ATABA$6-
TAB%6$PAC6- or !ATAF(%6
2. Open t%e databa#e0
!@03 A0TER DATA-A!E PENB
Applying (edo Data
&ow the data -iles ha*e een restored to some 'oint in the 'ast/ The archi*e log -iles ha*e
also een
restored2 either to their de-ault location or to some other location? -or the 'ur'ose o- this
reco*ery
only/ You are ready to 'er-orm the actual reco*ery ste'? which means the redo is a''lied and
the data
-iles are rought u' to the latest $C&/ !o that using the $>%EPlus )6C7V6) command/
(- you do not s'eci-y the A=T7MAT(C o'tion? then you are 'rom'ted -or each redo log -ile
that is
aout to e a''lied/ That gi*es you more control o*er the reco*ery 'rocess/ Ty'ically?
A=T7MAT(C
is used -or -ull reco*ery/
(- the archi*e log -iles ha*e een restored to some disk location other than the de-ault -or the
dataase? then you must s'eci-y the F)7M clause/ $u''ly the directory where the -iles are
stored? and
the reco*ery 'rocess will look there -or the -iles/
Finally? o'en the dataase/ (t is now -ully reco*ered/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 12
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming Complete Open Database (eco'ery
9uery %or %iles to reco'er&
9uery %or needed archi'e logs&
(estore damaged %iles and archi'e logs&
Diagnose media problem&
(eco'er data %iles&
/ring tablespaces online&
*ake tablespace=s> 1ith damaged data %iles o%%line&
Can bring
data %iles
onlineB
@es
)o
Done
4er%orming Complete Open Database (eco'ery
(- media -ailure occurs while the dataase is o'en? the dataase continues to -unction/ Ahen
an
attem't is made to write to one o- these data -iles? the data -ile is taken o--line automatically/
A "uery
against one o- these data -iles does not cause it to go o--line? ut it does result in an error
eing
returned to the user that issued the "uery/
As with the closed dataase reco*ery? you -irst need to "uery -or the -iles and archi*e logs
that need
to e reco*ered/ Then? take all tales'aces that contain damaged data -iles o--line/ =se a
command
such as the -ollowing to do this2
$>%I A%T6) TAB%6$PAC6 sur*ey 7FF%(&6 T6MP7)A)YM
=sing the T6MP7)A)Y o'tion causes 7racle to 'er-orm a check'oint on any online data
-iles
elonging to the tales'ace/ Check'ointed data -iles do not re"uire reco*ery when they are
rought
ack online? ecause they are u'+to+date -or the latest $C& o- any transactions that would
ha*e
a--ected them/ This is the more desirale o'tion? although the data -iles must e a*ailale at
the time
this command is run/ (t is 'ossile that the 'rolem was tem'orary? and you are ale to ring
the
tales'aces online with no errors/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 13
4er%orming Complete Open Database (eco'ery =continued>
(ns'ect the media to determine the cause o- the 'rolem/ You can use the !BV6)(FY utility
-or this/
(- the -iles are 'ermanently damaged? then 'roceed to restore and reco*er as descried -or the
closed
dataase reco*ery earlier in this lesson/ A-ter the restore and reco*ery ste's are com'lete?
ring all
the tales'aces online again/
Note$ For more in-ormation aout the !BV6)(FY utility? see the :ackup and Reco4ery
User6s
;uide/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 15
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming ,ser;-anaged
Incomplete (eco'ery: O'er'ie1
4eco1er t%e databa#e to a pa#t point in time in t%e 'ollo)in(
#it&ation#0
P *o& )ant t%e databa#e to be in t%e #tate t%at e+i#ted
be'ore a &#er error or an admini#trati1e error occ&rred.
P $%e databa#e contain# corr&pt bloc3# a'ter !o& tried bloc3
media reco1er!.
P *o& are &nable to per'orm complete databa#e reco1er!
beca&#e #ome o' t%e redo lo( 'ile# are mi##in(.
P *o& )ant to create a te#t databa#e t%at i# in t%e #tate at
#ome time in t%e pa#t.
P One or more &narc%i1ed redo lo( 'ile# and a data 'ile are
lo#t.
4er%orming ,ser;-anaged Incomplete (eco'ery: O'er'ie1
An incom'lete reco*ery is one that does not ring the dataase ack to the most recent $C&
that was
transacted/ For some reason? as listed in the slide? you need to reco*er that dataase only u'
to a
'oint in the 'ast? not to the 'resent/ The 'rocessing that occurs when 'er-orming incom'lete
reco*ery
di--ers -rom the 'rocessing -or com'lete reco*ery? asically? in the amount o- redo that is
a''lied/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; 16
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Choosing an Incomplete (eco'ery -ethod
Indicate )%en to #top appl!in( redo data b!0
P Speci'!in( a time at )%ic% to #top
P Speci'!in( an SC7 at )%ic% to #top
P I##&in( a CA&C6% command )%ile t%e reco1er! i#
e+ec&tin(
Applying redo data
SC) C 1!""
*ime C August !+# !""3 "1:"" A-
CANCE0
)o1
Choosing an Incomplete (eco'ery -ethod
As you 'lan your incom'lete reco*ery? decide which method you want to use -or s'eci-ying
when to
sto' a''lying redo data/ You sto' the reco*ery 'rocess y s'eci-ying one o- the -ollowing2
X A time$ The time in the logs at which reco*ery should sto'/ This can e automated so that
the
'rocess does not 'rom't you -or each -ile name/
X An !CN$ The system change numer at which reco*ery should sto'/ This can e
automated so
that the 'rocess does not 'rom't you -or each -ile name/
X CANCE0$ $'eci-y the CA&C6% keyword when the reco*ery 'rocess 'rom'ts -or the neDt
redo
log -ile name/ You cannot automate this 'rocess ecause you must s'eci-y CA&C6% to
terminate
the reco*ery o'eration/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; !"
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming ,ser;-anaged
Incomplete (eco'ery
P 4eco1er a databa#e &ntil time0
P 4eco1er a databa#e &ntil cancel0
!@03 REC=ER DATA-A!E /NT80 CANCE0B
!@03 REC=ER DATA-A!E /NT80
% T8"E 4%++ECD%CD*$D%$D+$+.4B
4er%orming ,ser;-anaged Incomplete (eco'ery
The -ollowing command is used to 'er-orm incom'lete reco*ery2
)6C7V6) RA=T7MAT(CS !ATABA$6 option
Following are the meanings o- the o'tions2
X A/T"AT8C$ Automatically a''lies archi*ed and redo log -iles
X option$ =&T(% T(M6 QYYYY+MM+!!255102M(2$$Q
=&T(% CA&C6%
=&T(% C5A&G6 HintegerI
=$(&G BAC#=P C7&T)7%F(%6
CancelC-ased 8ncomplete Recover#
Cancel+ased incom'lete reco*ery is *ery much like closed dataase com'lete reco*ery/ The
di--erence is how you eDecute the )6C7V6) commandM s'eci-y the =&T(% CA&C6%
clause/ This
clause causes the reco*ery 'rocess to 'rom't you with the suggested name -or each redo log
-ile to
e a''lied/ $o? as the reco*ery 'roceeds? you are 'rom'ted with an archi*ed or online redo
log -ile
name? and? -or each one? you can either acce't it or change it/ Ahen you reach the 'oint
where you
want the reco*ery to sto'? enter CA&C6% instead o- acce'ting the -ile name/ This sto's the
reco*ery/
A-ter this is done? you ha*e to o'en the dataase with the )6$6T%7G$ o'tion/ The dataase
is in
another instantiation now? so the redo log se"uence numers need to e reset/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; !1
4er%orming ,ser;-anaged Incomplete (eco'ery =continued>
A-ter o'ening the dataase? check the alert log -or messages/ This is how you -ind out i- the
reco*ery
was success-ul/
TimeC and ChangeC-ased 8ncomplete Recover#
Both time+ and change+ased incom'lete reco*ery are like the cancel+ased reco*ery? eDce't
that
di--erent criteria are used to s'eci-y when to sto' the reco*ery/ Time+ased reco*ery uses a
time
s'eci-ied on the command line o- the )6C7V6) command? to know when to sto'/ Change+
ased
reco*ery uses an $C&? s'eci-ied on the command line/
As with all incom'lete reco*eries? the dataase must then e o'ened using the )6$6T%7G$
o'tion/
Note$ To a''ly redo log -iles automatically during reco*ery? you can use the $>%EPlus $6T
A=T7)6C7V6)Y 7& command? enter A=T7 at the reco*ery 'rom't? or use the
)6C7V6)
A=T7MAT(C command/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; !!
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
4er%orming ,ser;-anaged
Incomplete (eco'ery: Steps
$o per'orm &#er5mana(ed incomplete reco1er!- 'ollo) t%e#e
#tep#0
1. S%&t do)n t%e databa#e.
2. 4e#tore data 'ile#.
=. 8o&nt t%e databa#e.
4. 4eco1er t%e databa#e.
5. Open t%e databa#e )it% t%e )6$6T%7G$ option.
4er%orming ,ser;-anaged Incomplete (eco'ery: Steps
./ (- the dataase is o'en? shut it down y using the &7)MA%? (MM6!(AT6? or
T)A&$ACT(7&A%
o'tion/
1/ )estore all data -iles -rom acku'/ You must use a acku' taken e-ore the time you 'lan
to
reco*er to/ You may also need to restore archi*ed logs/ (- there is enough s'ace a*ailale?
restore to the %7GGA)C5(V6G!6$T location or use the A%T6) $Y$T6M A)C5(V6
%7G
$TA)T T7 HLOCATIONI command or the $6T %7G$7=)C6 HLOCATIONI command to
change the location/ (- you 'er-orm incom'lete reco*ery to a 'oint when the dataase
structure
is di--erent than the current? you also need to restore the control -ile/
9/ Mount the dataase/
0/ )eco*er the dataase y using the )6C7V6) !ATABA$6 command/
3/ To synchronize data -iles with control -iles and redo logs? o'en the dataase y using the
)6$6T%7G$ o'tion/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; !+
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
,ser;-anaged *ime;/ased (eco'ery: ?7ample
$%i# i# t%e #cenario0
P /ob ran in error- and it# e''ect# m&#t be &ndone.
P $%i# %appened 15 min&te# a(o- and t%ere %a# been little
databa#e acti1it! #ince t%en.
P *o& decide to per'orm incomplete reco1er! to re#tore t%e
databa#e bac3 to it# #tate a# o' 15 min&te# a(o.
!@03 !</TD:N 8""ED8ATE
A cp ;-ACI/P;G6dbf ;u+D;db+D;RADATA
!@03 !TART/P "/NT
!@03 REC=ER DATA-A!E /NT80 T8"E 4%++ECDDC%1$DD$**$++4B
!@03 A0TER DATA-A!E PEN RE!ET0G!B
,ser;-anaged *ime;/ased (eco'ery: ?7ample
The -ollowing is a ty'ical scenario em'loying =&T(% T(M6 reco*ery/ Assume the -ollowing
-acts2
X The current time is .12<< PM on &o*emer 18? 1<<3/
X A ,o was run incorrectly? and many tales in se*eral schemas were a--ected/
X This ha''ened at a''roDimately ..203 AM/
X !ataase acti*ity is minimal ecause most sta-- are currently in a meeting/ The state o- the
dataase e-ore the ,o ran must e restored/
Because the a''roDimate time o- the error is known and the dataase structure has not
changed since
..200 AM? you can use the =&T(% T(M6 method2
./ (- the dataase is o'en? shut it down y using the &7)MA%? (MM6!(AT6? or
T)A&$ACT(7&A%
o'tion/
1/ )estore all data -iles -rom acku' Bthe most recent i- 'ossile@/ You may also need to
restore
archi*ed logs/ (- there is enough s'ace a*ailale? restore to the %7GGA)C5(V6G!6$T
location
or use the A%T6) $Y$T6M A)C5(V6 %7G $TA)T T7 HLOCATIONI command or the
$6T %7G$7=)C6 HLOCATIONI command to change the location/
9/ Mount the dataase/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; !.
,ser;-anaged *ime;/ased (eco'ery: ?7ample =continued>
0/ )eco*er the dataase2
$>%I reco*er dataase until time Q1<<3+..+182..2002<<Q
7)A+<<1;:2 change .08008 \ ..L1;L<3 .;2<021< needed -or thread
///
Media reco*ery com'lete/
3/ To synchronize data -iles with control -iles and redo logs? o'en the dataase y using the
)6$6T%7G$ o'tion2
$>%I alter dataase o'en resetlogsM
$>%I archi*e log list
///
7ldest online log se"uence <
&eDt log se"uence to archi*e .
Current log se"uence .
Ahen reco*ery is success-ul? noti-y users that the dataase is a*ailale -or use? and any data
entered
a-ter the reco*ery time B..200 AM@ will need to e reentered/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; !0
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
,ser;-anaged Cancel;/ased (eco'ery: ?7ample
$%e #cenario i# t%e #ame a# t%e one 'or t%e time5ba#ed
e+ample- e+cept 'or t%e#e 'indin(#0
P 4edo lo(# are not m&ltiple+ed.
P One o' t%e online redo lo(# i# mi##in(.
P $%e mi##in( redo lo( i# not arc%i1ed.
P $%e redo lo( contained in'ormation 'rom 110=4 8.
P $)ent!5#i+ min&te# o' data are lo#t.
P "#er# can reenter t%eir data man&all!.
,ser;-anaged Cancel;/ased (eco'ery: ?7ample
A-ter searching through the directory -or the redo log -iles? you notice that redo log log1a/rdo
cannot e located and has not een archi*ed/ There-ore? you cannot reco*er 'ast this 'oint/
>uerying VOA)C5(V6!G%7G con-irms the asence o- archi*ed log se"uence 08
Blog1a/rdo@2
$>%I $6%6CT E F)7M *Oarchi*edGlogM
)6C(! $TAMP /// F()$TGC5A&G6Y F()$TGT(M6
+++++ +++++++++ /// +++++++++++++ ++++++++++
. 9.839.044 /// 8899< <3+..+.32.1209
0; 9.:3.188< /// 9<:<4; <3+..+182..214
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; !2
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
,ser;-anaged Cancel;/ased (eco'ery: ?7ample
4eco1er t%e databa#e a# 'ollo)#0
P S%&t do)n t%e databa#e.
P 4e#tore all data 'ile# 'rom t%e mo#t recent bac3&p.
P 8o&nt t%e databa#e.
P E+ec&te )6C7V6) !ATABA$6 =&T(% CA&C6%.
P E+ec&te A%T6) !ATABA$6 7P6& )6$6T%7G$ to open
t%e databa#e.
,ser;-anaged Cancel;/ased (eco'ery: ?7ample =continued>
The ste's -or cancel+ased reco*ery are the same as -or time+ased reco*ery? eDce't -or the
)6C7V6) !ATABA$6 ste'/ Ahen the )6C7V6) !ATABA$6 =&T(% CA&C6%
command is
eDecuted? it reco*ers the dataase until it cannot -ind a log -ile/ Ahen you are 'rom'ted -or
the name
o- the missing archi*ed redo log -ile? enter CA&C6%M the reco*ery sto's at that 'oint in time/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II C ; !3
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Summary
In t%i# le##on- !o& #%o&ld %a1e learned %o) to0
P De#cribe t%e di''erence bet)een &#er5mana(ed and
#er1er5mana(ed bac3&p and reco1er!
P 2er'orm &#er5mana(ed complete databa#e reco1er!
P 2er'orm &#er5mana(ed incomplete databa#e reco1er! Oracle
Internal &
Oracle cadem! "#e Onl!
Oracle Internal & Oracle cadem! "#e Onl!
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
-anaging the AS- Instance Oracle Internal &
Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; !
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Ob<ecti'es
'ter completin( t%i# le##on- !o& #%o&ld be able to0
P De#cribe t%e bene'it# o' &#in( S8
P 8ana(e t%e S8 in#tance
P Create and Drop S8 di#3 (ro&p#
P E+tend S8 di#3 (ro&p#
P 4etrie1e S8 metadata &#in( 1ario&# &tilitie#
Ob<ecti'es
This lesson 'ro*ides a more detailed look at the A$M instance and how to manage it with
*arious
utilities/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; +
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- /ene%its %or Administrators
S8 eliminate#0
P I;O per'ormance t&nin(
P Data 'ile mo1ement# and
reor(ani.ation#
P Dile name mana(ement
P Bo(ical 1ol&me
mana(ement
P Dile #!#tem mana(ement
P Cl&#ter 'ile #!#tem
mana(ement
P 4a) de1ice mana(ement
S8 #i(ni'icantl! red&ce#0
P B"7 mana(ement
Q De)er- lar(er B"7#
P Databa#e admini#trator
dependence on #!#tem
admini#trator
P Bi3eli%ood o' error#
a##ociated )it% man&al
maintenance ta#3#
AS- /ene%its %or Administrators
A$M eliminates the need -or many tasks that are re"uired in non+A$M storage
en*ironments/ There
include2
X (L7 'er-ormance tuning + A$MQs stri'e and mirror e*erything 'olicy cou'led with
automatic
realancing o'erations means that (L7 'er-ormance tuning aimed at alancing disk utilization
and eliminating disk hot+s'ots is not re"uired/
X !ata -ile mo*ements and reorganizations + Juggling the 'lacement o- data -iles to satis-y
'er-ormance re"uirements and s'ace constraints is not re"uired/
X File name management + You no longer need to de-ine and en-orce a -ile naming 'olicy/
X %ogical *olume? -ile system? cluster -ile system and raw de*ice management + You no
longer
re"uire these storage elements/
A$M deli*ers -urther ene-its y reducing e--ort in these im'ortant areas2
X %=& management e--ort is reduced as A$M will ty'ically re"uire -ewer? larger? %=&s/
X The de'endence that o-ten eDists etween a dataase administrator and a system
administrator
is greatly reduced/ For eDam'le? system administrator in*ol*ement is not re"uired to add a
new
data -ile or mo*e disk resources -rom one disk grou' to another/
X The likelihood o- errors associated with manual maintenance tasks is greatly reduced/ For
eDam'le? using a con*entional -ile system a newly created data -ile may accidentally reak a
-ile naming con*ention that results in it not eing acked u' with the rest o- the dataase/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; .
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- Instance
$%e S8 In#tance i# t%e proce## and memor! component# 'or
S8.
Other misc& processes
System Global Area =SGA> D memory
Shared
4ool
:arge
4ool
AS-
Cache
8ree
-emory
4rocesses D C4, components
AS- Instance
(/A: A(/n G-O) Onnn 4E6n
-A(F
AS- Instance
6*ery time A$M or a dataase is started? a shared memory area called the system gloal area
B$GA@
is allocated and 7racle A$M or dataase ackground 'rocesses are started/ The comination
o- the
ackground 'rocesses and the $GA is called an 7racle A$M instance or an 7racle !ataase
instance/
The instance re'resents the CP= and )AM com'onents o- a running A$M en*ironment/
The $GA in an A$M instance is di--erent in memory allocation and usage than the $GA in a
dataase
instance/ The $GA in the A$M instance is di*ided into -our 'rimary areas as -ollows2
X !hared Pool$ =sed -or metadata in-ormation
X 0arge Pool$ =sed -or 'arallel o'erations
X A!" Cache$ =sed -or reading and writing locks during realance o'erations
X (ree "emor#$ =nallocated memory a*ailale
The minimum recommended amount o- memory -or an A$M instance is 134 MB/ Automatic
memory management is enaled y de-ault on an A$M instance and will dynamically tune
the sizes
o- the indi*idual $GA memory com'onents/ The amount o- memory that is needed -or an
A$M
instance will de'end on the amount o- disk s'ace eing managed y A$M/
The second 'art o- the A$M instance is the ackground 'rocesses/ An A$M instance can
ha*e many
ackground 'rocessesM not all are always 'resent/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 0
AS- Components: AS- Instance =continued>
The ackground 'rocesses s'eci-ic to A$M -unctionality are co*ered in the neDt slide/ There
are
re"uired ackground 'rocesses and o'tional ackground 'rocesses/ $ome o- these 'rocesses
may
include the -ollowing2
X ARCn$ The archi*er 'rocesses
X CIPT$ The check'oint 'rocess
X D-:n$ The dataase writer 'rocesses
X D8AG$ The diagnosaility 'rocess
X Nnnn$ Jo "ueue 'rocesses
X 0G:R$ The log writer 'rocess
X P"N$ The 'rocess monitor 'rocess
X P!P+$ The 'rocess s'awner 'rocess
X @"Nn$ The "ueue monitor 'rocesses
X REC$ The reco*erer 'rocess
X !"N$ The system monitor 'rocess
X =IT"$ The *irtual kee'er o- time 'rocess
X ""AN$ The memory manager 'rocess
The ao*e list o- 'rocesses in not com'lete/ For the A$M instance? these 'rocesses will not
always
'er-orm the same tasks as they would in a dataase instance/ For eDam'le? the %GA)
'rocess in a
dataase instance is res'onsile -or co'ying change *ectors -rom the log u--er section o- the
$GA to
the online redo logs on disk/ The A$M instance does not contain a log u--er in itNs $GA?
nor does it
use online redo logs/ The %GA) 'rocess in an A$M instance co'ies logging in-ormation to
an A$M
disk grou'/
(- A$M is clustered? then additional 'rocesses related to cluster management will e running
in the
A$M instance/ $ome o- these 'rocesses include the -ollowing2
X 0"N$ The gloal en"ueue ser*ice monitor 'rocess
X 0"Dn$ The gloal en"ueue ser*ice daemons
X 0"!n$ The gloal cache ser*ice 'rocesses
X 0CIn$ The lock 'rocesses
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 2
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- Components:
AS- InstanceG4rimary 4rocesses
$%e S8 in#tance primar! proce##e# are re#pon#ible 'or
S8related
acti1itie#.
Process Description
R-A0 Open# all de1ice 'ile# a# part o' di#co1er! and coordinate# t%e
rebalance acti1it!
AR-n One or more #la1e proce##e# t%at do t%e rebalance acti1it!
G"N 4e#pon#ible 'or mana(in( t%e di#35le1el acti1itie# #&c% a# drop or
o''line and ad1ancin( t%e S8 di#3 (ro&p compatibilit!
"ARI 8ar3# S8 allocation &nit# a# #tale )%en needed
nnn One or more S8 #la1e proce##e# 'ormin( a pool o' connection# to t%e
S8 in#tance 'or e+c%an(in( me##a(e#
POPn One or more parallel #la1e proce##e# &#ed in 'etc%in( data on
cl&#tered S8 in#tallation 'rom GVO 1ie)#
AS- Components: AS- InstanceG4rimary 4rocesses
The A$M instance uses dedicated ackground 'rocesses -or much o- its -unctionality/ The
)BA%
'rocess coordinates realance acti*ity -or disk grou's in an Automatic $torage Management
instance/ (t 'er-orms a gloal o'en on Automatic $torage Management disks/ The A)Bn
'rocesses
'er-orm the actual realance data eDtent mo*ements in an Automatic $torage Management
instance/
There can e many o- these at a time? called A)B<? A)B.? and so on/ The GM7& 'rocess
maintains
disk memershi' in A$M disk grou's/ The MA)# 'rocess marks A$M allocation units as
stale
-ollowing a missed write to an o--line disk/ The 7nnn 'rocesses re'resent the ser*er side o- a
clientLser*er connection/ These 'rocesses will a''ear the moment the instance is started? and
will
disa''ear a-ter that/ They -orm a 'ool o- connections to the A$M instance -or eDchanging
messages
and only a''ear when needed/ The P]:n 'rocesses re'resent one or more 'arallel sla*e
'rocesses
that are used in -etching data when A$M is running in a clustered con-iguration on more than
one
machine concurrently/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 3
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- Instance InitialiHation 4arameters
$%e S8 in#tance &#e# a #mall #&b#et o' t%e parameter# t%at
an Oracle Databa#e in#tance &#e#.
8N!TANCE5TKPE Q A!"
A!"5P:ER508"8T Q D
A!"5D8!I!TR8NG Q 4;dev;sdaD4J4;dev;sdbG4
A!"5D8!IGR/P! Q DATA%J (RA
A!"5PRE(ERRED5READ5(A80/RE5GR/P! Q DATA6(ailGroup%
D8AGN!T8C5DE!T Q ;u+D;app;oracle
0ARGE5P05!8OE Q D%"
RE"TE50G8N5PA!!:RD(80E Q EL0/!8=E
AS- Instance InitialiHation 4arameters
An A$M instance is controlled y a 'arameter -ile in the same way as a regular dataase
instance/
Parameters commonly set there include2
X (&$TA&C6GTYP6 should e set to A$M -or A$M instances/ This is the only 'arameter
that
must e de-ined/ For dataase instances? this is set to the *alue )!BM$/
X A$MGP7A6)G%(M(T controls the s'eed -or a realance o'eration/ Values range -rom .
through ..? with .. eing the -astest/ (- omitted? this *alue de-aults to ./
X A$MG!($#$T)(&G is an o'erating systemUde'endent *alue used y A$M to limit the set
o-
disks considered -or disco*ery/ The de-ault *alue is the null string? and this will e su--icient
in
most cases/ A more restricti*e *alue as shown ao*e may reduce the time re"uired -or A$M
to
'er-orm disco*ery? and thus im'ro*e disk grou' mount times/
X A$MG!($#G)7=P$ is the list o- names o- disk grou's to e mounted y an A$M instance
at
startu'? or when the A%T6) !($#G)7=P A%% M7=&T command is used/ 7racle )estart
can
mount disk grou's i- they are listed as de'endencies e*en i- they are not listed with the
A$MG!($#G)7=P$ 'arameter/ This 'arameter has no de-ault *alue/
X A$MGP)6F6))6!G)6A!GFA(%=)6GG)7=P$ s'eci-ies the -ailure grou's that contain
're-erred read disk/ This is use-ul in eDtended or stretched cluster dataases that ha*e
mirrored
co'ies o- data with one o- the co'ies in close 'roDimity to the ser*er/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 5
AS- Instance InitialiHation 4arameters =continued>
X !(AG&7$T(CG!6$T s'eci-ies the location o- the Automatic !iagnostic )e'ository
BA!)@
home/ Trace -iles? alert logs? core -iles? and incident -iles can e -ound under this directory/
The
de-ault *alue o- this 'arameter is deri*ed -rom the *alue o- 7)AC%6GBA$6/
X %A)G6GP77%G$(]6 s'eci-ies Bin ytes@ the size o- the large 'ool allocation hea'/ The
large
'ool allocation hea' is used in shared ser*er systems -or session memory? y 'arallel
eDecution
-or message u--ers? and y acku' 'rocesses -or disk (L7 u--ers/ The A$M instance makes
use o- automatic memory management? so this 'arameter ser*es as a minimum size that the
large 'ool can lowered to/
X )6M7T6G%7G(&GPA$$A7)!F(%6 s'eci-ies whether the 7racle so-tware checks -or a
'assword -ile/ The de-ault *alue is 6WC%=$(V6/
The eight 'arameters listed ao*e are the only non+de-ault 'arameters created -or an A$M
instance/
The A$M instance di--ers -rom a dataase instance in that not all dataase 'arameters are
*alid -or
an A$M instance/ A''roDimately ;0 o- the 900 total dataase instance 'arameters can e
used with
an A$M instance/ The remaining 'arameters not listed on this can e set as needed? although
de-ault
*alues should e su--icient -or most installations/
Note$ Automatic memory management is enaled y de-ault on A$M instances? e*en when
the
M6M7)YGTA)G6T 'arameter is not eD'licitly set/ This is the only 'arameter that you
need to set -or
com'lete A$M memory management/ 7racle Cor'oration strongly recommends that you use
automatic memory management -or A$M/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 6
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Interaction /et1een Database Instances and AS-
Screen reader hint: *his
slide contains a diagram that
is e7plained in the speaker
notes&
S8 In#tance
S!#tem Global rea
S%ared
2ool
Bar(e
2ool
S8
Cac%e
2roce##e#
4CB
4Cn
G8O7
Onnn
2R9n
84G
Databa#e In#tance
S!#tem Global rea
S%ared
2ool
Bar(e
2ool
C&''er
Cac%e
2roce##e#
28O7
DCF4
S8O7
Snnn
CG2$
BGF4
OOt%t%eerr Ot%er
OOt%t%eer r Ot%er
S8 Stora(e
Create 8ile
?7tent -ap
Commit
Close
InitialiHe
Allocation
1
!
+
.
0
2
Interaction /et1een Database Instances and AS-
The -ile creation 'rocess 'ro*ides a -ine illustration o- the interactions that take 'lace
etween
dataase instances and A$M/ The -ile creation 'rocess occurs as -ollows2
./ The dataase re"uests -ile creation/
1/ An A$M -oreground 'rocess creates a Continuing 7'eration !irectory BC7!@ entry and
allocates s'ace -or the new -ile across the disk grou'/
9/ The A$MB dataase 'rocess recei*es an eDtent ma' -or the new -ile/
0/ The -ile is now o'en and the dataase 'rocess initializes the -ile directly/
3/ A-ter initialization? the dataase 'rocess re"uests that the -ile creation is committed/ This
causes the A$M -oreground 'rocess to clear the C7! entry and mark the -ile as created/
4/ Acknowledgement o- the -ile commit im'licitly closes the -ile/ The dataase instance will
need
to reo'en the -ile -or -uture (L7/
This eDam'le rein-orces two im'ortant 'oints aout the architecture o- A$M2
X The !ataase (nstance and A$M (nstance work together in a coordinated -ashion/ A
!ataase
instance must interact with A$M to ma' dataase -iles to A$M eDtents/ A !ataase instance
also recei*es a constant stream o- messages relating to A$M o'erations Bsuch as disk grou'
realancing@ that may lock or mo*e A$M eDtents/
X !ataase (L7 is not channeled through the A$M instance/ (n -act? the dataase conducts (L7
o'erations directly against A$M -iles? as illustrated in ste' 0 in the slide/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 1"
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- Instance: Dynamic 4er%ormance Vie1s
$%e S8 in#tance %o#t# memor!5ba#ed metadata table#
pre#ented a# d!namic per'ormance 1ie)#.
P cce##ed b! S8 &tilitie# to retrie1e metadata5onl!
in'ormation &#in( t%e SEB lan(&a(e
P Contain# man! dedicated S8 related 1ie)# #&c% a#0
=AA!"5A08A! =AA!"5ATTR8-/TE =AA!"5C08ENT
=AA!"5D8!I =AA!"5D8!I58!TAT =AA!"5D8!I5!TAT
=AA!"5D8!IGR/P =AA!"5D8!IGR/P5!TAT =AA!"5(80E
=AA!"5PERAT8N =AA!"5TE"P0ATE
AS- Instance: Dynamic 4er%ormance Vie1s
7ne o- the ma,or -unctions o- any instance is the storage o- memory+ased metadata tales/
These
tales start with the 're-iD WO and are generally not documented/ A series o- dynamic
'er-ormance
*iews that start with the 're-iD VO are used to dis'lay a customized 'resentation o- the data
contained
in the WO memory tales/ The in-ormation is 'resented in a read+only -ashion a*ailale only
to
administrators with 'ri*ileges/ The in-ormation is retrie*ed -rom A$M using the $>%
language/ The
ao*e slide lists the most common dynamic 'er-ormance *iews that contain A$M+related
metadata/
There are se*eral hundred additional dynamic 'er-ormance *iews? ut most o- these *iews
will e
em'ty ecause they re"uire a dataase instance to mount a dataase control -ile/ A$M
instances do
not mount dataase control -iles/ For a com'lete list o- the dynamic 'er-ormance *iews? see
the
Oracle 9ata.ase Re'erence g Release 3 =.37 documentation manual/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 11
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- System 4ri'ileges
P n S8 in#tance doe# not %a1e a data dictionar!- #o t%e
onl! )a! to connect to S8 i# b! &#in( t%e#e #!#tem
pri1ile(e#.
P $Y$ &#er i# a&tomaticall! created )it% t%e $Y$A$M
pri1ile(e.
AS- 4ri'ilege 4ri'ilege Group
=Suggested>
4ri'ilege
$Y$A$M 7$A$M
Basmadmin@
D&ll admini#trati1e pri1ile(e
$Y$!BA 7$!BA
Basmda@
cce## to data #tored on S8- and $Y$A$M
in t%e c&rrent relea#e
$Y$7P6) 7$7P6)
Basmo'er@
Bimited pri1ile(e# to #tart and #top t%e S8
in#tance alon( )it% a #et o' nonde#tr&cti1e
A%T6) !($#G)7=P command#
AS- System 4ri'ileges
An A$M instance does not ha*e a data dictionary? so the only way to connect to an A$M
instance is
y using one o- three system 'ri*ileges? $Y$A$M? $Y$!BA? or $Y$7P6)/ The -ollowing
list
introduces these A$M system 'ri*ileges/
X $Y$A$M2 This 'ri*ilege 'ro*ides -ull administrati*e 'ri*ilege -or the A$M instance/
X $Y$!BA2 This 'ri*ilege grants access to data stored on A$M? and in the current release?
grants
the $Y$A$M administrati*e 'ri*ileges/
X $Y$7P6)2 This 'ri*ilege grants the aility to start and sto' A$M instances along with a set
o-
nondestructi*e A%T6) !($#G)7=P commands/ 7ther commands such as C)6AT6
!($#G)7=P are not allowed/
Ahen A$M is installed? o'erating system grou's are assigned the $Y$A$M? $Y$!BA? and
$Y$7P6)
'ri*ileges/ These grou's are known as the 7$A$M? 7$!BA? and 7$7P6) grou's?
res'ecti*ely/
Memershi' o- these o'erating system grou's automatically assigns the related system
'ri*ileges to
the o'erating system user in "uestion
Ahen an A$M instance is -irst created? sys and asmsnm' are the only A$M users that are
de-ined/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 1!
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
,sing ?nterprise -anager to -anage AS- ,sers
,sing ?nterprise -anager to -anage AS- ,sers
6nter'rise Manager allows you to manage the users who access the A$M instance through
remote
connection Busing 'assword -ile authentication@/ These users are reser*ed eDclusi*ely -or the
A$M
instance/
You ha*e this -unctionality only when you are connected as the $Y$A$M user/ (t is hidden
i- you
connect as $Y$!BA or $Y$7P6) users/
X Ahen you click the Create utton? the Create =ser 'age is dis'layed/
X Ahen you click the 6dit utton the 6dit =ser 'age is dis'layed/
X By clicking the !elete utton? you can delete the created users/
Note$ To login to A$M with the $Y$A$M role? click the Pre-erences link at the to' o- the
'age?
-ollowed y the Pre-erred Credentials link/ You will then see A$M in the list o- target ty'es/
Click
the $et Credentials icon eside the A$M target ty'e to de-ine an account and 'assword that
has the
$Y$A$M 'ri*ilege/ You may need to log out o- !ataase Control and login e-ore the
change takes
e--ect/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 1+
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Starting and Stopping AS- Instances
,sing S9:I4lus
Startin( and #toppin( S8 in#tance# &#in( SEBL2l&# i# #imilar
to t%e )a! in )%ic% !o& #tart and #top databa#e in#tance#.
A 6 oraenv
RAC0E5!8D Q RorclS T )A!"
The racle base for RAC0E5<"EQ;u+D;app;oracle;product;DD6%6+;grid is
;u+D;app;oracle
A sUlplus ; A! !K!A!"
!@0GPlus$ Release DD6%6+6D6+ C Production on :ed Nul 1 %+$*,$*, %++P
Cop#right &c' DP1%J %++PJ racle6 All rights reserved6
Connected to an idle instance6
!@03 startup
A!" instance started
Total !#stem Global Area %1*E,EE+* b#tes
(i>ed !i?e D..,+%1 b#tes
=ariable !i?e %E1+,.,E% b#tes
A!" Cache %ED,E1%* b#tes
A!" dis7groups mounted
A!" dis7groups volume enabled
!@03 shutdown abort
Starting and Stopping AS- Instances ,sing S9:I4lus
Aith $>%EPlus you start an A$M instance y using the $TA)T=P command similarly to
the way in
which you start an 7racle !ataase instance/ Ahen starting an A$M instance? note the
-ollowing2
X To connect to an A$M instance with $>%EPlus? set the 7)AC%6G$(! en*ironment
*ariale to
the A$M $(!/ The de-ault A$M $(! -or a single instance dataase is FA$M? and the de-ault
$(! -or A$M -or an 7racle )AC node is FA$Mnode2num.er where node2num.er is the
numer o- the node/ The oraen* scri't will set the 7)AC%6GBA$6? 7)AC%6G$(!?
7)AC%6G57M6 and PAT5 *ariales/
X The initialization 'arameter -ile must contain the -ollowing entry2
(&$TA&C6GTYP6 Z A$M
This 'arameter indicates that an A$M instance? not a dataase instance? is starting/
X Ahen you run the $TA)T=P command? rather than trying to mount and o'en a dataase?
this
command attem'ts to mount the disk grou's s'eci-ied y the initialization 'arameter
A$MG!($#G)7=P$/ (- you ha*e not entered a *alue -or A$MG!($#G)7=P$? you can
later
mount disk grou's with the A%T6) !($#G)7=P///M7=&T command/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 1.
Starting and Stopping AS- Instances ,sing S9:I4lus =continued>
The -ollowing list descries the $TA)T=P command 'arameters rele*ant to A$M/
X F7)C62 (ssues a $5=T!7A& AB7)T to the A$M instance e-ore restarting it
X M7=&T or 7P6&2 Mounts the disk grou's s'eci-ied in the A$MG!($#G)7=P$
initialization
'arameter/ This is the de-ault i- no command 'arameter is s'eci-ied/
X &7M7=&T2 $tarts u' the A$M instance without mounting any disk grou's
X )6$T)(CT2 $tarts u' an instance in restricted mode/ The )6$T)(CT clause can e used in
comination with the M7=&T? &7M7=&T? and 7P6& clauses/
(n restricted mode? dataase instances cannot use the disk grou's/ That is? dataases cannot
o'en -iles that are in that disk grou'/ Also? i- a disk grou' is mounted y an instance in
restricted mode? then that disk grou' cannot e mounted y any other instance in the cluster/
)estricted mode enales you to 'er-orm maintenance tasks on a disk grou' without
inter-erence
-rom clients/ )ealance o'erations that occur while a disk grou' is in restricted mode
eliminate
the lock and unlock eDtent ma' messaging that occurs etween A$M instances in a clustered
en*ironment/ This im'ro*es the o*erall realance through'ut/ At the end o- a maintenance
'eriod? you must eD'licitly dismount the disk grou' and remount it in normal mode/
The A$M shutdown 'rocess is initiated when you run the $5=T!7A& command in
$>%EPlus/
Be-ore you run this command? ensure that the 7)AC%6G$(! and 7)AC%6G57M6
en*ironment
*ariales are set so that you can connect to the A$M instance/
7racle strongly recommends that you shut down all dataase instances that use the A$M
instance
e-ore attem'ting to shut down the A$M instance/
The -ollowing list descries the $5=T!7A& command 'arameters rele*ant to A$M/
X &7)MA%2 A$M waits -or any in+'rogress $>% to com'lete e-ore dismounting all o- the
disk
grou's and shutting down the A$M instance/ Be-ore the instance is shut down? A$M waits
-or
all o- the currently connected users to disconnect -rom the instance/ (- any dataase instances
are connected to the A$M instance? then the $5=T!7A& command returns an error and
lea*es
the A$M instance running/ &7)MA% is the de-ault shutdown mode/
X (MM6!(AT6 or T)A&$ACT(7&A%2 A$M waits -or any in+'rogress $>% to com'lete
e-ore
dismounting all o- the disk grou's and shutting down the A$M instance/ A$M does not wait
-or
users currently connected to the instance to disconnect/ (- any dataase instances are
connected
to the A$M instance? then the $5=T!7A& command returns an error and lea*es the A$M
instance running/
X AB7)T2 The A$M instance immediately shuts down without the orderly dismount o- disk
grou's/ This causes reco*ery to occur u'on the neDt A$M startu'/ (- any dataase instance is
connected to the A$M instance? then the dataase instance aorts/
Note$ The &7)MA%? (MM6!(AT6? and T)A&$ACT(7&A% -orms o- shutdown do not
a''ly when
there are connected )!BM$ instances/ The -ollowing error will e returned2
7)A+.3<:;2 cannot $5=T!7A& A$M instance with connect )!BM$
instance
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 10
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Starting and Stopping AS- Instances
,sing srvctl
P $%e Se1er Control &tilit! Hsr*ctlI can be &#ed to #tart
and #top S8 in#tance#.
P $%e Se1er Control &tilit! Hsr*ctlI can be &#ed to c%ec3
t%e #tat&# o' S8 in#tance#.
A 6 oraenv
RAC0E5!8D Q RorclS T )A!"
The racle base for
RAC0E5<"EQ;u+D;app;oracle;product;DD6%6+;grid is
;u+D;app;oracle
A srvctl start asm Co mount
A srvctl stop asm Cf
A srvctl status asm
A!" is running on edrsr%EpD
Starting and Stopping AS- Instances ,sing srvctl
The $er*er Control utility Bsr*ctl@ can e used to start and sto' A$M instances along with
other
resources managed y the Grid (n-rastructure/ The sr*ctl utility can e -ound under oth the
7)AC%6G57M6Lin location -or Grid in-rastructure and the 7)AC%6G57M6Lin
location o- the
dataase installation/ You should use the sr*ctl utility located with the Grid (n-rastructure
installation
when managing A$M? listeners? or 7racle restart/ The sr*ctl utility can e used to control
A$M in
the -ollowing ways2
X $tart an A$M instance/
sr*ctl start asm R+o HstartGo'tionIS
HstartGo'tionI is one the *alid instance startu' o'tions
BF7)C6? M7=&T? 7P6&? &7M7=&T or )6$T)(CT@ Bo'tional@
X $to' an A$M instance/
sr*ctl sto' asm R+o Hsto'Go'tionIS +-
Hsto'Go'tionI is one the *alid instance shutdown o'tions
B&7)MA%? (MM6!(AT6? T)A&$ACT(7&A% or AB7)T@ Bo'tional@? and U- is to -orce
X )e'ort the status o- an A$M instance/
sr*ctl status asm
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 12
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Starting and Stopping AS- Instances
,sing asmcmd
$%e asmcmd &tilit! pro1ide# a command line inter'ace to S8
)it%o&t &#in( t%e SEB lan(&a(e.
A 6 oraenv
RAC0E5!8D Q RorclS T )A!"
The racle base for RAC0E5<"EQ;u+D;app;oracle;product;DD6%6+;grid is
;u+D;app;oracle
A asmcmd
Connected to an idle instance6
A!"C"D3 startup
A!" instance started
Total !#stem Global Area %1*E,EE+* b#tes
(i>ed !i?e D..,+%1 b#tes
=ariable !i?e %E1+,.,E% b#tes
A!" Cache %ED,E1%* b#tes
A!" dis7groups mounted
A!" dis7groups volume enabled
A!"C"D3 shutdown CCabort
A!" instance shut down
Connected to an idle instance6
Starting and Stopping AS- Instances ,sing asmcmd
A$M metadata -or administration is -ound inside the dynamic 'er-ormance *iews that are
contained
within the A$M instance/ These *iews are usually accessed with an A$M utility using the
$>%
language/ The re"uirement -or knowledge o- the $>% language increases the learning cur*e
-or
mastering A$M? and $>% language training is not a normal re"uirement in the learning 'ath
o- a
systems administrator or storage administrator/ The asmcmd utility 'ro*ides a 'seudo+shell+
like
en*ironment that acce'ts =&(W+style syntaD -or common A$M administration tasks/ (t can
e used
to manage 7racle A$M instances? disk grou's? -ile access control -or disk grou's? -iles and
directories within disk grou's? tem'lates -or disk grou's? and *olumes/
You can use the asmcmd utility to startu' and shutdown your A$M instance/ The su''orted
startu'
o'tions include2
++nomount BTo start the A$M instance without mounting disk grou's@
++restrict BTo start the A$M instance and restrict dataase usage@
++'-ile H'-ile/oraI BTo start the A$M instance with a custom '-ile@
The su''orted shutdown o'tions include2
++immediate BPer-orms shutdown immediate@
++aort BAort all eDisting o'erations@
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 13
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Disk Group O'er'ie1
Disk 1 Disk ! Disk + Disk . Disk 0 Disk 2
8ile 1 8ile !
8ile + 8ile .
Screen reader hint: *his
slide contains a diagram that
is e7plained in the speaker
notes&
Disk Group O'er'ie1
A disk grou' is a logical grou'ing o- one or more disks that A$M manages as a collection/
6ach disk
grou' contains the metadata associated with itsel-/ You can think o- an A$M disk grou' as
conce'tually similar to a logical *olume in a ty'ical storage area network/
Files are allocated -rom the s'ace inside a disk grou'/ The content o- -iles that are stored in a
disk
grou' are e*enly distriuted? or stri'ed? across the disks in the disk grou' to eliminate hot
s'ots and
to 'ro*ide uni-orm 'er-ormance across the disks/ 6ach A$M -ile is com'letely contained
within a
single disk grou'/ 5owe*er? a disk grou' can contain -iles elonging to se*eral dataases
and a
single dataase can use di--erent -iles -rom multi'le disk grou's/
A key attriute o- a disk grou' is itQs redundancy setting/ There are three 'ossile disk grou'
redundancy settings2
X 6Dternal redundancy? where A$M does not 'ro*ide any mirroring and the disks are
assumed to
highly reliale/
X &ormal redundancy? where A$M su''orts 1+way mirroring y de-ault to assure data
integrity
-or less reliale storage/
X 5igh redundancy? where A$M su''orts 9+way mirroring y de-ault -or e*en greater
assurance
o- data integrity/
A$M su''orts the creation o- u' to 49 disk grou's howe*er -or most installations you rarely
need
more than a -ew/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 15
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- Disks
S8 di#3#0
P re t%e #tora(e de1ice# pro1i#ioned to S8 di#3 (ro&p#
P re acce##ed t%ro&(% normal O;S inter'ace#
P 8&#t be read and )rite acce##ible b! t%e S8 o)ner
P 8&#t be acce##ible b! all node# in a cl&#ter
P 8a! %a1e di''erent O;S name# or pat%# on di''erent node#
P 8a! be0
Q n entire p%!#ical di#3 or partition o' a p%!#ical di#3
Q di#3 or partition 'rom a #tora(e arra!
Q Bo(ical 1ol&me# HB6I or lo(ical &nit# HB"7I
Q 7et)or35attac%ed 'ile# H7DSI
AS- Disks
A$M disk grou's contain one or more A$M disks/
A$M disks must e read and write accessile y the A$M owner -rom all nodes in the
cluster/
An A$M disk can e a 'artition on a disk? ut 7racle strongly ad*ises against sharing the
'hysical
disks used y A$M with other a''lications/ This is ecause the (L7 'er-ormance o- the A$M
disks
within a disk grou' should e similar and consistent -or the A$M stri'e and mirror 'olicy to
work
est/ $haring de*ices etween A$M and other a''lications makes it di--icult to assure
similar and
consistent disk 'er-ormance/
(t is not necessary -or the 7L$ de*ice names o- A$M disks on se'arate nodes in a cluster to
e the
same/ A$M identi-ies memers o- a disk grou' y reading the headers on A$M disks/
Generally? A$M disks are raw %=&s -rom a storage array 'resented to A$M/ (n addition?
A$M disks
can also e -iles on a remote &F$ -iler/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; 16
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Allocation ,nits
S8 di#3# are di1ided into allocation &nit# H"I0
P " #i.e i# con'i(&rable at di#3 (ro&p creation
P De'a&lt " #i.e i# 18C0
Q Small eno&(% to be cac%ed b! databa#e and lar(e eno&(%
'or e''icient #eA&ential acce##
P llo)able " #i.e#0
Q 1- 2- 4- @- 16- =2- or 64 8C.
Q Bar(e "# ma! be &#e'&l in 1er! lar(e databa#e H6BDCI
#cenario# or )%en &#in( #peciali.ed #tora(e %ard)are
Allocation ,nits
Aithin an A$M disk? s'ace is di*ided into allocation units BA=@/ The de-ault A= size is one
megayte? which is small enough to not ecome a hot s'ot? ut large enough to 'ro*ide
e--icient
se"uential access/ You can set the A= size when you create a disk grou'/ You cannot change
the A=
size -or a disk grou'/ %arger A= sizes may e use-ul in *ery large dataase BV%!B@
scenarios or
when using s'ecialized storage hardware/ (- an A= is constantly accessed? then the dataase
kernel
caches it -or more e--icient access/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; !"
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- 8iles
S8 'ile#0
P re a collection o' S8 e+tent# compo#ed o' "#
Q 6ariable #i.ed e+tent# #&pport lar(e 'ile#
P ppear a# normal 'ile# to t%e databa#e 3ernel
P 9a1e 'ile name# t%at #tart )it% STS
Q Dor e+ample-
F!ATALorclLdata-ileLsystem/134/48:891:1.
P 8a! be a##ociated )it% an optional alia# 'ile name
Q Dor e+ample- F!ATALd-ilesLmydLsystem<./d-
P re e1enl! di#trib&ted acro## di#3# in a di#3 (ro&p
P re mirrored accordin( to t%e policie# de'ined in t%e di#3
(ro&p
AS- 8iles
A$M eD'oses a set o- -iles -or use y clients o- A$M/ An A$M -ile is com'osed o- a set o-
allocation units and a''ears as a normal -ile to the dataase kernel/
6ach A$M File has a uni"ue system+generated name/ The slide shows and eDam'le o- a
-ully"uali-ied
A$M -ile name/ The -ully+"uali-ied A$M -ile name re'resents a hierarchy eginning with a
concatenation o- a 'lus sign with the disk grou' name/ Following the disk grou' name is the
dataase
name and -ile ty'e/ The -inal element is com'osed o- a tag name? -ile numer and incarnation
numer/ An alias can o'tionally e created to gi*e administrators a more user+-riendly means
o-
re-erring to an A$M -ile/
Files are e*enly s'read across the A$M disks in a disk grou' using the 'olicy o- stri'e and
mirror
e*erything B$AM6@/
A$M nati*ely su''orts most dataase related -ile ty'es? such as data -iles? log -iles? control
-iles?
)MA& acku's? and others/ Prior to 7racle !ataase ..g )elease 1? A$M only su''orted
7racle
dataase related -iles and could not e used to store and manage A$C(( trace -iles and alert
logs?
7racle inaries? the 7racle cluster registry B7C)@? and the cluster *oting disk/ 7racle
!ataase ..g
)elease 1 remo*es this restriction y 'ro*iding the means to run a general 'ur'ose -ile
system o*er
A$M/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; !1
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
?7tent -aps
Di#3 Gro&p
Di#3 C
Di#3 C
Di#3 D
Di#3
E+tent 8ap
S8 Dile
1
0
!
2
+
3
.
5
Dile
E+tent
?7tent -aps
A$M kee's track o- a -ileNs layout with metadata called an eDtent ma'/ An eDtent ma' is a
tale that
ma's data eDtents in a -ile to allocation units on disk/
The relationshi' etween -ile eDtents and allocation units is as -ollows/ An eDtent contains2
X 7ne A= -or the -irst 1<?<<< eDtents B<U.::::@
X 0 A=s -or the neDt 1<?<<< eDtents B1<<<<U9::::@
X .4 A=s -or eDtents ao*e 0<?<<<
Variale size eDtents? cou'led with large allocation units? can e used to accommodate *ery
large
A$M -iles/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; !!
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Striping Granularity
S8 #eparate# #tripin( 'or load balance and #tripin( 'or
latenc!0
P Coar#e (rain #tripin( concatenate# allocation &nit# 'or load
balancin(.
Q Dor e+ample0
!
+
. 1
0
AS- Disk Group
Striping Granularity
(n A$M stri'ing has two 'rimary 'ur'oses2
X %oad alance (L7 across all the disks in a disk grou'/
X (m'ro*e (L7 latency/
Coarse grain stri'ing s'reads allocation units across the disks in a disk grou'/ This is what
'ro*ides
load alancing -or disk grou's/ Ahen a -ile is allocated? A$M s'reads allocation units e*enly
across
all o- the disks/ $ometimes the distriution cannot e 'er-ectly e*en? ut o*er time it will
tend to e
nearly e"ual/ The ao*e diagram shows a -ile with -i*e allocation units stri'ed across -i*e
disks in an
eDternal redundancy disk grou' containing 8 disks in total/
For the -irst 1<?<<< eDtents? the eDtent size is e"ual to the A= size/ A-ter 1<?<<< eDtents and
u' to
0<?<<< eDtents? then eDtent sets are always allocated 8 at a time with the eDtent size e"ual to
0EA=
size/ (- the A= size is . MB? this means the A$M -ile will grow 40 MB at a time B8 E 0 E .
MB@/ (-
the -ile is coarse grained stri'ed then it is stri'ed across the 8 eDtent sets with stri'es o- .
A=/
$tri'ing is always done at the A= le*el? not at the eDtent le*el/ Thus e*ery A= o- a coarse
grained
-ile is on a di--erent disk than the 're*ious A= o- that -ile no matter how large the -ile/ A-ter
0<?<<<
eDtents? the eDtents are still allocated 8 at a time? ut with an eDtent size e"ual to .4EA= size/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; !+
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
8ine Grained Striping
Dine (rain #tripin( p&t# 12@ GC #tripe &nit# acro## (ro&p# o'
allocation &nit# to impro1e latenc!.
P Di#3 (ro&p )it% @ di#3# and e+ternal red&ndanc!
P De'a&lt " #i.e o' 1 8C in &#e
P Dir#t 1 8C e+tent )ritten a# 12@ GC #tripe# acro## @ "#
AS- Disk Group
8ine Grained Striping
Fine grain stri'ing s'lits data eDtents into .18 #B chunks and it is 'ro*ided to im'ro*e
latency -or
certain ty'es o- -iles y s'reading the load -or each eDtent across a numer o- disks/ Fine
grain
stri'ing is used y de-ault -or control -iles and online redo log -iles/
The diagram on this 'age shows how -ine grain stri'ing works/ (n this eDam'le? the -irst .
MB
eDtent o- a new -ile ends u' occu'ying the -irst .18 #B o- 8 di--erent allocation units s'read
across
the eight disks in the disk grou'/ Conse"uently? a one megayte read or write is s'read
across eight
disks instead o- one///
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; !.
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
8ine Grained Striping
E+ample0
P Di#3 (ro&p )it% @ di#3# and e+ternal red&ndanc!.
P De'a&lt " #i.e o' 1 8C in &#e.
P 7e+t 1 8C e+tent )ritten a# 12@ GC #tripe# acro## t%e
#ame @ allocation &nit# &ntil t%e! are '&ll.
AS- Disk Group
8ine Grained Striping =continued>
Continuing the 're*ious eDam'le? the neDt one megayte eDtent o- s'ace is s'read across the
second
.18 #B o- each o- the same allocation units/ This 'attern continues until the -irst set o-
allocation
units is -illed and another set in allocated/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; !0
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- 8ailure Groups
P #et o' di#3# #%arin( a common re#o&rce )%o#e 'ail&re
need# to be tolerated.
P 8irrored e+tent copie# #tored in #eparate 'ail&re (ro&p#.
P Stora(e %ard)are dictate# 'ail&re (ro&p bo&ndarie#.
Q E+ample ba#ed on i#olatin( di#3 controller#0
Di#3 Gro&p
Dail&re Gro&p 1 Dail&re Gro&p 2
Controller 1 Controller 2
AS- 8ailure Groups
Aithin a disk grou'? disks may e collected into -ailure grou's/ Failure grou's are the way a
storage
or dataase administrator s'eci-ies the hardware oundaries that A$M mirroring o'erates
across/
For eDam'le? all the disks attached to a single disk controller could e s'eci-ied to e within
a
common -ailure grou'/ This would lead to -ile eDtents eing mirrored on disks connected to
se'arate
controllers/ Additionally? an administrator can con-igure A$M to chose a de-ault -ailure
grou'
'olicy/ The de-ault 'olicy is that each indi*idual disk is in its own -ailure grou'/
You can grou' disks into -ailure grou's using whate*er criteria you need/ Failure grou's can
e used
to 'rotect -rom the -ailure o- indi*idual disks? disk controllers? (L7 network com'onents and
e*en
entire storage systems/ Ty'ically? an administrator would analyze their storage en*ironment
and
would organize -ailure grou's to mitigate against s'eci-ic -ailure scenarios/
(t is u' to the dataase or storage administrator to determine what is the est -ailure grou'
con-iguration -or their installation/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; !2
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Stripe and -irror ?7ample
7ormal red&ndanc! di#3 (ro&p )it% @ di#3# in total- #pread
acro## t)o 'ail&re (ro&p#.
Di#3 Gro&p
Dail&re Gro&p 1 Dail&re Gro&p 2
!
+
. 1
0
Di#3 Di#3 C
Di#3 C Di#3 D
Di#3 E Di#3 D
Di#3 G Di#3 9
1 !
.
+
0
Secondar!
E+tent
2rimar!
E+tent
Stripe and -irror ?7ample
The diagram on this 'age illustrates and eDam'le showing stri'ing and mirroring in a normal
redundancy disk grou'/ The red locks re'resent a -ile with -i*e eDtents eing stri'ed across
-i*e o-
the eight disks in the disk grou'/ The lue locks re'resent mirrored co'ies o- the -ileNs
eDtents/ &ote
that regardless o- the distriution o- eDtents across the *arious disks and -ailure grou's? each
eDtent
has eDactly one co'y in each -ailure grou'/
Ahen a -ile is allocated? the 'rimary eDtents are allocated -or 'er-ormance and the secondary
co'ies
are allocated -or integrity/ For this reason all dataase reads are made against the 'rimary
eDtents y
de-ault/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; !3
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
8ailure ?7ample
I' di#3 9 'ail#- t%en t%e e+tent# it contained are re5created on
#&r1i1in( di#3# 'rom #&r1i1in( mirror#.
Di#3 Gro&p
Dail&re Gro&p 1 Dail&re Gro&p 2
!
+
. 1
0
Di#3 Di#3 C
Di#3 C Di#3 D
Di#3 E Di#3 D
Di#3 G Di#3 9
1 !
.
+
0 0
Copy +
Copy
8ailure ?7ample
6Dtending the eDam'le on the 're*ious 'age? imagine that disk 5 -ails and the data it
contains is no
longer accessile/ This -ailure re"uires that all the eDtents on the -ailed disk need to e
reco*ered and
co'ied to another disk/
6Dtents three and -i*e are co'ied -rom the sur*i*ing co'y to a -ree region on another disk in
the same
-ailure grou'/ (n this eDam'le? eDtent -i*e is co'ied -rom disk B to !isk F and eDtent three is
co'ied
-rom !isk C to !isk G/
The last ste' a-ter a disk -ails is that A$M dro's the -ailed disk -rom the disk grou'/
The remo*al o- a disk triggers essentially the same 'rocess? howe*er in that case the eDtents
on the
disk eing remo*ed are -irst co'ied to an a*ailale alternati*e location/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; !5
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
-anaging Disk Groups
CREATE D8!IGR/P
A0TER D8!IGR/P
AS- DRP D8!IGR/P
instance
Database
instance
-anaging Disk Groups
The main goal o- an A$M instance is to manage disk grou's and 'rotect their data/ A$M
instances
also communicate -ile layout to dataase instances/ (n this way? dataase instances can
directly
access -iles stored in disk grou's/
There are se*eral disk grou' administrati*e commands/ They all re"uire the $Y$A$M or
$Y$!BA
'ri*ilege and must e issued -rom an A$M instance/
You can add new disk grou's/ You can also modi-y eDisting disk grou's to add new disks?
remo*e
eDisting ones? and 'er-orm many other o'erations/ You can remo*e eDisting disk grou's/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; !6
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Creating and Dropping Disk Groups
,sing S9:I4lus
A 6 oraenv
RAC0E5!8D Q RorclS T )A!"
The racle base for RAC0E5<"EQ;u+D;app;oracle;product;DD6%6+;grid is
;u+D;app;oracle
A sUlplus ; A! !K!A!"
!@0GPlus$ Release DD6%6+6D6+ C Production on :ed Nul 1 %+$*,$*, %++P
Cop#right &c' DP1%J %++PJ racle6 All rights reserved6
Connected to an idle instance6
!@03 CREATE D8!IGR/P dgroupA NR"A0 RED/NDANCK
(A80GR/P controllerD D8!I
4;devices;AD4 NA"E dis7AD !8OE D%+G (RCEJ
4;devices;A%4J
(A80GR/P controller% D8!I
4;devices;-D4J
4;devices;-%4B
!@03 DRP D8!IGR/P dgroupA 8NC0/D8NG CNTENT!B
Creating and Dropping Disk Groups
Assume that A$M disk disco*ery identi-ied the -ollowing disks in the Lde* directory2 A.?
A1? B.?
and B1/ Also? assume that disks A. and A1 are on a se'arate disk controllers -rom disks B.
and B1/
The -irst eDam'le in the slide illustrates how to con-igure a disk grou' called !G)7=PA
with two
-ailure grou's2 C7&T)7%%6). and C7&T)7%%6)1/
The eDam'le also uses the de-ault redundancy attriute? &7)MA% )6!=&!A&CY? -or the
disk grou'/
You can o'tionally 'ro*ide a disk name and size -or the disk/ (- you do not su''ly this
in-ormation?
A$M creates a de-ault name and attem'ts to determine the size o- the disk/ (- the size cannot
e
determined? an error is returned/ F7)C6 indicates that a s'eci-ied disk should e added to
the
s'eci-ied disk grou' e*en though the disk is already -ormatted as a memer o- an A$M disk
grou'/
=sing the F7)C6 o'tion -or a disk that is not -ormatted as a memer o- an A$M disk grou'
returns
an error/
As shown y the second statement in the slide? you can delete a disk grou' along with all its
-iles/ To
a*oid accidental deletions? the (&C%=!(&G C7&T6&T$ o'tion must e s'eci-ied i- the
disk grou'
still contains any -iles esides internal A$M metadata/ The disk grou' must e mounted in
order -or
it to e dro''ed/ A-ter ensuring that none o- the disk grou' -iles are o'en? the grou' and all
its dri*es
are remo*ed -rom the disk grou'/ Then the header o- each disk is o*erwritten to eliminate the
A$M
-ormatting in-ormation/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; +"
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Adding Disks to Disk Groups
A0TER D8!IGR/P dgroupA ADD D8!I
4;dev;sdeD4 NA"E AEJ
4;dev;sdfD4 NA"E A,J
4;dev;sdgD4 NA"E AFJ
4;dev;sdhD4 NA"E A1B
A0TER D8!IGR/P dgroupA ADD D8!I 4;devices;AG4B
Disk %ormatting
Disk group rebalancing
Adding Disks to Disk Groups
This eDam'le shows how to add disks to a disk grou'/ You eDecute an A%T6)
!($#G)7=P A!!
!($# command to add the disks/ The -irst statement adds -our new disks to the !G)7=PA
disk
grou'/
The second statement demonstrates the interactions o- disco*ery strings/ Consider the
-ollowing
con-iguration2
Lde*icesLA. is a memer o- disk grou' !G)7=PA/
Lde*icesLA1 is a memer o- disk grou' !G)7=PA/
Lde*icesLA9 is a memer o- disk grou' !G)7=PA/
Lde*icesLA0 is a candidate disk/
The second command adds A0 to the !G)7=PA disk grou'/ (t ignores the other disks? e*en
though
they match the disco*ery string? ecause they are already 'art o- the !G)7=PA disk grou'/
The
diagram shows that? when you add a disk to a disk grou'? the A$M instance ensures that the
disk is
addressale and usale/ The disk is then -ormatted and realanced/ The realance 'rocess is
time
consuming ecause it mo*es eDtents -rom all -iles onto the new disk/
Note$ )ealancing does not lock any dataase o'erations/ The main im'act that a realance
'rocess
has is on the (L7 load on the system/ The higher the 'ower o- the realance? the more (L7
load it 'uts
on the system/ Thus less (L7 andwidth is a*ailale -or dataase (L7s/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; +1
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
-iscellaneous A0TER Commands
P 4emo1e a di#3 'rom dgrou'A0
P dd and drop a di#3 in a #in(le command0
P Cancel a di#3 drop operation0
A0TER D8!IGR/P dgroupA DRP D8!I AEB
A0TER D8!IGR/P dgroupA
DRP D8!I A,
ADD (A80GR/P controller.
D8!I 4;dev;sdiD4 NA"E APB
A0TER D8!IGR/P dgroupA /NDRP D8!I!B
-iscellaneous A0TER Commands
The -irst statement in the slide shows how to remo*e one o- the disks -rom the !G)7=PA
disk grou'/
The second statement shows how you can add and dro' a disk in a single command/ The ig
ad*antage in this case is that realancing is not started until the command com'letes/ The
third
statement shows how to cancel a disk dro' o'eration/ The =&!)7P command o'erates only
on
'ending dro's o- disksM it has no e--ect on dro's that ha*e com'leted/
The -ollowing statement realances the !G)7=PB disk grou'? i- necessary2
A%T6) !($#G)7=P dgrou'B )6BA%A&C6 P7A6) 3M
This command is generally not necessary ecause it is automatically done as disks are added?
dro''ed? or resized/ 5owe*er? it is use-ul i- you want to use the P7A6) clause to o*erride
the de-ault
s'eed de-ined y the initialization 'arameter A$MGP7A6)G%(M(T/ You can change the
'ower le*el
o- an ongoing realance o'eration y reentering the command with a new le*el/ A 'ower
le*el o-
zero causes realancing to halt until the command is either im'licitly or eD'licitly rein*oked/
The
-ollowing statement dismounts !G)7=PA2
A%T6) !($#G)7=P dgrou'A !($M7=&TM
The M7=&T and !($M7=&T o'tions allow you to make one or more disk grou's a*ailale
or
una*ailale to the dataase instances/ The aility to manually unmount and mount is use-ul
in a
clustered A$M en*ironment su''orting a single instance? when that instance is -ailed o*er to
a
di--erent node/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; +!
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- -anagement ,sing ?nterprise -anager
AS- -anagement ,sing ?nterprise -anager
7racle 6nter'rise Manager B6M@ is 7racleNs -amily o- management tools s'anning dataase?
middleware? a''lications? networks? (T in-rastructure and more/ 6nter'rise Manager deli*ers
a
rowser ased en*ironment that 'ro*ides a 'oint and click alternati*e -or common A$M
administration tasks/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; ++
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- Disk Group Compatibility
P Compatibilit! o' eac% di#3 (ro&p i# #eparatel! controllable0
Q S8 compatibilit! control# S8 metadata on5di#3 #tr&ct&re
Q 4DC8S compatibilit! control# minim&m con#&mer client
le1el
Q D68 compatibilit! determine# )%et%er a di#3 (ro&p can
contain Oracle S8 1ol&me#
P Settin( di#3 (ro&p compatibilit! i# irre1er#ible.
D/
instance
C"PAT8-0E C"PAT8-0E6RD-"!
AS- disk
group
JC KC
C"PAT8-0E6A!"
AS-
instance
KC C"PAT8-0E
C"PAT8-0E6AD="
JC
AS- Disk Group Compatibility
There are three kinds o- com'atiility a''licale to A$M disk grou'sM dealing with the
'ersistent
data structures that descrie a disk grou'? the ca'ailities o- the clients Bconsumers o- disk
grou's@?
and the aility to contain *olumes in a disk grou'/ These attriutes are called A*"
compati.ility ?
R9:"* compati.ility? and A9>" compati.ility res'ecti*ely/ The com'atiility o- each disk
grou' is
inde'endently controllale/ This is re"uired to enale heterogeneous en*ironments with disk
grou's
-rom oth 7racle !ataase .<g and 7racle !ataase ..g/ These three com'atiility settings
are
attriutes o- each A$M disk grou'2
X )!BM$ com'atiility re-ers to the minimum com'atile *ersion o- the )!BM$ instance
that
would allow the instance to mount the disk grou'/ This com'atiility dictates the -ormat o-
messages that are eDchanged etween the A$M and dataase B)!BM$@ instances/ An A$M
instance has the ca'aility to su''ort di--erent )!BM$ clients running at di--erent
com'atiility settings/ The dataase com'atile *ersion setting o- each instance must e
greater
than or e"ual to the )!BM$ com'atiility o- all disk grou's used y that dataase/ !ataase
instances are ty'ically run -rom a di--erent 7racle home than the A$M instance/ This im'lies
that the dataase instance may e running a di--erent so-tware *ersion than the A$M
instance/
Ahen a dataase instance -irst connects to an A$M instance? it negotiates the highest *ersion
that they oth can su''ort/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; +.
AS- Disk Group Compatibility =continued>
The com'atiility 'arameter setting o- the dataase? so-tware *ersion o- the dataase? and the
)!BM$ com'atiility setting o- a disk grou' determine whether a dataase instance can
mount
a gi*en disk grou'/
X A$M com'atiility re-ers to the 'ersistent com'atiility setting controlling the -ormat o-
data
structures -or A$M metadata on disk/ The A$M com'atiility le*el o- a disk grou' must
always e greater than or e"ual to the )!BM$ com'atiility le*el o- the same disk grou'/
A$M com'atiility is concerned only with the -ormat o- the A$M metadata/ The -ormat o-
the
-ile contents is u' to the dataase instance/ For eDam'le? the A$M com'atiility o- a disk
grou'
can e set to ../< while its )!BM$ com'atiility could e .</./ This im'lies that the disk
grou' can e managed only y A$M so-tware whose so-tware *ersion is ../< or higher?
whereas any dataase client whose so-tware *ersion is higher than or e"ual to .</. can use
that
disk grou'/
X The A!VM com'atiility attriute determines whether the disk grou' can contain 7racle
A$M
*olumes in the disk grou'/ The *alue must e set to ../1 or higher/ Be-ore setting this
attriute?
the C7MPAT(B%6/A$M *alue must e ../1 or higher/ Also? the A!VM *olume dri*ers
must
e loaded/
The com'atiility o- a disk grou' needs to e ad*anced only when there is a change to either
'ersistent disk structures or 'rotocol messaging/ 5owe*er? ad*ancing disk grou'
com'atiility is an
irre*ersile o'eration/ You can set the disk grou' com'atiility y using either the C)6AT6
!($#G)7=P or A%T6) !($#G)7=P commands/
Note$ (n addition to the disk grou' com'atiilities? the compati.le 'arameter Bdataase
compati.le
4ersion@ determines the -eatures that are enaledM it a''lies to the dataase or A$M instance
de'ending on the instance2type 'arameter/ For eDam'le2 $etting it to .</. would 'reclude
use o- any
-eatures introduced in 7racle !ataase ..g Bdisk onlineLo--line? *ariale eDtents? and so on@/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; +0
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- Disk Group Attributes
7ame 2ropert! 6al&e# De#cription
a&U#i.e Create-
lter
.V1V0V8V.4V91V40MB Si.e o' allocation &nit# in t%e di#3 (ro&p
compatible.rdbm# Create-
lter
6alid databa#e 1er#ion Dormat o' me##a(e# e+c%an(ed bet)een DC
and S8
compatible.a#m Create-
lter
6alid S8 in#tance
1er#ion
Dormat o' S8 metadata #tr&ct&re# on di#3
compatible.ad1m Create-
lter
6alid S8 in#tance
1er#ion
llo)# Oracle S8 1ol&me# in di#3 (ro&p
di#3UrepairUtime Create-
lter
0 8 to 2=2 D Ben(t% o' time be'ore remo1in( a di#3 once
ODDBI7E
template.tname.
red&ndanc!
lter =&P)7T6CTVM())7)V5(G5 4ed&ndanc! o' #peci'ied template
template.tname.
#tripe
lter C7A)$6VF(&6 Stripin( attrib&te o' #peci'ied template
CREATE D8!IGR/P DATA% NR"A0 RED/NDANCK
D8!I 4;dev;sdaD4J4;dev;sdbD4
ATTR8-/TE 4compatible6asm4Q4DD6%4B
AS- Disk Group Attributes
Ahene*er you create or alter an A$M disk grou'? you ha*e the aility to change its attriutes
using
the new ATT)(B=T6 clause o- the C)6AT6 !($#G)7=P and A%T6) !($#G)7=P
commands/
These attriutes are rie-ly summarized in the tale gi*en in the slide2
X A$M enales the use o- di--erent allocation unit BA=@ sizes that you s'eci-y when you
create a
disk grou'/ The A= can e .? 1? 0? 8? .4? 91? or 40 MB in size/
X )!BM$ com'atiility2 $ee the slide JA$M !isk Grou' Com'atiilityK -or more
in-ormation/
X A$M com'atiility2 $ee the slide JA$M !isk Grou' Com'atiilityK -or more in-ormation/
X You can s'eci-y the !($#G)6PA()GT(M6 in units o- minute BM@? hour B5@? or day B!@/ (-
you omit the unit? then the de-ault is 5/ (- you omit this attriute? then the de-ault is 9/45/
You
can o*erride this attriute with an A%T6) !($#G)7=P /// !($# 7FF%(&6 statement/
X You can also s'eci-y the redundancy attriute o- the s'eci-ied tem'late/
X You can also s'eci-y the stri'ing attriute o- the s'eci-ied tem'late/
Note$ For each de-ined disk grou'? you can look at all de-ined attriutes through the
VOA$MGATT)(B=T6 -iDed *iew/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; +2
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
,sing ?nterprise -anager to
?dit Disk Group Attributes
,sing ?nterprise -anager to ?dit Disk Group Attributes
6nter'rise Manager 'ro*ides a sim'le way to store and retrie*e en*ironment settings related
to disk
grou's/
You can set the com'atile attriutes -rom oth the create disk grou' 'age and the edit disk
grou'
ad*anced attriutes 'age/ The diskGre'airGtime attriute is added to only edit the disk grou'
ad*anced attriutes 'age/
Note$ For 're+..g A$M instances? the de-ault A$M com'atiility and the client
com'atiility are
each .</./ For ..g A$M instances? the de-ault A$M com'atiility is ../1 and the dataase
com'atiility is .</./
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; +3
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
(etrie'ing AS- -etadata
A!"C"D3 ls Cl )DATA;orcl;datafile
T#pe Redund !triped Time !#s Name
DATA(80E "8RRR CAR!E N/0 +1 %D$++$++ K !K!TE"6%E,6,1P1.%P%D
DATA(80E "8RRR CAR!E N/0 +1 %D$++$++ K !K!A/L6%EF6,1P1.%P%.
66
!@03 !E0ECT f6t#peJ f6redundanc#J f6stripedJ f6modification5dateJ
a6s#stem5createdJ a6name (R" vAasm5alias aJ vAasm5file f :<ERE
a6file5number Q f6file5number and a6group5number Q f6group5number
and t#peQ4DATA(80E4B
TKPE RED/ND !TR8PE "D8(8CAT ! NA"E
CCCCCCCC CCCCCC CCCCCC CCCCCCCCC C CCCCCCCCCCCCCCCCCCCCC
DATA(80E "8RRR CAR!E +1CN/0C+P K !K!TE"6%E,6,1P1.%P%D
DATA(80E "8RRR CAR!E +1CN/0C+P K !K!A/L6%EF6,1P1.%P%.
66
P "#in( SEBL2l&#
P "#in( asmcmd
(etrie'ing AS- -etadata
The A$M instance hosts memory+ased metadata tales 'resented as dynamic 'er-ormance
*iews/
This data can e "ueried using $>%EPlus? asmcmd? or 6nter'rise Manager/
=sing $>%EPlus re"uires knowledge o- the $>% language and may in*ol*e ,oin multi'le
dynamic
'er-ormance *iews to retrie*e rele*ant in-ormation/ This -irst eDam'le on the slide shows a
,oin
etween *OasmG-ile and *OasmGalias to dis'lay metadata regarding the data -iles o- a
dataase/ (- this "uery is 'er-ormed against the A$M instance? it could retrie*e data -iles
-rom
multi'le dataases they way the syntaD is designed/ You would need to use additional -ilter
conditions to restrict the out'ut to a single dataase/
The asmcmd utility has the ad*antage o- eing ale to connect to the A$M instance and
retrie*e
metadata without knowledge o- the $>% language/ (t used a style similar to =niD notation/
The
second eDam'le on this slide uses asmcmd to retrie*e the same metadata as the $>% eDam'le
did/
Another ad*antage o- this eDam'le is that the out'ut is restricted to the data -iles o- a single
dataase
since the 'ath that is eing listed contains the dataase name o- orcl? and the -ile ty'e o- data
-ile/ There-ore? what a''ears as directories in asmcmd would re"uire $>% -ilter conditions
using
the A56)6 clause to gi*e the same result/
Note$ 6nter'rise Manager !ataase Control is ale to dis'lay most o- the A$M metadata y
sim'ly
na*igating among the *arious A$M we 'ages/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; +5
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
AS- 8ast -irror (esync O'er'ie1
Disk access %ailure
8ailure time K D8!I5REPA8R5T8"E
AS- redundancy is used
Disk again accessible:
Only need to resync modi%ied e7tents
1 !
. +
Oracle Database 11g
2rimar!
e+tent
Secondar!
e+tent
AS- 8ast -irror (esync O'er'ie1
A$M -ast mirror resync signi-icantly reduces the time re"uired to resynchronize a transient
-ailure o-
a disk/ Ahen a disk goes o--line -ollowing a transient -ailure? A$M tracks the eDtents that are
modi-ied during the outage/ Ahen the transient -ailure is re'aired? A$M can "uickly
resynchronize
only the A$M disk eDtents that ha*e een a--ected during the outage/
This -eature assumes that the content o- the a--ected A$M disks has not een damaged or
modi-ied/
Ahen an A$M disk 'ath -ails? the A$M disk is taken o--line ut not dro''ed i- you ha*e set
the
!($#G)6PA()GT(M6 attriute -or the corres'onding disk grou'/ The setting -or this
attriute
determines the duration o- a disk outage that A$M tolerates while still eing ale to
resynchronize
a-ter you com'lete the re'air/
Note$ The tracking mechanism uses one it -or each modi-ied allocation unit/ This ensures
that the
tracking mechanism *ery e--icient/
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Database 11g: Administration Workshop II D ; +6
Cop!ri(%t O 2009- Oracle. ll ri(%t# re#er1ed.
Summary
In t%i# le##on- !o& #%o&ld %a1e learned %o) to0
P 8ana(e t%e S8 in#tance &#in( SEBLpl&#- a#mcmd- and
Enterpri#e 8ana(er
P Create and drop S8 di#3 (ro&p#
P Speci'! S8 compatibilit! attrib&te#
P E+tend S8 di#3 (ro&p#
P Compare met%od# o' retrie1in( S8 metadata
Oracle Internal & Oracle cadem! "#e Onl!
Oracle Internal & Oracle cadem! "#e Onl!

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