Professional Documents
Culture Documents
Be a Hero with your DBA: Database Performance Tuning for System Admins and IT Architects
Randal Sagrillo Session #544
Program Agenda
Scope and Method Tools Examples Next Steps
More Users More Data More Transactions More Complexity More Hardware More Software More Data Centers
Lower Performance
20%
I/O
CPU
80%
CPU
20%
Physical I/O
80%
I/O
Batch job duration too long Reporting/ad hoc query too long OLTP transaction times too long (Business value)
Demand
Supply
bandwidth
Shortest service time delivered
Usually most important for databases
I N I T I A T O R
IOPS
MB/Sec
T A R G E T
milliseconds
8 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
Performance Methodology
Performance below expectation, variance, degradation over time, etc.
Identify SLAs
Symptoms
Systemic analysis
Minimize scope
Free DB Utilities SQL tracing/tkprof Statspack: PL code, Since Oracle 8i, download
strace, truss
Dtrace,SWAT Very powerful,
expert tools
But hard to estimate
10
11
12
13
14
Analysis:
db file sequential read - 3500 IOPS, 10ms average 15 minute snapshots under load: but 9.5 hours of disk waits! 77 minutes of commit time
15 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
Cache (SGA holds pointers) Clean Cache! Buffer Cache Almost changes physical read I/O to logical I/O Rule of sizing: 2x 10x SGA Many size. See Buffer Pool I/Os Advisory to narrow estimate Best accelerates read Storage intensive workloads
16 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
Buffer Cache
Few I/Os
Storage
17
Buffer Cache
Buffer Cache
block in any nodes Buffer Cache But only checks blocks in local nodes Flash Cache File
19
20
Proccode response time cut better than in half! Fewer Index reads needed
22
Use Buffer Pool Advisory to determine how much more cache needed
If you can add/reallocate memory to the DB servers: GREAT!
23
24
Example #3 Analysis
Only One Log Writer Process per Instance
commit time!
Log write time is only 1.2% of entire AWR report, but STILL top 5! More Important 5 hours of single process I/O in 8 hours real time!
Solution: Scheduling (LGWR priority!) Processor Binding improved commit times 4X!
response times
25 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
26
Example #4 Analysis
Archiving each redo log write after every commit IN A SQL LOADER ENVIRONMENT!
No direct load
While improving log write (I/O wait time) will help, usually easier to
improving scheduling
Processor binding or Critical Threads feature
ALWAYS check total log write time of LGWR to real time (snap)
duration!
As serialized single process (LGWR) time approaches all available real time, no
more room to schedule: THEN Need to speed up log write response times!
Separate Log device, HBAs, channel paths, LUNs, LUN Cache, etc. Log optimized storage: NVRAM, SPARC SuperCluster, Exadata
28 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
http://docs.oracle.com/cd/E11882_01/server.112/e25789/toc.htm
Oracle Database Performance Tuning Guide 11g R2(esp Chapter 10) Oracle Database Licensing Information 11g R2 (esp Chapter , Diagnostic Pack)
http://docs.oracle.com/cd/E11882_01/server.112/e16638/toc.htm
http://docs.oracle.com/cd/E11882_01/license.112/e10594/toc.htm
29
Statspack Overview http://www.orafaq.com/wiki/Statspack Statspack Installation (Last used in 9i) http://docs.oracle.com/cd/B10501_01/server.920/a96533/statspac.ht m#27255 Using Statspack with Oracle 11g http://myoracleworld.hobby-electronics.net/DB-statspack.html
30
32
33
34