54
Experts for database solutions. DOAG Conference 2017 AWR and ASH for Standard Edition Marco Mischke, 22.11.2017

DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

  • Upload
    dotram

  • View
    218

  • Download
    1

Embed Size (px)

Citation preview

Page 1: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

DOAG Conference 2017

AWR and ASH for Standard Edition

Marco Mischke, 22.11.2017

Page 2: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

About me

Oracle DBA since 2000 and Version 7.3.4

Certified Professional 10g, 11g

RAC / Cluster Certified Expert 10g, 11g, 12c

Oracle ACE

@DBAMarco

dbamarco.wordpress.com

Page 3: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Facts and FiguresRobotron Datenbank-Software GmbH

Year of formation 1990

Legal form GmbH (Limited liability company, 8 associates)

Number of employees 433 (Status 09/2017)

Capital stock 2.4 million EUR

Turnover 2017 43.8 million EUR

Technology-Partner

ISO 9001 certified

Headquarters

Congress and Training Center

Page 4: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

The Robotron Company Group

Czech Rep.: Robotron Database Solutions s.r.o.

Switzerland: Robotron Schweiz GmbH

Austria: Robotron Austria GmbH

Russia: Robotron Rus GmbH

Germany: SASKIA® Informations-Systeme GmbH

Page 5: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

The Range of Services of Robotronwith branch-specific Expertise

Methodical and technological responsibility

Comprehensive expertise of industry-specific business processes

Page 6: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

AWR and ASH for Standard Edition

AWR and ASH for Standard Edition?

Simply not available.

Page 7: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Questions?

Marco MischkeLead Consultant Oracle Support

@DBAMarco

Phone: +49 351 [email protected]

www.robotron.de

dbamarco.wordpress.com

Page 8: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Agenda

Motivation

Automatic Workload Repository

Active Session History

All the rest

Page 9: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Motivation

The perfect world – from an Oracle Sales perspective

– The fully equiped Audi RS6 of the database

• Enterprise Edition

• Lots of licensed Options, especially Diagnostic & Tuning

Pictures: audi.de

Page 10: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Motivation

The perfect world – from an Oracle Sales perspective

– The fully equiped Audi RS6 of the database

• Enterprise Edition

• Lots of licensed Options, especially Diagnostic & Tuning

In contrast – the real world from our perspective

Pictures: audi.de

Page 11: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Motivation

The perfect world – from an Oracle Sales perspective

– The fully equiped Audi RS6 of the database

• Enterprise Edition

• Lots of licensed Options, especially Diagnostic & Tuning

In contrast – the real world from our perspective

– The Audi A4 base model, with some extras maybe

• Enterprise Edition

• No or few options like Partitioning

Pictures: audi.de

Page 12: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Motivation

The perfect world – from an Oracle Sales perspective

– The fully equiped Audi RS6 of the database

• Enterprise Edition

• Lots of licensed Options, especially Diagnostic & Tuning

In contrast – the real world from our perspective

– The Audi A4 base model, with some extras maybe

• Enterprise Edition

• No or few options like Partitioning

– The Audi A1 for the masses

• Standard Edition

• There are no options at all (beside RAC)

Pictures: audi.de

Page 13: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Motivation

What I use most with Diagnostic & Tuning

– What‘s going on currently?

• Top Activity

• Performance Overview

• ASH

– What was the problem with the database some time ago?

• Historic view of Top Activity

• Historic view of Performance

Basically the same data

Page 14: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Agenda

Motivation

Automatic Workload Repository

Active Session History

All the rest

Page 15: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

What it is

– Installed in every database automatically

– Periodic snapshots of performance views

– Stored in a set of tables

– Facility to generate reports for user-defined intervals

– Datasource for Advisors

Where it came from

– utlbstat / utlestat

– Statspack

What it needs

– Money $$$ - Enterprise Edition + Diagnostic Pack License

Page 16: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

What we have with Standard Edition / Enterprise Edition without Diagnostic Pack

– Statspack is still there

– Comes for free

– Lacks some information that AWR has (new metrics, service statistics, ASH, ADDM, …)

What to do to get it

– Install: ?/rdbms/admin/spcreate

– Automatic snapshot creation: ?/rdbms/admin/spauto

– Manual purging: ?/rdbms/sppurge

What it cannot do

– RAC / HTML formatted / Compare reports

– Advisors

Page 17: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Recommendation: Install Statspack before the race starts

– Create job to create periodic snapshots

– Set snapshot level to 7 SQL Plan and Segment statistics

– Maybe modify thresholds for gathering information

– Create automatic purge job based on „sppurge“

Benefits

– Information is there once a problem occurs

– Investigation can start right away

– No need to prepare special monitoring and wait for the problem to re-occur

Page 18: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Comparing AWR and Statspack Reports, what‘s inside that the other lacks

– awrrpt.sql spreport.sqlForeground Wait Class Top Process MemoryService StatisticsKey Instance Activity StatsIOStats by Filetype

– awrsqrpt.sql sprepsql.sql

Page 19: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

But why reports?

– They are just numbers for the specific interval

– Cannot show changes over time

Enterprise Manager can

– Show a timelime to give a rough overview (using AWR)

– Drill down to details (using ASH)

Charts are much more helpful than just numbers

Page 20: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Statspack – Do it yourself

– Captured values are absolute values since instance startup

– Need to get difference from one snapshot to next snapshot Tom Kyte: Analytic functions rock – they roll!

SELECT

s.snap_time,

v.value – lag(v.value) over (order by s.snap_time) realvalue

FROM

stats$snapshot s,

stats$sysstat v or any other table

WHERE …

Page 21: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Simple example query

selectto_char(sn.snap_time, 'dd.mm.yy hh24:mi') snap_time, s00.value - lag(s00.value) over (order by sn.snap_time) "db block gets", s01.value - lag(s01.value) over (order by sn.snap_time) "physical reads", s02.value - lag(s02.value) over (order by sn.snap_time) "consistent gets" from stats$snapshot snjoin stats$sysstat s00 on (sn.snap_id = s00.snap_id)join stats$sysstat s01 on (sn.snap_id = s01.snap_id)join stats$sysstat s02 on (sn.snap_id = s02.snap_id)where sn.snap_time between to_date('03.11.2017 10:30', 'dd.mm.yyyy hh24:mi')

and to_date('03.11.2017 14:45', 'dd.mm.yyyy hh24:mi') and s00.name = 'db block gets'and s01.name = 'physical reads' and s02.name = 'consistent gets' order by sn.snap_time

Page 22: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Build an APEX application

In red:the momentwhen reportqueries weredisabled inSwingBenchand physicalreads dropped

Page 23: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Use Excel to analyze Pivot Charts allow powerful analyzing / filtering

Page 24: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Build your own Reports with SQL Developer

Page 25: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Build your own Reports with SQL Developer

Page 26: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Build your own Reports with SQL Developer

Page 27: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Something happened…. Check system statistics

Page 28: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Something happened…. Check Tablespace I/O

Page 29: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Something happened…. between 08:08 and 08:23

Page 30: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Something happened…. between 08:08 and 08:23

Page 31: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Something happened…. between 08:08 and 08:23

Page 32: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Something happened…. between 08:08 and 08:23

Page 33: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Something different happened…. between 08:38 and 08:53

Page 34: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Something different happened…. between 08:38 and 08:53

Page 35: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Something different happened…. between 08:38 and 08:53

Page 36: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

Something different happened…. between 08:38 and 08:53

Page 37: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Automatic Workload Repository

There are a lot more tables inside STATSPACK

– Check PERFSTAT schema

– Tablenames match the system views V$*** STATS$***

Just be creative

Page 38: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Agenda

Motivation

Automatic Workload Repository

Active Session History

All the rest

Page 39: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Active Session History

What it is

– Installed in every database automatically

– Snapshot of active sessions every second

– Persisted and aggregated later on

Why it is needed

– AWR and Statspack snapshots have a good chance to miss single peaks

– Snapshot can only get what is in the cache and what exceeds thresholds

• SQLs running from 09:02 till 09:56

• SQL not using binds

– ASH will get it

What it needs

– Money $$$ - Enterprise Edition + Diagnostic Pack License

Page 40: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Active Session History

How to do it without ASH

– Just take a snapshot of (G)V$SESSION on your own

INSERT INTO my_own_ash

SELECT systimestamp, s.*

FROM v$session s

WHERE status = 'ACTIVE'

AND username is not null

AND audsid <> userenv('SESSIONID')

– Exclude your own session, it will be always „active“

– Maintain a list of timestamps when a snapshot was taken, just in case everything was idle

– Of cause it generates some overhead

Page 41: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Active Session History

How to visualize it, Enterprise Manager style

– Query the raw data

– Put it into Excel

– Create a Pivot Chart

Page 42: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Active Session History

Pivot Charts allow drill down

– Very flexible

Page 43: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Active Session History

Or, again, use SQL Developer

Page 44: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Active Session History

Or, again, build/use an APEX application

Page 45: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Active Session History

Enterprise Manager Activity Page

– Use Dominic Giles‘ „DB Time Monitor“: http://www.dominicgiles.com/dbtimeviewer.html

– Nice and sweet overview

– Can‘t drill down to sessions

– No real history

Page 46: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Active Session History

What‘s going on there?

Page 47: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Active Session History

Page 48: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Active Session History

You will hardly see it in the report

Nothing at all

Page 49: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Agenda

Motivation

Automatic Workload Repository

Active Session History

All the rest

Page 50: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

ASH – Snapper / Tanel Poder

Want to have a quick look?

– Use Tanel Poder‘s „Snapper“ script: http://blog.tanelpoder.com/

– „Most Advanced Oracle Troubleshooting Script on the Planet!”

– Monitor a specific session

– Monitor the whole system

– Powerful features

Page 51: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

ASH – Snapper / Tanel Poder

Page 52: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

All the rest – SQLd360 / Mauro Pagano

https://mauro-pagano.com/category/sqld360/

Detailed statistics for a specific SQL, limited with noDiagnostic/Tuning license

Page 53: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Die Datenbank-Spezialisten.

weitere Informationsmöglichkeiten

Über den Wolken – Grenzenlose Freiheit mit purem Metall?Florian Barth und Katharina Büchse - 21.11.2017, 11:00 Uhr, Raum PragSchwerpunkt: Infrastruktur

ODA X6M & DBVisit, braucht es mehr?Sven Illert - 21.11.2016, 17:00 Uhr, Raum PragSchwerpunkt: Infrastruktur

Flashback Database, Backup und Recovery in Oracle DB 12.2Jörg Sobottka- 22.11.2017, 09:00 Uhr, Raum ShanghaiSchwerpunkt: Datenbank

Oracle Database Appliance – What's New?Marco Friebe - 22.11.2017, 10:00 Uhr, Raum BudapestSchwerpunkt: Infrastruktur

AWR und ASH für die Standard EditionMarco Mischke - 22.2017, 14:00 Uhr, Raum ShanghaiSchwerpunkt: Datenbank

Workshop: Get in Touch with Oracle Bare Metal Cloud Services (BMCS)Katharina Büchse, Florian Barth, Dr. Ingo Laue (Oracle)

21.11.2017 14:00 – 16:00 Uhr22.11.2017 10:00 – 12:00 und 14:00 – 16:00Uhr23.11.2017 10:00 – 12:00 und 14:00 – 16:00Uhr

Raum: Foyer Oslo-IstanbulSchwerpunkt: Infrastruktur

INFORMATIONENam Robotron-Stand 226 auf Ebene 2 und auf www.robotron.de/DOAG

Page 54: DOAG Conference 2017 AWR and ASH for Standard Edition · PDF fileAutomatic Workload Repository Use Excel to analyze Pivot Charts allow powerful analyzing / filtering. Experts for database

Experts for database solutions.

Questions?

Marco MischkeLead Consultant Oracle Support

@DBAMarco

Phone: +49 351 [email protected]

www.robotron.de

dbamarco.wordpress.com