Академический Документы
Профессиональный Документы
Культура Документы
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<i#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� 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< 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<iple+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<iple 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#<# 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< 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<iple 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#<# 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(#�F1F
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(#"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(#�F1F7_"'(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(#"(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(##"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(#�F1F7_"'(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(#"(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(##"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(#�F1F
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(#�F1F7_"'(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(#�F1F
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(#"(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(##"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(#"(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(#"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(##"(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(##"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
$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
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%�"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
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