les06.ppt
Transcript of les06.ppt
-
8/17/2019 les06.ppt
1/44
6Copyright © 2007, Oracle. All rights reserved.
RAC Performance Tuning
-
8/17/2019 les06.ppt
2/44
Copyright © 2007, Oracle. All rights reserved.6 - 2
Objectives
After completing this lesson, you should be able to:
• Determine RACspecific tuning components
• Tune instance recovery in RAC
• Determine RACspecific !ait events, global en"ueues,and system statistics
• #mplement the most common RAC tuning tips
• $se the Cluster Database Performance pages
• $se the Automatic %or&load Repository 'A%R( in RAC
• $se Automatic Database Diagnostic )onitor 'ADD)( inRAC
-
8/17/2019 les06.ppt
3/44
Copyright © 2007, Oracle. All rights reserved.6 - 3
CP$ and %ait Time Tuning Dimensions
*calableapplication
*calableapplication
Possiblyneeds *+
tuning
-eedsinstance.RAC
tuning
CP$time
%aittime
-o gain achievedby adding
CP$s.nodes
-
8/17/2019 les06.ppt
4/44
Copyright © 2007, Oracle. All rights reserved.6 - 4
RAC*pecific Tuning
• Tune for a single instance first/
• Tune for RAC:
– #nstance recovery
– #nterconnect traffic
– Point of seriali0ation can be e1acerbated
• RACreactive tuning tools:
– *pecific !ait events
– *ystem and en"ueue statistics
– 2nterprise )anager performance pages – *tatspac& and A%R reports
• RACproactive tuning tools: – A%R snapshots
– ADD) reports
Certain combinationsare characteristic of
!ell&no!n tuning cases/
-
8/17/2019 les06.ppt
5/44
Copyright © 2007, Oracle. All rights reserved.6 -
RAC and #nstance or Crash Recovery
Recovery time
*)O-recovers
thedatabase
Remaster en"ueue
resources Remaster cache
resources
3uildrecovery set
)*recovers
4RD
)erge failedredo threads
5
6
7
8
Resource
claim9 Roll for!ard
recovery set
$se informationfor other caches
-
8/17/2019 les06.ppt
6/44
Copyright © 2007, Oracle. All rights reserved.6 - 7
#nstance Recovery and Database Availability
2lapsed time
D a t a b a s e a v a
i l a b i l i t y
-one
Partial
ull A
3
C D 2
4 ;
5 6 7
9
8
6
-
8/17/2019 les06.ppt
7/44Copyright © 2007, Oracle. All rights reserved.6 - !
#nstance Recovery and RAC
#nstancecrashes
#nstancestarts
#nstanceopens
#nstance startup<
crash recovery
A*T=*TART=)TTR=TAR42T
#nstancecrashes
#nstancerecovery
starts
Rollingfor!ard
ends#nstancerecovery
>first pass < loc& claim
A*T=*TART=)TTR=TAR42T
?@#-*TA-C2=R2CO?2R/2*TD=C$*T2R=A?A#A32=T#)2
-
8/17/2019 les06.ppt
8/44Copyright © 2007, Oracle. All rights reserved.6 - "
#nstance Recovery and RAC
• $se parallel instance recovery/
• #ncrease PARALLEL_EXECUTION_MESSAGE_SIZE/
• *et PARALLEL_MIN_SERVERS/
•$se Async #.O/• #ncrease the si0e of the default buffer cache/
-
8/17/2019 les06.ppt
9/44Copyright © 2007, Oracle. All rights reserved.6 - #0
Analy0ing Cache usion #mpact in RAC
• The cost of bloc& access and cache coherency isrepresented by:
– 4lobal Cache *ervices statistics
– 4lobal Cache *ervices !ait events
• The response time for Cache usion transfers isdetermined by:
– Overhead of the physical interconnect components
– #PC protocol
– 4C* protocol• The response time is not generally affected by dis& #.O
factors/
-
8/17/2019 les06.ppt
10/44Copyright © 2007, Oracle. All rights reserved.6 - ##
Typical atencies for RAC Operations
A%R Report atency -ame o!er3ound
Typical $pper3ound
Average time to process cr bloc& re"uest B/5 5 5B
Avg global cache cr block receive tie !"# B/7 9 56
Average time to process current bloc& re"uest B/5 7 67
Avg global cache c$rre%t block receive tie!"# B/7 7B
-
8/17/2019 les06.ppt
11/44Copyright © 2007, Oracle. All rights reserved.6 - #2
%ait 2vents for RAC
• %ait events help to analy0e !hat sessions are !aitingfor/
• %ait times are attributed to events that reflect theoutcome of a re"uest:
– Placeholders !hile !aiting
– Precise events after !aiting
• 4lobal cache !aits are summari0ed in a broadercategory called Cluster %ait Class/
• These !ait events are used in ADD) to enable Cacheusion diagnostics/
-
8/17/2019 les06.ppt
12/44Copyright © 2007, Oracle. All rights reserved.6 - #3
%ait 2vent ?ie!s
V&ACTIVE_SESSION_'ISTOR(
V&SESSION_EVENT
V&S(STEM_EVENT
V&SESSION_)AIT_'ISTOR(
%aits for an event by a session
ast 5B !ait eventsfor each active session
Activity of recent active sessions
Total !aits for an event
V&SESSION_)AIT2vents for !hich
active sessions are !aiting
V&SESSION_)AIT_CLASS%aits for a !ait event classby a session
V&S*LSTATS#dentify *+ statements impactedby interconnect latencies
-
8/17/2019 les06.ppt
13/44Copyright © 2007, Oracle. All rights reserved.6 - #4
4lobal Cache %ait 2vents: Overvie!
gc current.crE multibloc&E re"uest
gc current.crE 6.7E!ay gc current.crE bloc& busy
Fust re"uested'placeholder(
Received after t!o or three net!or&
hops, immediately after re"uest
Received but not sent immediately
gc current.crE grant 6!ay
-ot received and not masteredlocally/ 4rant received immediately/
gc current grant busy
-ot received and not masteredlocally/ 4rant received !ith delay/
gc current.crE bloc&.grantE congested
3loc& or grant received !ith delaybecause of CP$ or memory lac&
gc current.crE failure.retryE
-ot received because of failure
gc buffer busy
3loc& arrival timeless than buffer pin time
-
8/17/2019 les06.ppt
14/44Copyright © 2007, Oracle. All rights reserved.6 - #6
+,-a. 3loc& Re"uest: 21ample
SGA/
SGA+
4%R4%R:
og sync
%ait complete:gc c$rre%t block +,-a.
%ait:gc c$rre%t block re1$e"t
Direct send
3loc& transfer
5
6
7
4P
)*
-
8/17/2019 les06.ppt
15/44Copyright © 2007, Oracle. All rights reserved.6 - #7
2,-a. 3loc& Re"uest: 21ample
SGA/
SGA+
4%R
)*
4P
%ait complete:gc c$rre%t block 2,-a.
%ait:gc c$rre%t block re1$e"t
Directmessage
3loc& transfer
)*Resource
)aster
5 6
7
9
-
8/17/2019 les06.ppt
16/44Copyright © 2007, Oracle. All rights reserved.6 - #!
+,-a. 4rant: 21ample
SGA/
SGA+
4P
%ait complete:gc c$rre%t gra%t +,-a.
%ait:gc c$rre%t block re1$e"t
Directmessage
4rant message
)*Resource
)aster
5
6
7
-
8/17/2019 les06.ppt
17/44Copyright © 2007, Oracle. All rights reserved.6 - #"
4lobal 2n"ueue %aits: Overvie!
• 2n"ueues are synchronous/
• 2n"ueues are global resources in RAC/
• The most fre"uent !aits are for:
• The !aits may constitute serious seriali0ation points/
TG T)
;%
*+
$*
TA
-
8/17/2019 les06.ppt
18/44Copyright © 2007, Oracle. All rights reserved.6 - 20
*ession and *ystem *tatistics
• $se V&S(SSTAT to characteri0e the !or&load/
• $se V&SESSTAT to monitor important sessions/
• V&SEGMENT_STATISTICS includes RAC statistics/
• RACrelevant statistic groups are:
– 4lobal Cache *ervice statistics
– 4lobal 2n"ueue *ervice statistics
– *tatistics for messages sent
• V&EN*UEUE_STATISTICS determines the en"ueue !ith
the highest impact/• V&INSTANCE_CAC'E_TRANS3ER brea&s do!n 4C*
statistics into bloc& classes/
-
8/17/2019 les06.ppt
19/44Copyright © 2007, Oracle. All rights reserved.6 - 2#
)ost Common RAC Tuning Tips
• Application tuning is often the most beneficial/
• Resi0ing and tuning the buffer cache
• Reducing long fulltable scans in OTP systems
• $sing Automatic *egment *pace )anagement
• #ncreasing se"uence caches
• $sing partitioning to reduce interinstance traffic
• Avoiding unnecessary parsing
• )inimi0ing loc&ing usage
• Removing unselective inde1es
• Configuring interconnect properly
-
8/17/2019 les06.ppt
20/44Copyright © 2007, Oracle. All rights reserved.6 - 23
#nde1 3loc& Contention: Considerations
RACB5 RACB6
#nde1bloc&
*plit inprogress
%ait events
e%14 TX , i%5e6co%te%tio%
gc b$77er b$".
gc c$rre%t block
b$".
gc c$rre%t "8lit
*ystem statistics
Lea7 %o5e "8lit"
9ra%ch %o5e "8lit" E6cha%ge 5ea5lock"
gc" re7$"e 6i5
gc" a"t 6i5
Service ITL -ait"
-
8/17/2019 les06.ppt
21/44Copyright © 2007, Oracle. All rights reserved.6 - 24
Oracle *e"uences and #nde1 Contention
Can contain 8BB ro!s
5>8BBBB 8BBB5>5BBBBB
CAC'E :;;;; NOOR
RACB5 RACB6
-
8/17/2019 les06.ppt
22/44Copyright © 2007, Oracle. All rights reserved.6 - 2
$ndo 3loc& Considerations
*4A6*4A5
>
ChangesReads
#nde1
Additionalinterconnect traffic
$ndo $ndo
-
8/17/2019 les06.ppt
23/44Copyright © 2007, Oracle. All rights reserved.6 - 26
;igh%ater )ar& Considerations
;%)
;eavyinserts
;eavyinserts
-e! e1tent
%ait events
e%14 ') ,co%te%tio%
gc c$rre%t gra%t
RACB5 RACB6
-
8/17/2019 les06.ppt
24/44Copyright © 2007, Oracle. All rights reserved.6 - 27
Concurrent Cross#nstance Calls: Considerations
*4A5 *4A6
CHPT
Table5
Table6
Table5
Table6
Dirtybloc&
CHPT
Truncate Table5 Truncate Table6
Crossinstance call
5
67 9
-
8/17/2019 les06.ppt
25/44Copyright © 2007, Oracle. All rights reserved.6 - 2!
)onitoring RAC Databaseand Cluster Performance
Directly from Database Control and 4rid Control:
• *tatus of each node in the cluster
• Aggregated alert messages across all the instances
• Revie! issues that are affecting the entire cluster oreach instance
• )onitor cluster cache coherency statistics
• Determine if any of the services for the cluster databaseare having availability problems
• Revie! any outstanding Cluster!are interconnect alerts
Database
#nstances
-
8/17/2019 les06.ppt
26/44
Copyright © 2007, Oracle. All rights reserved.6 - 2"
Cluster Database Performance Page
-
8/17/2019 les06.ppt
27/44
Copyright © 2007, Oracle. All rights reserved.6 - 30
Determining Cluster ;ost oad Average
-
8/17/2019 les06.ppt
28/44
Copyright © 2007, Oracle. All rights reserved.6 - 3#
Determining 4lobal Cache 3loc& Access atency
-
8/17/2019 les06.ppt
29/44
Copyright © 2007, Oracle. All rights reserved.6 - 32
Determining Average Active *essions
-
8/17/2019 les06.ppt
30/44
Copyright © 2007, Oracle. All rights reserved.6 - 33
Determining Database Throughput
-
8/17/2019 les06.ppt
31/44
Copyright © 2007, Oracle. All rights reserved.6 - 34
Determining Database Throughput
-
8/17/2019 les06.ppt
32/44
Copyright © 2007, Oracle. All rights reserved.6 - 3
Accessing the Cluster Cache Coherency Page
3loc&Class
*egmentname
*egmentname
-
8/17/2019 les06.ppt
33/44
Copyright © 2007, Oracle. All rights reserved.6 - 36
Accessing the Cluster Cache Coherency Page
-
8/17/2019 les06.ppt
34/44
Copyright © 2007, Oracle. All rights reserved.6 - 37
?ie!ing Cluster #nterconnects Page
-
8/17/2019 les06.ppt
35/44
Copyright © 2007, Oracle. All rights reserved.6 - 3!
-
8/17/2019 les06.ppt
36/44
Copyright © 2007, Oracle. All rights reserved.6 - 3"
?ie!ing the Database oc&s Page
-
8/17/2019 les06.ppt
37/44
Copyright © 2007, Oracle. All rights reserved.6 - 40
A%R *napshots in RAC
**A$G
*4A '#nstn(
#nmemory
statistics
I:BB a/m/
J:BB a/m/
:BB a/m/
K:BB a/m/
K:BB a/m/
*4A '#nst5(
#nmemorystatistics
>
MMON Coor5i%ator
MMON
A%R tables
-
8/17/2019 les06.ppt
38/44
Copyright © 2007, Oracle. All rights reserved.6 - 4#
A%R Reports and RAC: Overvie!
-
8/17/2019 les06.ppt
39/44
Copyright © 2007, Oracle. All rights reserved.6 - 43
Automatic Database Diagnostic )onitor for RAC
Database ADD)
A%R
#nstance ADD)
*elfdiagnostic engine
#nst5 #nstn
…
-
8/17/2019 les06.ppt
40/44
Copyright © 2007, Oracle. All rights reserved.6 - 44
• #dentifies the most critical performance problems forthe entire RAC cluster database
• Runs automatically !hen ta&ing A%R snapshots
• Performs database!ide analysis of:
– 4lobal resources 'for e1ample #.O and global loc&s(
– ;ighload *+ and hot bloc&s
– 4lobal cache interconnect traffic
– -et!or& latency issues
– *&e! in instance response times• #s used by D3As to analy0e cluster performance
• 2liminates need to investigate n reports to spotcommon problems
Automatic Database Diagnostic )onitor for RAC
-
8/17/2019 les06.ppt
41/44
Copyright © 2007, Oracle. All rights reserved.6 - 4
%hat Does ADD) Diagnose for RACL
• atency problems in interconnect
• Congestion 'identifying top instances affecting theentire cluster(
• Contention 'buffer busy, top objects etc/(
• Top consumers of multibloc& re"uests
• ost bloc&s
• #nformation about interconnect devices '!arns aboutusing P$3#C interfaces(
• Throughput of devices: ;o! much of it is used byOracle and for !hat purpose '4C, loc&s, P+(
-
8/17/2019 les06.ppt
42/44
Copyright © 2007, Oracle. All rights reserved.6 - 46
2) *upport for ADD) for RAC
-
8/17/2019 les06.ppt
43/44
Copyright © 2007, Oracle. All rights reserved.6 - 47
*ummary
#n this lesson, you should have learned ho! to:
• Determine RACspecific tuning components
• Tune instance recovery in RAC
• Determine RACspecific !ait events, global en"ueues,and system statistics
• #mplement the most common RAC tuning tips
• $se the Cluster Database Performance pages
• $se the Automatic %or&load Repository in RAC
• $se Automatic Database Diagnostic )onitor in RAC
-
8/17/2019 les06.ppt
44/44
Practice I: Overvie!
This practice covers studying a scalability case by usingthe ADD)/