Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world...

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

Transcript of Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world...

Page 1: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Mining the AWR repository for Capacity Planning, Visualization,

& other real world stuff

Page 2: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Page 3: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Page 4: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Page 5: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

What will I talk about?

Page 6: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 7: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Overwhelming

Page 8: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

AWR HELL

Page 9: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

DBA_HIST_* views

Page 10: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

My first close encounter

Page 11: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

gc block lost – sudden slow down

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

Page 12: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

gc block lost – sudden slow down

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

Page 13: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

gc block lost – sudden slow down

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

Page 14: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

gc block lost – sudden slow down

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

Page 15: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

After gc block lost – normal workload

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

Page 16: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Utilization = Requirement / Capacity

Page 17: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Double Y Axis Graph

Page 18: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Page 19: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 20: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 21: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 22: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 23: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 24: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 25: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

delta issue

Page 26: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 27: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 28: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 29: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

AWR Scripts

Page 30: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Visualization

Page 31: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Can’t go back in time?

Page 32: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Max CPU

Max CPU

Page 33: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

AAS – the Golden MetricAAS & CPU count as a yardstick for a possible performance problem:

if AAS < 1 -- Database is not blocked

AAS ~= 0 -- Database basically idle-- Problems are in the APP not DB

AAS < # of CPUs-- CPU available-- Database is probably not blocked-- Are any single sessions 100% active?

AAS > # of CPUs-- Could have performance problems

AAS >> # of CPUS-- There is a bottleneck

Page 34: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

AAS from V$ACTIVE_SESSION_HISTORYAAS = Sample Count / Elapsed Time

= 19410 / 600= 32.35

CPU count = 4

Page 35: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

= (1950 * 10) / 600= 32.5

CPU count = 4

Page 36: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

AAS from AWR ReportAAS = DB Time / Elapsed Time

= 291.81 / 9.10= 32.07

CPU count = 4

Page 37: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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 38: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

awr_topevents.sql

Page 39: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Textual trends

Page 40: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 41: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 42: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 43: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

AAS throughout the AWR retention period!

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

Page 44: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Capacity Planning

Page 45: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Utilization is the ultimate metric!

Page 46: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

awr_genwl.sql

Page 47: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Page 48: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

U = R / C

Page 49: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

where aas > 1

Page 50: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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 51: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 52: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

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

Page 53: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 54: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 55: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Number of disk = Total disk IOPS / IOPS per disk

Page 56: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 57: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

awr_iowl.sql

Page 58: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Average latency issue

60 minutes interval 10 minutes interval

Page 59: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Page 60: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Linear Regression

Page 61: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 62: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 63: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 64: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 65: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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 66: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 67: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 68: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 69: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 70: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 71: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

r2toolkit

Uses the following inbuilt Oracle functions:

•regr_count•regr_r2•regr_intercept•regr_slope

Page 72: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

r2toolkit

The toolkit systematically gets the statistic with highest correlation coefficient (relationship)

No guess work!

Page 73: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Linear Regression – what’s the value?Lets you do forecast that can guide you with targeted response time optimizations and workload reduction.

• Drill down on SNAP_IDs (data samples) with high AAS

• Know what’s causing the high AAS on those SNAP_IDs

• Tune the bottleneck - results to huge savings on system resources!

Page 74: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

racnode1 racnode2

Page 75: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Page 76: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Page 77: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 78: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 79: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 80: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 81: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Page 82: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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

Page 83: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 84: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 85: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff
Page 86: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Recap

• Mine the beautiful data set

• Visualization tell a story immediately

• Statistics to make sense of data

Page 87: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Let the AWR data set

change your mind set!

Page 88: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Thank you!

Page 89: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

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 90: Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, & other real world stuff

Contact me through:

[email protected]