Professional Documents
Culture Documents
Global industry-leader in remote database administration services and consulting for Oracle, Oracle Applications, MySQL and SQL Server
Work with over 150 multinational companies such as Forbes.com, Fox Sports, Nordion and Western Union to help manage their complex IT deployments
Expertise:
One of the worlds largest concentrations of dedicated, full-time DBA expertise. Employ 6 Oracle ACEs/ACE Directors. Hold 7 Specializations under Oracle Platinum Partner program, including Oracle Exadata, Oracle GoldenGate & Oracle RAC.
24/7/365 global remote support for DBA and consulting, systems administration, special projects or emergency response
2011 Pythian
Mission
Let you remember/consider AWR next time you troubleshoot Performance issue!
2009/2010 Pythian
NOTE
AWR = STATSPACK
= Performance Repository
Rem
4
AWR Agenda
Oracle DBA consultant experience (14+ years) Pythian Oracle Clients support (2+ years)
6
140+ Clients around the world Different products, different load, different problems
2009/2010 Pythian
Background
AWR is one of many RDBMS performance data sources
Jonathan Lewis / Tom Kyte / Tanel Pder / Cary Millsap
Sometimes it isnt the best source (aggregation) SQL Extended trace (event 10046) RAW trace tkprof TRCAnlzr [ID 224270.1] Method-R state of art tools PL/SQL Profiler LTOM (Session Trace Collector) others Sometimes it is the best source! Sometimes it is the only one available!
7 2009/2010 Pythian
Background
Once I was called to troubleshoot high load Connected to the database I saw 8 active processes running for 6 hours in average at the time I connected I switched 10046 event for all 8 collected 15 minutes data and analyzed it one by one Found several SQLs returning 1 row million times Passed the results to development asking to fix the logic Spent ~2 hours to find where the issue was
Next day a workmate asked me Why did you use 10046 and spent 2 hours? He used AWR report and came up with the same answer in less than 5 minutes
Lesson learned: Right tool for the right (job - no) case !
8 2009/2010 Pythian
10
2009/2010 Pythian
11
2009/2010 Pythian
12
2009/2010 Pythian
13
2009/2010 Pythian
14
2009/2010 Pythian
15
2009/2010 Pythian
5.
2.
3.
1.
52.8 %
4.
16
2009/2010 Pythian
17
2009/2010 Pythian
18
2009/2010 Pythian
Most of the views contain data snapshots from V$___ views DELTA columns (e.g. DISK_READS_DELTA)
DBA_HIST_SEG_STAT DBA_HIST_SQLSTAT
19
2009/2010 Pythian
Begin End
t
20 2009/2010 Pythian
Most of the V$ (DBA_HIST) performance views have incremental counters. END - BEGIN values You may get wrong results (sometimes negative) Sometimes counters reach max value and get reset Counters got reset at instance restart time
Time between snapshots may be different Suggestion (ENDv - BEGINv)/(ENDs - BEGINs)=value/sec
21 2009/2010 Pythian
from DBA_HIST_SNAPSHOT s where 1=1 and s.INSTANCE_NUMBER = (select INSTANCE_NUMBER from V$INSTANCE) and s.DBID = (select DBID from V$DATABASE) order by s.BEGIN_INTERVAL_TIME;
22 2009/2010 Pythian
23
2009/2010 Pythian
25
2009/2010 Pythian
27
2009/2010 Pythian
select st.SQL_ID , st.PLAN_HASH_VALUE , sum(st.EXECUTIONS_DELTA) EXECUTIONS , sum(st.ROWS_PROCESSED_DELTA) CROWS , trunc(sum(st.CPU_TIME_DELTA)/1000000/60) CPU_MINS , trunc(sum(st.ELAPSED_TIME_DELTA)/1000000/60) ELA_MINS from DBA_HIST_SQLSTAT st where st.SQL_ID in ( '5ppdcygtcw7p6' ,'gpj32cqd0qy9a' ) group by st.SQL_ID , st.PLAN_HASH_VALUE order by st.SQL_ID, CPU_MINS;
28
2009/2010 Pythian
SQL_ID PLAN_HASH_VALUE EXECUTIONS CROWS CPU_MINS ELA_MINS ------------- --------------- ---------- ---------- ---------------- ---------------5ppdcygtcw7p6 436796090 20 82733 1 3 5ppdcygtcw7p6 863350916 71 478268 5 11 5ppdcygtcw7p6 2817686509 9 32278 2,557 2,765 gpj32cqd0qy9a gpj32cqd0qy9a gpj32cqd0qy9a gpj32cqd0qy9a 3094138997 1700210966 1168845432 2667660534 30 36 2 4 58400 69973 441 1489 1 1 482 1,501 3 7 554 1,642
29
2009/2010 Pythian
select st.SQL_ID , st.PLAN_HASH_VALUE , sum(st.EXECUTIONS_DELTA) EXECUTIONS , sum(st.ROWS_PROCESSED_DELTA) CROWS , trunc(sum(st.CPU_TIME_DELTA)/1000000/60) CPU_MINS , trunc(sum(st.ELAPSED_TIME_DELTA)/1000000/60) ELA_MINS from DBA_HIST_SQLSTAT st where st.SQL_ID in ( '5ppdcygtcw7p6' ,'gpj32cqd0qy9a' ) group by st.SQL_ID , st.PLAN_HASH_VALUE order by st.SQL_ID, CPU_MINS;
31
2009/2010 Pythian
32
2009/2010 Pythian
33
2009/2010 Pythian
34
2009/2010 Pythian
35
2009/2010 Pythian
Takeaways
A. SQL Plans may flip from good plans to B. SQL Outlines may help some times C. AWR provided good input for such analysis
36
2009/2010 Pythian
Conclusions
AWR = DBA_HIST% views ( snapshots from V$% views )
Sometimes it is the only source of information AWR contains much more information that default AWR reports and Grid Control could provide you
I can show you the door but it is you who should walk through it
37 2009/2010 Pythian
Pythian Facts
Founded in 1997, over 14 years 100+ employees 5 offices in 5 countries (true follow the sun model) Employ
6 Oracle ACEs (Including 1 ACE director) Several Oracle Masters Plenty of technical geeks
Platinum level partner in the Oracle Partner Network Actively supports technical communities via Blogging Conferences SIGs and other events
38
2009/2010 Pythian
Additional Resources
www.oracle.com/scan www.pythian.com/exadata Google: Oracle Yury www.pythian.com/news/tag/exadata - Exadata Blog www.pythian.com/news_and_events/in_the_news Article: Making the Most of Oracle Exadata My Oracle Support notes 888828.1 and 757552.1 Thank you!
Blog, Twitter, Linkedin, ACE email, phone number
39
2009/2010 Pythian