oracle 10g performance: chapter 00 intro live_short

42
Oracle Performance Tuning Kyle Hailey [email protected] dboptimizer.com

Upload: kyle-hailey

Post on 27-Jan-2015

109 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Oracle 10g Performance: chapter 00 intro live_short

Oracle Performance Tuning

Kyle Hailey

[email protected]

dboptimizer.com

Page 2: Oracle 10g Performance: chapter 00 intro live_short

Who is Kyle Hailey

1990 Oracle 90 support 92 Ported v6 93 France 95 Benchmarking 98 ST Real World Performance

2000 Dot.Com 2001 Quest 2002 Oracle OEM 10g Success!Success!

First successful OEM designFirst successful OEM design

Page 3: Oracle 10g Performance: chapter 00 intro live_short

Who is Kyle Hailey

1990 Oracle 90 support 92 Ported v6 93 France 95 Benchmarking 98 ST Real World Performance

2000 Dot.Com 2001 Quest 2002 Oracle OEM 10g 2005 Embarcadero

DB Optimizer

Page 4: Oracle 10g Performance: chapter 00 intro live_short

Who is Kyle Hailey

1990 Oracle 90 support 92 Ported v6 93 France 95 Benchmarking 98 ST Real World Performance

2000 Dot.Com 2001 Quest 2002 Oracle OEM 10g 2005 Embarcadero

DB Optimizer Delphix

When not being a Geek- Have a little 4 year old boy who takes up all my time

Page 5: Oracle 10g Performance: chapter 00 intro live_short

Typical Architecture

DatabaseDatabase

File systemFile system

ProductionProduction

InstanceInstance

DatabaseDatabase

File systemFile system

DevelopmentDevelopment

InstanceInstance

DatabaseDatabase

File systemFile system

QAQA

InstanceInstance

DatabaseDatabase

UATUAT

InstanceInstance

File systemFile system

Page 6: Oracle 10g Performance: chapter 00 intro live_short

Database Virtualization

DevelopmentDevelopment

InstanceInstance

DatabaseDatabase

ProductionProduction

InstanceInstance

File systemFile system

vDatabasevDatabase

QAQA

InstanceInstance

UATUAT

InstanceInstance

vDatabasevDatabase vDatabasevDatabaseNFSNFS

Source Source Clones Clones

Fiber Fiber ChannelChannel

Page 7: Oracle 10g Performance: chapter 00 intro live_short

My Goal

Simplify the information

and empower the DBA

Page 8: Oracle 10g Performance: chapter 00 intro live_short

How do you tune a Database?

“Database is running slow!”

•What :

• first step?

• questions do you ask?

• tools?

Do you have a repeatable method?

Page 9: Oracle 10g Performance: chapter 00 intro live_short

What statistics do you look at?

Page 10: Oracle 10g Performance: chapter 00 intro live_short

Launch: Pressure

Midnight January 28, 1986 Lives are on the line

Thanks to Edward Tufte

Page 11: Oracle 10g Performance: chapter 00 intro live_short

13 Pages Faxed

Page 12: Oracle 10g Performance: chapter 00 intro live_short

Original Engineering data

only showed damage

““damages at the hottest damages at the hottest and coldest temperatureand coldest temperature””

- - managementmanagement

Page 13: Oracle 10g Performance: chapter 00 intro live_short

Congressional Hearings Evidence

Page 14: Oracle 10g Performance: chapter 00 intro live_short

Clearer

1. Include successes

2. Mark Differences

3. Normalize same temp

4. Scale known vs unknown

5555 6565 75756060 7070 8080

44

88

1212

44

88

1212

3030 4040 50503535 4545

XX

Page 15: Oracle 10g Performance: chapter 00 intro live_short

Difficult

NASA Engineers Fail Congressional Investigators Fail Data Visualization is Difficult

But …

Lack of Clarity can be devastating

Page 16: Oracle 10g Performance: chapter 00 intro live_short

What statistics do you look at?

AASAAS

Page 17: Oracle 10g Performance: chapter 00 intro live_short

Solutions

• Clear Identification• Know how to identify problems and issues

• Access to details• Provide solutions and/or information to address the issues

• Graphics• Easy understanding, effective communication and discussion

Page 18: Oracle 10g Performance: chapter 00 intro live_short

First Step: Graphics

“The humans … are exceptionally good at parsing visual information, especially when that information is coded by color and/or .”

Knowledge representation in cognitive science. Westbury, C. & Wilensky, U. (1998)

motionmotion

Page 19: Oracle 10g Performance: chapter 00 intro live_short

Why Use Graphics

  You can't imagine how many times I was told that nobody wanted or would use graphics …

-- Jef Raskin, the creator of the Macintosh

Infocus – (overhead projectors) sited a study that humans can parse graphical information 400,000 times faster than textual data

Page 20: Oracle 10g Performance: chapter 00 intro live_short

Counties in US

3101 Counties 50 pages

Page 21: Oracle 10g Performance: chapter 00 intro live_short

“If I can't picture it, I can't understand it”Anscombe's Quartet

I II III IVx y x y x y x y

10 8.04 10 9.14 10 7.46 8 6.588 6.95 8 8.14 8 6.77 8 5.76

13 7.58 13 8.74 13 12.74 8 7.719 8.81 9 8.77 9 7.11 8 8.84

11 8.33 11 9.26 11 7.81 8 8.4714 9.96 14 8.1 14 8.84 8 7.04

6 7.24 6 6.13 6 6.08 8 5.254 4.26 4 3.1 4 5.39 19 12.5

12 10.84 12 9.13 12 8.15 8 5.567 4.82 7 7.26 7 6.42 8 7.915 5.68 5 4.74 5 5.73 8 6.89

Average 9 7.5 9 7.5 9 7.5 9 7.5Standard Deviation 3.31 2.03 3.31 2.03 3.31 2.03 3.31 2.03Linear Regression 1.33 1.33 1.33 1.33

- Albert Einstein- Albert Einstein

Page 22: Oracle 10g Performance: chapter 00 intro live_short

Graphics for Anscombe’s Quartet

Page 23: Oracle 10g Performance: chapter 00 intro live_short

What is a day in the life look like What is a day in the life look like for a DBA who has performance for a DBA who has performance issues?issues?

Tuning the Database

Anscombe's QuartetI II III IV

x y x y x y x yAverage 9 7.5 9 7.5 9 7.5 9 7.5Standard Deviation 3.31 2.03 3.31 2.03 3.31 2.03 3.31 2.03Linear Regression 1.33 1.33 1.33 1.33

ComplexComplex

AveragesAverages

Page 24: Oracle 10g Performance: chapter 00 intro live_short

LOADLOAD

Top Top Activity Activity

SQLSQL EventsEvents SessionsSessions

Max CPUMax CPU

(yard stick)(yard stick)

How Can We Open the Black Box?

Page 25: Oracle 10g Performance: chapter 00 intro live_short

LOADLOAD

Top Top Activity Activity

SQLSQL EventsEvents SessionsSessions

Get DetailsGet Details

Click hereClick here

Max CPUMax CPU

(yard stick)(yard stick)

How Can We Open the Black Box?

Page 26: Oracle 10g Performance: chapter 00 intro live_short

How Can We Open the Black Box?

OEM OEM ASHMON/SASHASHMON/SASH DB OptimizerDB Optimizer

•Powerful - Identifies issues quickly and powerfully

•Interactive - Allows exploring the data

•Easy - Understandable by everyone, DBA, Dev and Managers !

Page 27: Oracle 10g Performance: chapter 00 intro live_short

Ideas for Today

ASHASH

SamplingSampling

WaitsWaits

AASAAS

Page 28: Oracle 10g Performance: chapter 00 intro live_short

Before Tuning Oracle, Tune the Machine

Make sure the machine is healthy before tuning Oracle CPU => use run queue, < 2 * #CPU Memory => page out

VMSTAT

Page 29: Oracle 10g Performance: chapter 00 intro live_short

Sections

Statspack ASH AAS OEM 10g

Buffer Cache IO Redo Enqueues Shared Pool SQL*Net

SQL Tuning

Page 30: Oracle 10g Performance: chapter 00 intro live_short

Do You Want?

Engineering Data?Engineering Data?

Page 31: Oracle 10g Performance: chapter 00 intro live_short

Do You Want?

Pretty PicturesPretty Pictures

Page 32: Oracle 10g Performance: chapter 00 intro live_short

Do You Want?Clean and Clear Clean and Clear

? ? ? ? ? ? ? ? ? ?? ?

Page 33: Oracle 10g Performance: chapter 00 intro live_short

Imagine Trying to Drive your Car

And is updated once and hourAnd is updated once and hour

Or would you like it to Or would you like it to look …look …

Would you want your dashboard to look like :Would you want your dashboard to look like :

Page 34: Oracle 10g Performance: chapter 00 intro live_short

Or This

Page 35: Oracle 10g Performance: chapter 00 intro live_short

Embarcadero

35

Page 36: Oracle 10g Performance: chapter 00 intro live_short

Summary

1.Machine - vmstat Memory, CPU (we can see IO response in Oracle)

2.Database - AAS Use wait interface and graphics

Identify machine, application, database or SQL

3.SQL - VST Indexes, stats, execution path

Visual SQL Tuning

Page 37: Oracle 10g Performance: chapter 00 intro live_short

Bibliography

www.simple-talk.com/sql/performance/designing-efficient-sql-a-visual-approach/www.simple-talk.com/sql/performance/designing-efficient-sql-a-visual-approach/

Refactoring SQL Applications – Stephane Faroult

Troubleshooting Oracle Performance – Christian Antognini

SQL Tuning – Dan Tow

Cost-Based Oracle Fundamentals – Jonathan Lewis

Page 38: Oracle 10g Performance: chapter 00 intro live_short

Books

The Visual Display of Quantitative Information Eduard Tufte

Oracle Wait Interface Kirtikumar Deshpande, K. Gopalakrishnan

SQL Tuning Dan Tow

DesignDesign

WaitsWaits

SQL SQL

Page 39: Oracle 10g Performance: chapter 00 intro live_short

Books

Jonathan Lewis Cost-Based Oracle (Tough Read) Practical Oracle 8i (easy read)

Oracle Insights Kyle Hailey & Oaktable Members

Direct Direct Memory Memory AttachAttach

Oracle Oracle OptimizerOptimizer

Page 40: Oracle 10g Performance: chapter 00 intro live_short

END

Copyright 2006 Copyright 2006 Kyle HaileyKyle Hailey

Page 41: Oracle 10g Performance: chapter 00 intro live_short

When to Tune

1. Machinea) CPU

Response times skewed 100% CPU might be fine Users wait in queue (run queue) => machine

underpowered

b) Memory Paging Wait times skewed (ex : latch free) Erratic response times ( ex : ls )

2. Oracle1) Waits > CPU ?

tune waits

2) CPU > 100% ? tune top CPU SQL

3) Else It’s the application

Oracle Load Oracle Load (AAS)(AAS)

Top SessionTop Session Top WaitTop Wait Top SQLTop SQL

SQL DetailSQL Detail Session DetailSession Detail File DetailFile DetailObject DetailObject Detail Wait DetailWait Detail

HostHost

AAS > AAS > #CPU #CPU

AAS > 1AAS > 1Waits > Waits > CPUCPU

CPU > CPU > WaitsWaits

CPUCPU MemoryMemory

Page 42: Oracle 10g Performance: chapter 00 intro live_short

Summary

1.Database - AAS Profile database

Use wait interface and graphics

Identify machine, application, database or SQL

2.SQL - VST Indexes, stats, execution path

Visual SQL Tuning