Professional Documents
Culture Documents
Oracle RAC SIG 2004: Performance Monitoring & Tuning For RAC
Oracle RAC SIG 2004: Performance Monitoring & Tuning For RAC
Audience Knowledge
Goals
Overview of RAC & RAC Tuning
Target RAC tips that are most useful
Non-Goals
Learn ALL aspects of RAC
A TUSC Presentation
Overview
RAC Overview
Tuning the RAC Cluster Interconnect
Monitoring the RAC Workload
Monitoring RAC specific contention
Whats new in 10g
Summary
A TUSC Presentation
Server 1
Instance A
Server 2
Instance A
Database
A
SERVER failure
Protect- your
from database
SERVER failures
remains available
A TUSC Presentation
84%
Scalability
7,000
6,000
6,496
5,433
5,000
# Users
4,000
4,368*
3,000
2,296*
2,000
1,000
1,288
0
1 Node
Running on HP Computers
A TUSC Presentation
A TUSC Presentation
A TUSC Presentation
10
buffer busy global cache A wait event that is signaled when a process has
to wait for a block to become available because
another process is obtaining a resource for this
block.
11
How:
1) Query V$SESSION_WAIT to determine whether
or not any sessions are experiencing RAC related
waits.
2) Identify the objects that are causing contention for
these sessions.
3) Modify the object to reduce contention.
A TUSC Presentation
12
1)
A TUSC Presentation
13
The output from this query should look something like this:
The block number and file number
will indicate the object the
requesting instance is waiting for.
INST_ID
------1
2
EVENT
FILE_NUMBER BLOCK_NUMBER WAIT_TIME
----------------------------------- ----------- ------------ ---------global cache busy
9
150
15
global cache busy
9
150
10
A TUSC Presentation
14
2)
A TUSC Presentation
15
A TUSC Presentation
16
A TUSC Presentation
17
18
FROM
WHERE
AND
AND
INST_ID
RECEIVED RECEIVE TIME AVG RECEIVE TIME (ms)
------- ---------- ------------ --------------------1
2791
3287
11.8
2
3760
7482
19.9
A TUSC Presentation
19
Problem Indicators:
High Transfer Time
One node showing excessive transfer time
A TUSC Presentation
20
21
Result:
Instance 1 is on a
faster node and serves
blocks faster.
A TUSC Presentation
23
24
25
netstat l
netstat s
sar c
sar q
vmstat
A TUSC Presentation
26
27
A TUSC Presentation
28
A TUSC Presentation
29
652
Instance 2 is
experiencing some lost
blocks.
A TUSC Presentation
30
A TUSC Presentation
31
32
33
FROM
WHERE
AND
AND
INST_ID
RECEIVED RECEIVE TIME AVG RECEIVE TIME (ms)
------ ---------- ------------ --------------------1
22694
68999
30.4
2
23931
42090
17.6
A TUSC Presentation
34
global cache block flush The time it takes to flush the changes to a block to
disk (forced log flush), before the block is shipped
time
to the requesting instance.
35
A TUSC Presentation
36
Instance 2 requires
38% more time to
service current blocks
than Instance 1.
A TUSC Presentation
37
38
39
Instance Avg Cache Conv. Time Avg Cache Get Time GC Convert Timeouts
--------- -------------------- ------------------ ------------------1
1.85812072
.981296356
0
2
1.65947528
.627444273
0
A TUSC Presentation
40
A TUSC Presentation
41
GCS contention
System contention or
congestion. Could indicate
serious performance problems.
A TUSC Presentation
42
43
Event:
global cache open s
global cache open x
Description:
A session has to wait for receiving permission for
shared(s) or exclusive(x) access to the requested
resource
Wait duration should be short.
Wait followed by a read from disk.
Blocks requested are not cached in any instance.
Action:
Not much can be done
When associated with high totals or high per-transaction wait time, data
blocks are not cached.
Will cause sub-optimal buffer cache hit ratios
Consider preloading heavily used tables
A TUSC Presentation
44
Event:
global cache null to s
global cache null to x
Description:
Happens when two instances exchange the
same block back and forth over the network.
These events will consume a greater
proportion of total wait time if one instance
requests cached data blocks from other
instances.
Action:
Reduce the number of rows per block to eliminate the need for block
swapping between instances.
A TUSC Presentation
45
Event:
global cache cr request
Description:
Happens when an instance requests a CR
data block and the block to be transferred
hasnt arrived at the requesting instance.
Action:
Examine the cluster interconnects for possible problems.
Modify objects to reduce possibility of contention.
A TUSC Presentation
46
Global cache waits constitute a large proportion of the wait time listed
on the first page of your STATSPACK report.
AND
47
A TUSC Presentation
48
A TUSC Presentation
49
System Load
If processes are queuing for the CPU, raise the priority
of the GCS processes (LMSn) to have priority over other
processes to lower GCS times.
Reduce the load on the server by reducing the number
of processes on the database server.
Increase capacity by adding CPUs to the server
Add nodes to the cluster database
A TUSC Presentation
50
Network issues
OS logs and OS stats will indicate if a network link is
congested.
Ensure packets are being routed through the private
interconnect, not the public network.
A TUSC Presentation
51
A TUSC Presentation
52
53
A TUSC Presentation
54
Instance: INST1
3.1
3.2
0.2
0.0
1.0
1.3
17.2
0.2
0.0
0.9
1.1
3.1
1.7
0.0
1.4
1.1
8.7
0.6
1.0
Snaps: 25 -26
8.2
16.5
1.5
6.0
0.9
8.5
18.3
13.7
3.9
0.8
18.4
17.4
2.5
0.2
2.2
1.6
2.9
0.5
0.0
55
Global Enqueue Services (GES) control the interinstance locks in Oracle 9i RAC.
The STATSPACK report contains a special section
for these statistics.
Global Enqueue Service Statistics
--------------------------------Ave global lock get time (ms):
Ave global lock convert time (ms):
Ratio of global lock gets vs global lock releases:
A TUSC Presentation
0.9
1.3
1.1
56
57
A TUSC Presentation
1.8
2.6
1.2
1.2
0.2
58.4
4.9
36.7
58
Instance: INST2
Snaps: 25 -26
Statistic
Total
per Second
per Trans
--------------------------------- ---------------- ------------ -----------dynamically allocated gcs resource
0
0.0
0.0
dynamically allocated gcs shadows
0
0.0
0.0
flow control messages received
0
0.0
0.0
flow control messages sent
0
0.0
0.0
gcs ast xid
0
0.0
0.0
gcs blocked converts
904
2.1
150.7
gcs blocked cr converts
1,284
2.9
214.0
gcs compatible basts
0
0.0
0.0
gcs compatible cr basts (global)
0
0.0
0.0
gcs compatible cr basts (local)
75
0.2
12.5
:
:
A TUSC Presentation
59
Statistic:
gcs blocked converts
gcs blocked cr converts
Description:
Instance requested a block from another
instance and was unable to obtain the
conversion of the block.
Indicates users on different instances need
to access the same blocks.
Action:
Prevent users on different instances from needing access to the same blocks.
Ensure sufficient freelists (not an issue if using automated freelists)
Reduce block contention through freelists, initrans.
Limit rows per block.
A TUSC Presentation
60
Event
Waits
Timeouts
Time (s)
(ms)
/txn
---------------------------- ------------ ---------- ---------- ------ -------global cache cr request
820
113
154
188
136.7
global cache null to x
478
1
1
2
79.7
control file sequential read
600
0
1
2
100.0
control file parallel write
141
0
1
4
23.5
enqueue
29
0
1
18
4.8
library cache lock
215
0
0
2
35.8
db file sequential read
28
0
0
7
4.7
LGWR wait for redo copy
31
16
0
4
5.2
:
:
A TUSC Presentation
:
61
The Library Cache Activity report shows statistics regarding the GES.
Watch for GES Invalid Requests and GES Invalidations.
Could indicate insufficient sizing of the shared pool resulting in GES
contention.
Library Cache Activity for DB: DB2
->"Pct Misses" should be very low
Instance: INST2
Snaps: 25 -26
GES Lock
GES Pin
GES Pin
GES Inval GES InvaliNamespace
Requests
Requests
Releases
Requests
dations
--------------- ------------ ------------ ------------ ----------- ----------BODY
1
0
0
0
0
CLUSTER
4
0
0
0
0
INDEX
84
0
0
0
0
SQL AREA
0
0
0
0
0
TABLE/PROCEDURE
617
192
0
77
0
TRIGGER
0
0
0
0
0
A TUSC Presentation
62
A TUSC Presentation
63
A TUSC Presentation
64
A TUSC Presentation
65
66
67
To find the blocks involved in busy waits, query the columns NAME,
KIND, FORCED_READS, FORCED_WRITES.
Select INST_ID "Instance", name, kind,
sum(forced_reads) "Forced Reads",
sum(forced_writes) "Forced Writes"
FROM gv$cache_transfer
WHERE owner# != 0
GROUP BY inst_id, name, kind
ORDER BY 1,4 desc,2;
Instance NAME
KIND
Forced Reads Forced Writes
--------- -------------------- ---------- ------------ ------------1 MOD_TEST_IND
INDEX
308
0
1 TEST2
TABLE
64
0
1 AQ$_QUEUE_TABLES
TABLE
5
0
2 TEST2
TABLE
473
0
2 MOD_TEST_IND
INDEX
221
0
A TUSC Presentation
68
69
70
71
A TUSC Presentation
72
A TUSC Presentation
73
V$CACHE_TRANSFER
V$FILE_CACHE_TRANSFER
V$TEMP_CACHE_TRANSFER
74
A TUSC Presentation
V$CACHE_TRANSFER
FILE#
BLOCK#
CLASS#
STATUS
XNC
FORCED_READS
FORCED_WRITES
NAME
PARTITION_NAME
KIND
OWNER#
GC_ELEMENT_ADDR
GC_ELEMENT_NAME
NUMBER
NUMBER
NUMBER
VARCHAR2(5)
NUMBER
NUMBER
NUMBER
VARCHAR2(30)
VARCHAR2(30)
VARCHAR2(15)
NUMBER
RAW(4)
NUMBER
75
V$FILE_CACHE_TRANSFER
FILE_NUMBER shows the file
numbers of datafiles that are source of
blocks transferred.
Use this view to show the block
transfers per file.
A TUSC Presentation
FILE_NUMBER
X_2_NULL
X_2_NULL_FORCED_WRITE
X_2_NULL_FORCED_STALE
X_2_S
X_2_S_FORCED_WRITE
S_2_NULL
S_2_NULL_FORCED_STALE
RBR
RBR_FORCED_WRITE
RBR_FORCED_STALE
NULL_2_X
S_2_X
NULL_2_S
CR_TRANSFERS
CUR_TRANSFERS
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
76
A TUSC Presentation
77
A TUSC Presentation
GV$ENQUEUE_STAT
INST_ID
EQ_TYPE
TOTAL_REQ#
TOTAL_WAIT
SUCC_REQ#
FAILED_REQ#
CUM_WAIT_TIME
NUMBER
VARCHAR2(2)
NUMBER
NUMBER
NUMBER
NUMBER
NUMBER
78
79
80
Enterprise Manager 9i
A TUSC Presentation
81
Enterprise Manager 9i
A TUSC Presentation
82
A TUSC Presentation
% Total
Ela Time
-------52.26
19.60
11.03
4.96
3.83
83
Latch Free
Enqueue - ST
Enqueue - HW
Potential Fix
Data Block (cont.) Increase initrans
and/or maxtrans
Undo Header Add rollback segments
or areas
Undo block Commit more (not too
much) Larger rollback segments/areas.
Investigate the detail (Covered later)
Use LMTs or pre-allocate large extents
Pre-allocate extents above high water
mark A TUSC Presentation
85
Potential Fix
Increase initrans and/or maxtrans on
the table or index
Index foreign keys; Check application
locking of tables
Increase the Log Buffer; Faster disks
for the Redo Logs
Archive destination slow or full; Add
more or larger Redo Logs
Commit more records at a time; Faster
Redo Log
disks; Raw devices
A TUSC Presentation
86
Potential Fix
Use bind variables; adjust the
shared_pool_size
Use bind variables; adjust the
shared_pool_size
Increase the Shared Pool
Minimize redo generation and
avoid unnecessary commits
Increase the
_log_simultaneous_copies
A TUSC Presentation
87
Locally Managed
Tablespaces- LMT
Manage space locally using bitmaps
Benefits
no tablespace fragmentation issues
better performance handling on large segments
lower contention for central resources, e.g., no ST
enqueue contention
fewer recursive calls
Implementation
specify EXTENT MANAGEMENT LOCAL clause
during tablespace creation
in-place migration
A TUSC Presentation
88
Implementation
specify SEGMENT SPACE MANAGEMENT AUTO
A TUSC Presentation
89
clause during tablespace
creation
Host and
Hardware
Network and
Load Balancer
Database
Oracle9iAS
Administration
Monitoring
Provisioning
Security
Applications
Enterprise
Manager
Storage
A TUSC Presentation
90
EM 9i
EM 10g
Oracle Database
Oracle9iAS
Application Performance
Management
Operating System
Storage
Hardware
Admin and
Monitoring
Enterprise Configuration
Management
Network
A TUSC Presentation
Rapid installation
Deployment
Provisioning
Upgrade
Automated patching
91
OCS
IMAP, SMTP End-2-end service
monitoring
Files End-2-end service
monitoring
Files document analysis: count,
size, format
Files user analysis: number,
quota consumed
Host/Host Clusters
Top processes identification
DB
RAC
Cluster cache coherency
monitoring
Failover events
Discovery of RAC topology
Startup/shutdown
Relocate services
Failover jobs
A TUSC Presentation
ASM
Disk group admin (rebalance)
Startup/Shutdown
Disk group usage/status
I/O performance
92
Add/Remove disks
Target
Alerts
A TUSC Presentation
93
View it Wireless
Target
Alerts
A TUSC Presentation
94
Internet
Application
Developer
Applications
System
Administrator
Application Server
Data Center
Support
Database
OS
Storage
Network Service
DBA
Network
Provider
A TUSC Presentation
95
96
Web
App.
Alerts
A TUSC Presentation
97
Choose a Host
Select
Targets
tab
Pick a
Host
A TUSC Presentation
98
Choose
App.
Server
App
Server
Response
Time &
Info.
A TUSC Presentation
99
Web
Cache
Hits
A TUSC Presentation
100
A TUSC Presentation
101
Click
Alert
for this
A TUSC Presentation
102
A TUSC Presentation
103
A TUSC Presentation
104
JSP
EJB
JDBC
internet
Middle Tier
A TUSC Presentation
105
Splits
Time
into
Parts
A TUSC Presentation
106
Host Performance
Each
Piece of
the Web
App.
Choose
the Host
A TUSC Presentation
107
Host Performance
I/O
Memory
CPU
A TUSC Presentation
108
Host Performance
Hardware
O/S
Software
A TUSC Presentation
109
Host Performance
Side by
Side
Compare
A TUSC Presentation
110
Managing Groups
Managed from a single-view
Applications
Sets of Systems
Membership-based
inheritance
A TUSC Presentation
111
Host/Host Clusters
Add/Remove node from OS
cluster
ASM
iAS
DB
Analyze
Backup
Export
Startup/Shutdown
Configuration Advise
Clone, Patch
RAC
OCS
Custom grouping
Home pages for EMAIL and IM
WebApp
End-2-End availability
End-2-End monitoring
End-2-End tracing
112
Database Performance
Create a
Prod DBs
Group
Pick
Items for
the Group
A TUSC Presentation
113
Database Performance
View the
Prod DBs
Group
Check
Alerts &
Policy
Issues
A TUSC Presentation
114
Database Performance
Alert
History
Waits
Advice
Click
Here for
Issues
A TUSC Presentation
115
Database Performance
Alert
Issues
Major
Waits
A TUSC Presentation
116
Database Performance
Fix
Critical
A TUSC Presentation
117
Oracle Standardization
Policy Management
Rule definitions
Violation detection
Corrective action
Policy
Security policies
Software installation
hardening
Excess services/ports
Excess user privileges
Configuration policies
Best practices
Base images
Performance polices
Thresholds
A TUSC Presentation
118
9. Segment with Extent Growth Policy Violation 19. Non-uniform Default Extent Size
10.Tablespace Containing Mixed Segment Types
A TUSC Presentation
119
Security alerts
Critical patches
Host
1.
2.
Application Server
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
Database Services
1.
2.
3.
4.
5.
6.
Database Performance
Monitor
Database
We have a
CPU
issue!
A TUSC Presentation
121
Database Performance
Monitor
Perform.
We have a
Concurr.
issue!
A TUSC Presentation
122
Database Performance
Monitor
for a
period of
time
Check the
Top SQL
A TUSC Presentation
123
Database Performance
Drill
down to
show the
Top SQL
Target
Alerts
A TUSC Presentation
124
Database Performance
Top SQL
Check
Execution
History or
Other
Options
A TUSC Presentation
125
126
A TUSC Presentation
127
Finding
Details
Suggests!
A TUSC Presentation
128
ADDM
DBA
High-Load
SQL
SQL
Workload
SQL Tuning
Advisor
A TUSC Presentation
129
ADDMs Architecture
Snapshots in
Automatic Workload
Repository
AutomaticDiagnostic
DiagnosticEngine
Engine
Automatic
High-load
SQL
IO / CPU
issues
SQL
Advisor
System
Sizing
Advice
RAC issues
Network +
DB config
Advice
A TUSC Presentation
130
Base statistics
SQL statistics
Metrics
ACTIVE SESSION HISTORY
131
SQL Tuning
Recommendations
SQL Tuning
Advisor
SQL
Profiling
Gather Missing or
Stale Statistics
Create a SQL
Profile
DBA
Access Path
Analysis
Add Missing
Indexes
SQL Structure
Analysis
Modify SQL
Constructs
A TUSC Presentation
132
Drill into
Top SQL
for worst
time
period
Get Help!
A TUSC Presentation
134
Tuning
Sets
Tune the
Top SQL
set.
A TUSC Presentation
135
SQL
Tuning
Sets Info
How long
to work
on this
A TUSC Presentation
136
Tuning
Results
for this
job
Suggests
using a
profile
For this
SQL
A TUSC Presentation
137
Detailed
info
Improve
Factor and
click to
Use
A TUSC Presentation
138
Confirmed
to use
suggestion
Detail
A TUSC Presentation
139
internet
Web Application
A TUSC Presentation
141
Transaction Monitoring
Recorder
Rapid deployment and immediate value
Simple, automatic, no scripting
Beacons automatically synchronized to play
transactions at specific intervals
Download
Recorder
(once)
Start recorder
which opens
new browser
window
Enter URL
and navigate
through
transaction
A TUSC Presentation
Save
Transaction
142
Beacon running
representative
transaction
Beacon running
representative
transaction
Beacon running
representative
transaction
Database
Hosts
Storage
Oracle9iAS
3rd Party
App Server
Beacon running
representative
transaction
Oracle9iAS
Beacon running
representative
transaction
Network
Oracle
E-Bus Suite
End Users
A TUSC Presentation
Oracle
Oracle9i
Database
Database
143
Apps and
Mid-Tier Servers
Database
Hosts
Storage
Oracle9iAS
Chicago
Sales Office
Network
Oracle
E-Bus Suite
End Users
Headquarters
Beacon running availability
transaction
Tokyo
Sales Office
Oracle
Database
3rd Party
App Server
Oracle9iAS
Toronto
Sales Office
A TUSC Presentation
144
A TUSC Presentation
145
Summary
Tune each instance in a database cluster independently
prior to tuning RAC.
Reduce contention for blocks to improve service time.
Operate on a well-tuned network.
Monitor system load.
Use V$ views to monitor RAC systems.
STATSPACK contains vital information for RAC systems.
New Features of Oracle10g will ease administration even
further.
A TUSC Presentation
146
A TUSC Presentation
147
Oracle9i Performance
Tuning Tips &
Techniques; Richard
J. Niemiec; Oracle
Press (May 2003)
If you are going through hell, keep going - Churchill
A TUSC Presentation
148
References
Oracle9i Performance Tuning Tips & Techniques, Rich
Niemiec
References
Oracle Database 10g Performance Overview; Herv
Lejeune, Oracle Corporation
Oracle 10g; Penny Avril,, Oracle Corporation
150
References
Oracle Tuning Presentation, Oracle Corporation
www.tusc.com, www.oracle.com, www.ixora.com,
www.laoug.org, www.ioug.org, technet.oracle.com
151
References
Oracle Database 10g Automated Features , Mike
Ault, TUSC
Oracle Database 10g New Features, Mike Ault,
Daniel Liu, Madhu Tumma, Rampant
Technical Press, 2003, www.rampant.cc
Oracle Database 10g - The World's First SelfManaging, Grid-Ready Database Arrives, Kelli
Wiseth, Oracle Technology Network, 2003,
otn.oracle.com
A TUSC Presentation
152
References
Oracle 10g documentation
Oracle 9i RAC class & instructors comments
Oracle 9i Concepts manual
http://geocities.com/pulliamrick/
Tips for Tuning Oracle9i RAC on Linux, Kurt
Engeleiter, Van Okamura, Oracle
153
References
Running YOUR Applications on Real Application
Clusters (RAC); RAC Deployment Best Practices,
Kirk McGowan, Oracle Corporation
A TUSC Presentation
Creating Business Prosperity
in a Challenging
154
References
Real Application Clusters, Real Customers Real
Results, Erik Peterson, Technical Manager, RAC,
Oracle Corp.
References
Oracle Database 10g Automated Features , Mike
Ault, TUSC
Oracle Database 10g New Features, Mike Ault,
Daniel Liu, Madhu Tumma, Rampant
Technical Press, 2003, www.rampant.cc
Oracle Database 10g - The World's First SelfManaging, Grid-Ready Database Arrives, Kelli
Wiseth, Oracle Technology Network, 2003,
otn.oracle.com
A TUSC Presentation
156
References
Oracle 10g; Penny Avril, Principal Database Product
Manager, Server Technologies, Oracle Corporation
To Infinity and Beyond, Brad Brown, TUSC
Forrester Reports, Inc., TechStrategy Research, April
2002, Organic IT
Internals of Real Application Cluster, Madhu Tumma,
Credit Suisse First Boston
A TUSC Presentation
157
References
The Traits of the Uncommon Leader; U.S. Marine Corps
Manual
60 Minute Manager - Joe Trezzo, TUSC
Uncommon Leaders; TUSC, 1989
Whats next for IT?; Larry Geisel, Netscape
The Miracle of Motivation; George Shinn
Gods little devotional book for leaders
7 Habits of Highly Effective People; Steven Covey
The Laws of Leadership - John Maxwell
The making of a leader - Frank Damazio
Bullet Proof Manager Seminars, Krestcom Productions, Inc.
TUSC Services
Oracle Technical Solutions
Full-Life Cycle Development Projects
Enterprise Architecture
Database Services
Managed Services
24x7x365 Remote Monitoring & Management
Functional & Technical Support
159
Copyright Information
Neither TUSC, Oracle nor the authors
guarantee this document to be error-free.
Please provide comments/questions to
rich@tusc.com.
TUSC 2004. This document cannot be
reproduced without expressed written consent
from an officer of TUSC
A TUSC Presentation
160