Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graphing AWR Data in Excel

Similar presentations


Presentation on theme: "Graphing AWR Data in Excel"— Presentation transcript:

1 Graphing AWR Data in Excel
David Kurtz Go-Faster Consultancy Ltd. ©2009 Go-Faster Consultancy Ltd.

2 Who Am I? Oracle Database Specialist System Performance tuning Book
Graphing AWR Graphing AWR Who Am I? Oracle Database Specialist Independent consultant System Performance tuning PeopleSoft ERP Oracle RDBMS Book UKOUG PeopleSoft Technology SIG Committee Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd. ©2009 Go-Faster Consultancy Ltd. 2

3 Resources If you can’t hear me say so now.
Graphing AWR 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 See also Tip: Print in ‘black and white’ for white background. Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

4 Background Reading Blog Entry: Download Excel Sheet:
Graphing AWR Background Reading Blog Entry: Download Excel Sheet: [ I often use data collected by either the Oracle Automatic Workload Repository (AWR), to help to diagnose performance problems. However, as I often work on performance problems with application teams, rather than the DBAs. I generally don't have access to Oracle Enterprise Manager. Somebody might say that the system was slow at a particular time. I want to get an overview of the database at that time, and I might also want to compare it to another time when the system wasn't slow. Later I may generate AWR reports using particular pairs of snapshots, but I need something to direct me to when an issue occurred, and hence which snapshots to compare. When dealing with performance problems the question is nearly always the same. "How long did I spend doing what?". Amongst lots of metrics, AWR collects snapshots of how much time system-wide has been spent waiting on each wait event. To give me an overview of that data, I have created an excel spreadsheet that will query the AWR repository and retrieve that data for up to a week into am Excel pivot table, and will then graph the top wait events. Click on the thumbnail on the left to see an example. For me, this approach has a number of advantages: First; don't drown in numbers. The eye is very good at picking out patterns and irregularities. You can then drill into the numbers behind the chart. The chart provides a quick overview of the behaviour of the database. You can quickly see if there is anything to examine in more detail, or whether the database is exhibiting its normal characteristics. The AWR data is extracted into the spreadsheet, so I can keep a copy of the spreadsheet for reference. I generally like to collect AWR snapshots every 15 minutes. One week of data, at that frequency, turns into about 6Mb of spreadsheet. Excel charts can easily be put into documents, presentations or s. Excel is very flexible, it is easy to format the chart to show only what is important. It's free (that is to say that you won't need to go and buy anything else). All you need is Excel and an Oracle client. Over time I have produced a variety of spreadsheets that collect all sorts of metrics from the Oracle database and others that collect specific metrics from PeopleSoft applications. To be fair, AWR's forerunner, Statspack collects a lot of similar data to AWR, the essential difference being that AWR is a licensed option. This technique could also be used to extract data from the statspack repository, but most of my customers are licensed for AWR. You can download a sample Excel workbook and query from my website. Go to one of the sheets with data and 'Refresh Data'. The first time you will probably be prompted to select and ODBC source. You will be prompted for the login credentials. In a subsequent blog posting I will discuss a real example of where this technique helped me to resolve a problem. It is fairly straightforward to create spreadsheets that query databases, but here are some links that should help to get you going if you are not familiar with the process. From the Microsoft website: 'Use Microsoft Query to retrieve external data'. This is based on Excel 2007, but it explains how Excel calls MSQuery which then calls the ODBC driver. However, I recommend that you do not use the Query Wizard. I prefer to get the query working in SQL*Plus and then I copy it into MSQuery Querying External Data in Excel. This is a straightforward recipe for using MSQuery. Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

5 A Picture is worth 1000 metrics!
Graphing AWR 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? Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

6 DBA2.0 Oracle Enterprise Manager Graph Performance Data Focus on time
Graphing AWR DBA2.0 Oracle Enterprise Manager Graph Performance Data Focus on time Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

7 Oracle Enterprise Manager / Grid Control
Graphing AWR 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. Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

8 Objective Chart of I am going to use AWR data
Graphing AWR 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 Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

9 Recipe Ingredients And this is what you do… A SQL Query
Graphing AWR Recipe Ingredients A SQL Query Microsoft Excel SQL*Net Client And this is what you do… Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

10 This slide is deliberately hidden
Graphing AWR This slide is deliberately hidden At this point in the live presentation I am going to do a demonstration, but if it all goes horribly wrong I have a set of backup slides. If it works I will go to the end of presentation and work backwards to the final slide. My thanks to Connor McDonald for teaching me this trick. Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

11 SQL Query Wait Information Snapshot Information DBA_HIST_SYSTEM_EVENT
Graphing AWR SQL Query Wait Information DBA_HIST_SYSTEM_EVENT Snapshot of v$system_event Snapshot Information DBA_HIST_SNAPSHOTS Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

12 Analytic Functions Wait Event Data are running totals
Graphing AWR 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. Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

13 Recipe (1): Data Source Create A Blank Workbook
Graphing AWR Recipe (1): Data Source Create A Blank Workbook Data -> Import External Query -> New Database Query Do not use the Wizard Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

14 Graphing AWR 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 Perversely MS ODBC for Oracle seems to perform better. Don’t ask me why. Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

15 Recipe (3): MS Query Connect
Graphing AWR Recipe (3): MS Query Connect Connect to the database in the ordinary way If your user ID has access to a huge number of objects you can get out of memory errors with either driver. Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

16 Recipe (4): MS Query SQL Window
Graphing AWR Recipe (4): MS Query SQL Window View SQL Paste Query into the SQL Window Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

17 Recipe (5): MS Query Results
Graphing AWR Recipe (5): MS Query Results Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

18 Graphing AWR Recipe (6): Import Data Return the data to Excel. This time we want a Pivot table Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

19 Recipe (7): Pivot Wizard
Graphing AWR Recipe (7): Pivot Wizard Start with Layout Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

20 Recipe (8): Pivot Layout Wizard
Graphing AWR Recipe (8): Pivot Layout Wizard Drag fields, adjust titles and formating Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

21 Recipe (9): Pivot Subtotalling
Graphing AWR Recipe (9): Pivot Subtotalling Turn off Subtotalling Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

22 Recipe (10): Pivot Formatting
Graphing AWR Recipe (10): Pivot Formatting Sort Heading, restrict to Top-n Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

23 Recipe (11): Pivot Options
Graphing AWR Recipe (11): Pivot Options Turn off Totals Save data with table layout Disable Drilldown Save Password? (this could be a security issue) Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

24 Recipe (12): Pivot Chart Very easy
Graphing AWR 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. AWR snapshots are not absolutely regular, they tend to slip a second or so per snapshot, but when they reach 1 minute late, the scheduler fixes the slippage. So if you have 15 minute snapshots, most of them will be 15m1s, and occasionally you get one of 14m1s. So this can cause a 6% spike in absolute values Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

25 Tips (1): X-Y Chart Pivot
Graphing AWR 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 Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

26 Tips (2): Multiple pivots of same data
Graphing AWR 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. Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

27 A Real System Graphing AWR Data in Excel ©2009 www.go-faster.co.uk
©2009 Go-Faster Consultancy Ltd.

28 Graphing AWR A war story… Come back after lunch, and I’ll explain what was going on here, and where it led… Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

29 And here is one I prepared earlier.
Graphing AWR 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… Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

30 A real system Graphing AWR Data in Excel ©2009 www.go-faster.co.uk
©2009 Go-Faster Consultancy Ltd.

31 Graphing AWR A war story… Come back after lunch, and I’ll explain what was going on here, and where it led… Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

32 Questions? Where’s lunch? Graphing AWR
©2009 Go-Faster Consultancy Ltd.

33 Graphing AWR Data in Excel
David Kurtz Go-Faster Consultancy Ltd. ©2009 Go-Faster Consultancy Ltd.

34 Questions? Where’s lunch? Graphing AWR
©2009 Go-Faster Consultancy Ltd.

35 Graphing AWR A war story… Come back after lunch, and I’ll explain what was going on here, and where it led… Graphing AWR Data in Excel ©2009 ©2009 Go-Faster Consultancy Ltd.

36 A real system Graphing AWR Data in Excel ©2009 www.go-faster.co.uk
©2009 Go-Faster Consultancy Ltd.


Download ppt "Graphing AWR Data in Excel"

Similar presentations


Ads by Google