35
Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go- faster.co.uk www.go- faster.co.uk

Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. [email protected]

Embed Size (px)

Citation preview

Page 1: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel

David KurtzGo-Faster Consultancy Ltd.

[email protected]

www.go-faster.co.uk

Page 2: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 2

Who Am I?

• Oracle Database Specialist– Independent consultant

• System Performance tuning– PeopleSoft ERP– Oracle RDBMS

• Book– www.psftdba.com

• UKOUG– PeopleSoft Technology SIG

Committee

Page 3: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 3

Resources

• If you can’t hear me say so now.• Please feel free to ask questions as we go

along.• The presentation is available from

• UKOUG Library• www.go-faster.co.uk• See also http://blog.go-faster.co.uk

– Tip: Print in ‘black and white’ for white background.

Page 4: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 4

Background Reading

• Blog Entry: – http://blog.go-faster.co.uk/2008/12/graphing-

awr-data-in-excel.html

• Download Excel Sheet:– http://www.go-faster.co.uk/

scripts.htm#awr_wait.xls

Page 5: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 5

A Picture is worth 1000 metrics!

• If you are lucky you might be able to pick out that one number in an AWR/Statspack report that is different to usual.

• But– How many databases do you have to look after?– How many reports do you need to examine to

find that rogue metric?

Page 6: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 6

DBA2.0

• Oracle Enterprise Manager– Graph Performance Data– Focus on time

Page 7: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 7

Oracle Enterprise Manager / Grid Control

• If you don’t have it, then I am going to show you how to graph some of the data yourself.

• If you have it, it is excellent. – But it can be a bit tricky to save charts.

• Screen dump, or save graphics.

Page 8: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 8

Objective

• Chart of – Time the database spent waiting

– Over the last 7 days

– Broken down by Wait Event

• I am going to use AWR data– But you can do the same thing with Statspack

• This technique can be applied to any set of metrics

Page 9: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 9

Recipe

• Ingredients– A SQL Query– Microsoft Excel– SQL*Net Client

• And this is what you do…

Page 10: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 11

SQL Query

• Wait Information– DBA_HIST_SYSTEM_EVENT– Snapshot of v$system_event

• Snapshot Information– DBA_HIST_SNAPSHOTS

Page 11: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 12

Analytic Functions

• Wait Event Data are running totals • Use analytic function LAG() to work out the

change since last snapshot.• This is generally more efficient than getting

previous row using sub-queries.

Page 12: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 13

Recipe (1): Data Source

• Create A Blank Workbook

• Data -> Import External Query -> New Database Query

• Do not use the Wizard

Page 13: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 14

Recipe (2): ODBC Driver

• The first time you do this you may need to create a new data source

• Select ODBC Driver, either– Oracle ODBC

– MS ODBC for Oracle

Page 14: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 15

Recipe (3): MS Query Connect

• Connect to the database in the ordinary way

Page 15: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 16

Recipe (4): MS Query SQL Window

• View SQL

• Paste Query into the SQL Window

Page 16: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 17

Recipe (5): MS Query Results

Page 17: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 18

Recipe (6): Import Data

• Return the data to Excel. This time we want a Pivot table

Page 18: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 19

Recipe (7): Pivot Wizard

• Start with Layout

Page 19: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 20

Recipe (8): Pivot Layout Wizard

• Drag fields, adjust titles and formating

Page 20: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 21

Recipe (9): Pivot Subtotalling

• Turn off Subtotalling

Page 21: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 22

Recipe (10): Pivot Formatting

• Sort Heading, restrict to Top-n

Page 22: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 23

Recipe (11): Pivot Options

• Turn off Totals• Save data with table

layout• Disable Drilldown• Save Password?

– (this could be a security issue)

Page 23: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 24

Recipe (12): Pivot Chart

• Very easy– You can continue formatting in the pivot chat

• But works best when data points absolutely regular along x-axis.

• Usually OK, because AWR snapshot regularish.

Page 24: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 25

Tips (1): X-Y Chart Pivot

• Can’t do it by default

• Cheat – copy to somewhere else in spreadsheet.

• Copy down previous values use cell formula when run out of data

Page 25: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 26

Tips (2): Multiple pivots of same data

• Don’t create a new query, copy the sheet– The SQL is only issued once, but both sheets

refresh.

Page 26: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 27

A Real System

Page 27: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 28

A war story…

• Come back after lunch, and I’ll explain what was going on here, and where it led…

Page 28: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 29

And here is one I prepared earlier.

• I can now – Keep the chart and data in a file– Cut & Paste to Word document or PowerPoint

• Like this…

Page 29: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 30

A real system

Page 30: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 31

A war story…

• Come back after lunch, and I’ll explain what was going on here, and where it led…

Page 31: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Questions?

Where’s lunch?

Page 32: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel

David KurtzGo-Faster Consultancy Ltd.

[email protected]

www.go-faster.co.uk

Page 33: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Questions?

Where’s lunch?

Page 34: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 35

A war story…

• Come back after lunch, and I’ll explain what was going on here, and where it led…

Page 35: Graphing AWR Data in Excel David Kurtz Go-Faster Consultancy Ltd. david.kurtz@go-faster.co.uk

Graphing AWR Data in Excel ©2009 www.go-faster.co.uk 36

A real system