55
Oracle Performance Tools of the Trade Carlos Sierra

Oracle Performance Tools of the Trade

Embed Size (px)

DESCRIPTION

Part of the Oracle Performance 101 Workshop

Citation preview

Page 1: Oracle Performance Tools of the Trade

Oracle PerformanceTools of the Trade

Carlos Sierra

Page 2: Oracle Performance Tools of the Trade

• Oracle Performance and SQL Tuning

• Consultant/Developer/DBA

• eDB360 and eAdam

• SQLT and SQLHC

• Exadata

Carlos Sierra

Enkitec (c) 2014 2

Page 3: Oracle Performance Tools of the Trade

Tools of the Trade

• OEM

• AWR

• ADDM

• ASH

• EDB360

Enkitec © 2014 3

Page 4: Oracle Performance Tools of the Trade

OEM

• Oracle Enterprise Manager (OEM)

– Database Control

– Grid Control

• GUI Tool for System Monitoring

– Including Performance

Enkitec © 2014 4

Page 5: Oracle Performance Tools of the Trade

Enkitec © 2014 5

Page 6: Oracle Performance Tools of the Trade

Enkitec © 2014 6

Page 7: Oracle Performance Tools of the Trade

Enkitec © 2014 7

Page 8: Oracle Performance Tools of the Trade

Enkitec © 2014 8

Page 9: Oracle Performance Tools of the Trade

Enkitec © 2014 9

Page 10: Oracle Performance Tools of the Trade

Enkitec © 2014 10

Page 11: Oracle Performance Tools of the Trade

Enkitec © 2014 11

Page 12: Oracle Performance Tools of the Trade

Enkitec © 2014 12

Page 13: Oracle Performance Tools of the Trade

Enkitec © 2014 13

Page 14: Oracle Performance Tools of the Trade

Enkitec © 2014 14

Page 15: Oracle Performance Tools of the Trade

Enkitec © 2014 15

Page 16: Oracle Performance Tools of the Trade

Enkitec © 2014 16

What is wrong?

Page 17: Oracle Performance Tools of the Trade

Enkitec © 2014 17

Page 18: Oracle Performance Tools of the Trade

AWR

• Automatic Workload Repository (AWR)

• Requires Oracle Diagnostics Pack License

• Set of DBA_HIST views

• Periodic Snapshots (1hr apart by default)

• 7 days history (by default)

Enkitec © 2014 18

Page 19: Oracle Performance Tools of the Trade

AWR Demo (1)

• Go to: carlos-sierra.net

• Right-hand side

• Downloads

– ECO Demos

Enkitec © 2014 19

Page 20: Oracle Performance Tools of the Trade

AWR Demo (2)

• Average Active Sessions (AAS)?

• DB CPU Utilization?

• Do you see any bottlenecks?

• What would be your action plan?

Enkitec © 2014 20

Page 21: Oracle Performance Tools of the Trade

Enkitec © 2014 21

Page 22: Oracle Performance Tools of the Trade

Enkitec © 2014 22

Page 23: Oracle Performance Tools of the Trade

Enkitec © 2014 23

Page 24: Oracle Performance Tools of the Trade

Enkitec © 2014 24

Page 25: Oracle Performance Tools of the Trade

Enkitec © 2014 25

Page 26: Oracle Performance Tools of the Trade

Enkitec © 2014 26

Page 27: Oracle Performance Tools of the Trade

Enkitec © 2014 27

Page 28: Oracle Performance Tools of the Trade

Enkitec © 2014 28

Page 29: Oracle Performance Tools of the Trade

Enkitec © 2014 29

Page 30: Oracle Performance Tools of the Trade

Enkitec © 2014 30

Page 31: Oracle Performance Tools of the Trade

Enkitec © 2014 31

Page 32: Oracle Performance Tools of the Trade

Enkitec © 2014 32

Page 33: Oracle Performance Tools of the Trade

Enkitec © 2014 33

Page 34: Oracle Performance Tools of the Trade

Enkitec © 2014 34

Page 35: Oracle Performance Tools of the Trade

AWR Demo Conclusions (1)

• High Parsing

– Use of Literals instead of Bind Variables

• Some suboptimal SQL wasting CPU cycles

• High Background Waits related to DBWR

• Write Back Flash Cache disabled

– Hard to detect!

Enkitec © 2014 35

Page 36: Oracle Performance Tools of the Trade

AWR Demo Conclusions (2)

• 6 copies of Control Files

– 2 members in 2 high redundancy disk groups

• Thousands of Tablespaces (thus Data Files)

• Frequent Log switches due to small size

– Think Checkpoints updating SCN on Data Files and Control Files

Enkitec © 2014 36

Page 37: Oracle Performance Tools of the Trade

AWR Demo Conclusions (3)

• There is usually more than 1 culprit– Even when performance is fine

• Database health-check is like any other– Early detection is preferred

• Motto: “if it ain't broke, don't fix it”– Really?

– Would you apply this motto to your own health?

Enkitec © 2014 37

Page 38: Oracle Performance Tools of the Trade

Alert Log

• As old as Oracle

• Like reading your Daily News

• Watch for ORA errors

– And fix them!

• Rename every so often

Enkitec © 2014 38

Page 39: Oracle Performance Tools of the Trade

ADDM (1)

• Automatic Database Diagnostic Monitor

• Requires Oracle Diagnostics Pack License

• Its goal is to reduce DB Time

– Wait and CPU time of all non-idle user sessions

• Based on AWR data

– Hourly execution by default

Enkitec © 2014 39

Page 40: Oracle Performance Tools of the Trade

ADDM (2)

• Database, Instance or Partial modes

• Available via OEM or SQL*Plus

– DBA_ADVISOR_* and DBA_ADDM_*

• Question Everything, including “Advice”

Enkitec © 2014 40

Page 41: Oracle Performance Tools of the Trade

Enkitec © 2014 41

ADDM Sample

Page 42: Oracle Performance Tools of the Trade

Enkitec © 2014 42

Page 43: Oracle Performance Tools of the Trade

ASH (1)

• Active Session History (ASH)

• Requires Oracle Diagnostics Pack License

• Active Session

– On CPU; or

– Non-idle Wait

Enkitec © 2014 43

Page 44: Oracle Performance Tools of the Trade

ASH (2)

• Snapshot of V$SESSION every second

– V$ACTIVE_SESSION_HISTORY

– Every 10 seconds on AWR

• DBA_HIST_ACTIVE_SESS_HISTORY

• Source of truth

• Multi-dimension

Enkitec © 2014 44

Page 45: Oracle Performance Tools of the Trade

Enkitec © 2014 45

ASH Sample

Page 46: Oracle Performance Tools of the Trade

EDB360

Enkitec © 2014 46

• 360-degree view of an Oracle database

• Database health-check and sizing

• 2 Parameters: Pack License [T|D|N] and Days

– @edb360.sql T 31

• Installs nothing

• Free download and use

Page 47: Oracle Performance Tools of the Trade

EDB360 Demo (1)

• Go to: carlos-sierra.net

• Right-hand side

• Downloads

– ECO Demos

Enkitec © 2014 47

Page 48: Oracle Performance Tools of the Trade

Enkitec © 2014 48

EDB360 Demo (2)

Page 49: Oracle Performance Tools of the Trade

EDB360 Demo (3)

• When was 11.2.0.3 BP21 applied?

• Is “_parallel_statement_queuing” modified?

• What is CPU peak demand for instance 1?

• How many invalid objects?

• How many SQL Plan Baselines?

• Are CBO System Statistics collected?

Enkitec © 2014 49

Page 50: Oracle Performance Tools of the Trade

Enkitec © 2014 50

Page 51: Oracle Performance Tools of the Trade

Enkitec © 2014 51

Page 52: Oracle Performance Tools of the Trade

Enkitec © 2014 52

Page 53: Oracle Performance Tools of the Trade

Conclusions

• OEM is “the” tool for Oracle Performance

• AWR, ADDM and ASH complement OEM

• EDB360 allows “offline” analysis

• Snapper is a good “session level” tool

• SQL Tuning requires the use of specialized tools

Enkitec © 2014 53

Page 54: Oracle Performance Tools of the Trade

References

• Oracle Database Performance Tuning Guide 11g Release 2

• Snapper - Tanel Poder

– http://blog.tanelpoder.com/files/scripts/snapper4.sql

• http://www.enkitec.com/products/edb360

Enkitec © 2014 54

Page 55: Oracle Performance Tools of the Trade

Contact Information

[email protected]

• carlos-sierra.net

• @csierra_usa

Enkitec © 2014 55