VirtaThon 2011 - Mining the AWR

89
Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Transcript of VirtaThon 2011 - Mining the AWR

Page 1: VirtaThon 2011 - Mining the AWR

Mining the AWR repository for Capacity Planning, Visualization, 

& other real world stuff

Page 2: VirtaThon 2011 - Mining the AWR

Who am I?

• Karl Arao, Oracle ACE, OCP‐DBA, RHCE• Currently @ Enkitec ‐ Senior Technical Consultant • Formerly @ SQL*Wizard ‐ Solutions Architect• Blog: http://karlarao.wordpress.com• Wiki: http://karlarao.tiddlyspot.com• Twitter: http://twitter.com/karlarao

Page 3: VirtaThon 2011 - Mining the AWR

What will I talk about?

Page 4: VirtaThon 2011 - Mining the AWR
Page 5: VirtaThon 2011 - Mining the AWR

Overwhelming

Page 6: VirtaThon 2011 - Mining the AWR
Page 7: VirtaThon 2011 - Mining the AWR

DBA_HIST_* views

Page 8: VirtaThon 2011 - Mining the AWR

My first close encounter

Page 9: VirtaThon 2011 - Mining the AWR

gc block lost – sudden slow down

http://karlarao.wordpress.com/2009/06/07/diagnosing-and-resolving-gc-block-lost

Page 10: VirtaThon 2011 - Mining the AWR

gc block lost – sudden slow down

http://karlarao.wordpress.com/2009/06/07/diagnosing-and-resolving-gc-block-lost

Page 11: VirtaThon 2011 - Mining the AWR

gc block lost – sudden slow down

http://karlarao.wordpress.com/2009/06/07/diagnosing-and-resolving-gc-block-lost

Page 12: VirtaThon 2011 - Mining the AWR

gc block lost – sudden slow down

http://karlarao.wordpress.com/2009/06/07/diagnosing-and-resolving-gc-block-lost

Page 13: VirtaThon 2011 - Mining the AWR

After gc block lost – normal workload

http://karlarao.wordpress.com/2009/06/07/diagnosing-and-resolving-gc-block-lost

Page 14: VirtaThon 2011 - Mining the AWR

Utilization = Requirement / Capacity

Page 15: VirtaThon 2011 - Mining the AWR

Double Y Axis Graph

Page 16: VirtaThon 2011 - Mining the AWR

t1 ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐> t0335 – 336 – 337 – 338 – 339

Page 17: VirtaThon 2011 - Mining the AWR
Page 18: VirtaThon 2011 - Mining the AWR
Page 19: VirtaThon 2011 - Mining the AWR
Page 20: VirtaThon 2011 - Mining the AWR
Page 21: VirtaThon 2011 - Mining the AWR
Page 22: VirtaThon 2011 - Mining the AWR
Page 23: VirtaThon 2011 - Mining the AWR

delta issue

Page 24: VirtaThon 2011 - Mining the AWR
Page 25: VirtaThon 2011 - Mining the AWR
Page 26: VirtaThon 2011 - Mining the AWR
Page 27: VirtaThon 2011 - Mining the AWR

AWR Scripts

Page 28: VirtaThon 2011 - Mining the AWR

Visualization

Page 29: VirtaThon 2011 - Mining the AWR

Can’t go back in time?

Page 30: VirtaThon 2011 - Mining the AWR

AAS – Average Active SessionsKyle Hailey: http://www.perfvision.com/ftp/class/02_AAS.ppt

Max CPU

Max CPU

Page 31: VirtaThon 2011 - Mining the AWR

AAS – the Golden MetricAAS & CPU count as a yardstick for a possible performance problem:if AAS < 1 ‐‐ Database is not blockedAAS ~= 0 ‐‐ Database basically idle‐‐ Problems are in the APP not DBAAS < # of CPUs‐‐ CPU available‐‐ Database is probably not blocked‐‐ Are any single sessions 100% active?AAS > # of CPUs‐‐ Could have performance problemsAAS >> # of CPUS‐‐ There is a bottleneck

Page 32: VirtaThon 2011 - Mining the AWR

AAS from V$ACTIVE_SESSION_HISTORYAAS = Sample Count / Elapsed Time

= 19410 / 600= 32.35

CPU count = 4

Page 33: VirtaThon 2011 - Mining the AWR

AAS from DBA_HIST_ACTIVE_SESS_HISTORYAAS = (Sample Count * 10) / Elapsed Time

= (1950 * 10) / 600= 32.5 

CPU count = 4

Page 34: VirtaThon 2011 - Mining the AWR

AAS from AWR ReportAAS = DB Time / Elapsed Time

= 291.81 / 9.10= 32.07

CPU count = 4

Page 35: VirtaThon 2011 - Mining the AWR

AAS from AWR Top EventsAAS = DB Time / Elapsed Time

291.81 / 9.10 = 32.07

AAS = Event Time / Elapsed Time17410 / 546 = 31.9

CPU count = 4

Page 36: VirtaThon 2011 - Mining the AWR

awr_topevents.sql

Page 37: VirtaThon 2011 - Mining the AWR

Textual trends

Page 38: VirtaThon 2011 - Mining the AWR
Page 39: VirtaThon 2011 - Mining the AWR
Page 40: VirtaThon 2011 - Mining the AWR
Page 41: VirtaThon 2011 - Mining the AWR

AAS throughout the AWR retention period!

http://karlarao.wordpress.com/2010/07/25/graphing-the-aas-with-perfsheet-a-la-enterprise-manager

Page 42: VirtaThon 2011 - Mining the AWR

Capacity Planning

Page 43: VirtaThon 2011 - Mining the AWR

Utilization is the ultimate metric!

Page 44: VirtaThon 2011 - Mining the AWR

awr_genwl.sql

Page 45: VirtaThon 2011 - Mining the AWR

http://karlarao.wordpress.com/2010/01/31/workload-characterization-using-dba_hist-tables-and-ksar

Page 46: VirtaThon 2011 - Mining the AWR

U = R / C

Page 47: VirtaThon 2011 - Mining the AWR

where aas > 1

Page 48: VirtaThon 2011 - Mining the AWR

Filter the data points• AAS range

aas > 1

• Per SNAP_ID or range of SNAP_IDsid in (336)where id >= 336 and  id <= 340

• Oracle CPU Utilizationoracpupct > 50

• OS CPU Utilizationoscpupct > 50

• Workload periods

AND TO_CHAR(s0.END_INTERVAL_TIME,'D') >= 1     ‐‐ Day of week: 1=Sunday 7=SaturdayAND TO_CHAR(s0.END_INTERVAL_TIME,'D') <= 7AND TO_CHAR(s0.END_INTERVAL_TIME,'HH24MI') >= 0900     ‐‐ HourAND TO_CHAR(s0.END_INTERVAL_TIME,'HH24MI') <= 1800AND s0.END_INTERVAL_TIME >= TO_DATE('2010‐jan‐17 00:00:00','yyyy‐mon‐dd hh24:mi:ss')  ‐‐ Data rangeAND s0.END_INTERVAL_TIME <= TO_DATE('2010‐aug‐22 23:59:59','yyyy‐mon‐dd hh24:mi:ss‘)

Page 49: VirtaThon 2011 - Mining the AWR
Page 50: VirtaThon 2011 - Mining the AWR

core need = # of cores * utilization * 1.25Database Consolidation Best Practices

http://husnusensoy.files.wordpress.com/2010/05/database‐consolidation‐best‐practices.pdf

Page 51: VirtaThon 2011 - Mining the AWR
Page 52: VirtaThon 2011 - Mining the AWR
Page 53: VirtaThon 2011 - Mining the AWR

Total disk IOPS = (IOPS * Read Ratio) + (IOPS * Write Ratio * RAID penalty)

Number of disk = Total disk IOPS / IOPS per disk

Page 54: VirtaThon 2011 - Mining the AWR
Page 55: VirtaThon 2011 - Mining the AWR

awr_iowl.sql

Page 56: VirtaThon 2011 - Mining the AWR

Average latency issue

60 minutes interval 10 minutes interval

Page 57: VirtaThon 2011 - Mining the AWR

latency (ms) = (readtim / phy reads) * 10

Page 58: VirtaThon 2011 - Mining the AWR

Linear Regression

Page 59: VirtaThon 2011 - Mining the AWR
Page 60: VirtaThon 2011 - Mining the AWR
Page 61: VirtaThon 2011 - Mining the AWR
Page 62: VirtaThon 2011 - Mining the AWR
Page 63: VirtaThon 2011 - Mining the AWR

x data (CPU) = is the "independent value", used to predict the value of y

y data (AAS) = is the "dependent value", variable whose value is to be predicted

Page 64: VirtaThon 2011 - Mining the AWR
Page 65: VirtaThon 2011 - Mining the AWR
Page 66: VirtaThon 2011 - Mining the AWR
Page 67: VirtaThon 2011 - Mining the AWR
Page 68: VirtaThon 2011 - Mining the AWR
Page 69: VirtaThon 2011 - Mining the AWR

r2toolkit

Uses the following inbuilt Oracle functions:

•regr_count•regr_r2•regr_intercept•regr_slope

Page 70: VirtaThon 2011 - Mining the AWR

r2toolkit

Page 71: VirtaThon 2011 - Mining the AWR

Linear Regression – what’s the value?

Page 72: VirtaThon 2011 - Mining the AWR

Linear Regression on 2 node RAChttp://karlarao.tiddlyspot.com/#r2project

racnode1 racnode2

Page 73: VirtaThon 2011 - Mining the AWR

Drilling down on the peak workload... with AAS of 10

Page 74: VirtaThon 2011 - Mining the AWR

Drilling down on the peak workload... with AAS of 10

Page 75: VirtaThon 2011 - Mining the AWR
Page 76: VirtaThon 2011 - Mining the AWR
Page 77: VirtaThon 2011 - Mining the AWR
Page 78: VirtaThon 2011 - Mining the AWR
Page 79: VirtaThon 2011 - Mining the AWR

Now on the low workload period... with AAS of 2.2

Page 80: VirtaThon 2011 - Mining the AWR

Now on the low workload period... with AAS of 2.2

Page 81: VirtaThon 2011 - Mining the AWR
Page 82: VirtaThon 2011 - Mining the AWR
Page 83: VirtaThon 2011 - Mining the AWR
Page 84: VirtaThon 2011 - Mining the AWR
Page 85: VirtaThon 2011 - Mining the AWR

Recap

• Mine the beautiful data set

• Visualization tell a story immediately

• Statistics to make sense of data

Page 86: VirtaThon 2011 - Mining the AWR

Let the AWR data set 

change your mind set!

Page 87: VirtaThon 2011 - Mining the AWR

Thank you!

Page 88: VirtaThon 2011 - Mining the AWR

References and Tools• http://karlarao.wordpress.com

– http://karlarao.tiddlyspot.com/#%5B%5BStorage%20IOPS%2Ccapacity%2Cperformance%2Ccost%5D%5D

– http://karlarao.tiddlyspot.com/#Statistics– http://karlarao.tiddlyspot.com/#OraclePerformance

• Tanel Poder @ http://blog.tanelpoder.com– http://www.tanelpoder.com/files/TPT_public.zip– http://www.tanelpoder.com/files/PerfSheet.zip– Neil Gunther & Tanel Poder ‐Multidimensional Visualization of Oracle Performance 

using Barry007 http://arxiv.org/pdf/0809.2532• Kyle Hailey @ http://ashmasters.com , http://www.perfvision.com• Craig Shallahamer @ orapub.com

– Introduction To Oracle Server Consolidationhttp://resources.orapub.com/product_p/server_consolidation_ppt.htm

• Husnu Sensoy @ husnusensoy.wordpress.com – Database Consolidation Best Practiceshttp://husnusensoy.files.wordpress.com/2010/05/database‐consolidation‐best‐

practices.pdf• Andy Rivenes @ http://www.appsdba.com/pubs.htm• Neeraj Bhatia @ www.nioug.org/files/Linear_Regression.pdf

Page 89: VirtaThon 2011 - Mining the AWR

Contact me through:

[email protected]