tune my database! mehr oracle sql performance über sqlhc - yann neuhaus, nicolas jardot, dbi...

18
© dbi services © dbi services dbi services SQL Health Check www.dbi-services.com 1 08.11.2012 Yann Neuhaus CEO – Region Manager Basel Area Mobile +41 79 963 27 20 [email protected] www.dbi-services.com Nicolas Jardot Consultant Mobile +41 79 835 02 95 [email protected] www.dbi-services.com

Upload: dbi-services

Post on 29-Nov-2014

755 views

Category:

Documents


4 download

DESCRIPTION

In dieser Sesssion zeigen wir Ihnen, wie Sie mit dem Oracle Tool SQL Health-Check (SQLHC) die SQL-Abfragen innerhalb Ihrer Datenbankumgebung einem Performance-Check unterziehen können. Mit SQLHC lassen sich sowohl die CBO-Statistiken als auch die Objekt-Statistiken und die Instanz-Parameter analysieren und optimieren.

TRANSCRIPT

© dbi services © dbi services

dbi services

SQL Health Check

www.dbi-services.com 1 08.11.2012

Yann Neuhaus

CEO – Region Manager Basel Area

Mobile +41 79 963 27 20

[email protected]

www.dbi-services.com

Nicolas Jardot

Consultant

Mobile +41 79 835 02 95

[email protected]

www.dbi-services.com

© dbi services © dbi services

Agenda Agenda

SQL Health Check

Agenda

i. Introduction

ii. Concept

iii. Usage

iv. Case study

www.dbi-services.com 2 08.11.2012

© dbi services © dbi services

Many parameters may influence SQL executions

CBO settings, Objects statistics,…

Tuning requires to check and analyze these parameters

Cloud Control allows to monitor SQLs to find which one is the more consuming

SQL Health Check

Introduction

www.dbi-services.com 3 08.11.2012

© dbi services © dbi services

SQL Health Check

Introduction – Highlight

www.dbi-services.com 4 08.11.2012

SQLHC

is a script from Oracle Download at My Oracle Support, note 1366133.1

dbi services advices to regularly check if new version is available

creates a report on an SQL statement

focus only on one statement

is available for free SQHC is not dependent of Tuning/Diagnostic Pack license

does not require installation

© dbi services © dbi services

SQL Health Check

Introduction – Highlight

www.dbi-services.com 5 08.11.2012

© dbi services © dbi services

Agenda Agenda

SQL Health Check

Agenda

i. Introduction

ii. Concept

iii. Usage

iv. Case study

www.dbi-services.com 6 08.11.2012

© dbi services © dbi services

How SQLHC script works?

Quickly get a report of the execution environment

Require SYS account or DBA role

Can be run locally of from distant client

Does not create objects in the database

SQL Health Check

Concept

www.dbi-services.com 7 08.11.2012

© dbi services © dbi services

What is checked?

CBO settings

Objects statistics

Instance parameters

Execution plans

SQL Health Check

Concept

www.dbi-services.com 8 08.11.2012

© dbi services © dbi services

SQL Health Check

Concept

www.dbi-services.com 9 08.11.2012

© dbi services © dbi services

SQL Health Check

Concept

www.dbi-services.com 10 08.11.2012

© dbi services © dbi services

Instance parameters

SQL Health Check

Concept

www.dbi-services.com 11 08.11.2012

© dbi services © dbi services

SQL Health Check

Concept

www.dbi-services.com 12 08.11.2012

© dbi services © dbi services

Agenda Agenda

SQL Health Check

Agenda

i. Introduction

ii. Concept

iii. Usage

iv. Case study

www.dbi-services.com 13 08.11.2012

© dbi services © dbi services

Run script from SQL Plus

License level

T: Tuning Pack

D: Diagnostic Pack

N: None

The output contains several files

SQL Health Check

Usage

www.dbi-services.com 14 08.11.2012

SQL> @sqlhc.sql [ T | D | N ] sql_id

*_1_health_check.html

*_2_diagnostics.html

*_3_execution_plans.html

[*_4_sql_detail.html]

[*_5_sql_monitor.zip]

[*_6_10053_trace_from_cursor.trc]

© dbi services © dbi services

Agenda Agenda

Edition Based Redefinition

Agenda

i. Introduction

ii. Concept

iii. Usage

iv. Case study

www.dbi-services.com 15 08.11.2012

© dbi services © dbi services

Human Resource Application

SQL Health Check

Case study

www.dbi-services.com 16 08.11.2012

© dbi services © dbi services

Full table scan on both tables EMPLOYEES and JOBS

Existing index IDX_JOB_TITLE on column present in the where clause not used

Why index is not used?

Bad/missing statistics or histograms

Instance parameters

Bad selectivity

Let’s focus on SQLHC report

SQL Health Check

Case study - Methodology

www.dbi-services.com 17 08.11.2012

© dbi services © dbi services

dbi services

Any Questions? Please Do Ask!

www.dbi-services.com 20 08.11.2012

„We look forward to working with you!“

Yann Neuhaus

CEO – Region Manager Basel Area

Mobile +41 79 963 27 20

[email protected]

www.dbi-services.com

Nicolas Jardot

Consultant

Mobile +41 79 835 02 95

[email protected]

www.dbi-services.com