Documente Academic
Documente Profesional
Documente Cultură
Agenda
A brief history of Oracle tuning Limitations of common approaches Systematically tuning by levels
Application demand Database contention Reducing physical IO Tuning physical IO
Limited Instrumentation
Tkprof (6.0) V$sysstat
No WWW
An Oracle performance community emerges (Oak Table, etc) Yet Another Performance Profiling Methodology (YAPP): ResponseTime=ServiceTime+WaitTime
Largest wait categories represent greatest opportunities for optimization Average wait times can reveal contention points
Therefore it would be reasonable to assume insufficient IO bandwidth (e.g., distinct disk drives) to support the workload.
You are best advised to ignore symptoms in the lower levels until you have optimized the performance of high levels.
SQL/ PLSQL
Application
Oracle Software
IO Subsystem
Data Blocks
Parse SQL, check security, acquire locks, latches, buffer space, etc
Cache data blocks for re-use; sort data as required, create hash tables for hash join
Types of contention
Locks
Mostly application, but occasionally system (ST in legacy tablespaces)
Latches
Often side effect of excessive application demand Lack of bind variables But sometimes the final constraint on DB throughput
Buffers
Buffer cache, redo buffer, etc Hot blocks (buffer busy) Slow lazy writers processes (DBWR, LGWR, RVWR)
Locks
80
60
40
20
0 0 2000 4000 6000 8000 10000 Spin Count 12000 14000 16000 18000 20000
IO is increasingly expensive
10,000
%change
1,000 100 10 1 IO rate Disk Capacity 400 2000 20 IO/GB CPU 3200 12.5 IO/CPU .
Reducing physical IO
Oracle Session
Buffer pools
Memory is used to cache data and to perform sorting and hashing (ORDER/GROUP BY, joins). Oracle 10g manages allocations within PGA/SGA well enough Determining the trade offs between these areas is the most important IO reduction method 11g promises to automate this step
60,000,000
50,000,000
20,000,000
10,000,000
A FTS can only generate so much IO A disk sort can generate many times the IO required to read the data from disk Some of this sort IO appears to be hidden from the wait interface
00 0
25 0
50 0
75 0
00 0
00 0
50 0
,0 00
,5 00
,0 00
,5 00
,0 00 20
1,
2,
2,
2,
3,
5,
7,
10
12
15
17
25
,0 00
10
25
50
75
Advisories
Advisories exist that provide estimates of the workload impact if a memory area were a different size
In essence, Oracle is maintaining LRU chains that are longer than actual allocations
Key advisories:
V_$PGA_TARGET_ADVICE V_$DB_CACHE_ADVICE V_$SHARED_POOL_ADVICE V_$SGA_TARGET_ADVICE (10g)
When comparing PGA and SGA advisories, you need to convert them to common units (wait time)
IO management
The demand for physical IO should be about right now
Youve reduced the application logical IO demand Youve eliminated contention that might mask that demand Youve minimized the amount of logical IO than turns into physical IO by effective memory management
Now optimize the IO subsystem for the amount of physical IO you observe
Buy enough disks to meet IO demand and storage demand Remember also that sparse disks are more efficient Oracles SAME (Stripe and Mirror Everything) is a good default approach Separating log/FRA and datafile IO is arguably the only split up you should have to make Dedicated disks for sequential redo IO OR Separate wide, fine-grained stripe for redo and FRA ASM makes this very easy, but be careful: intolerant of poor underlying configurations
Q&A