Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Oracle Database 10G - Guided Application & Sql Tuning

Oracle Database 10G - Guided Application & Sql Tuning

Ratings: (0)|Views: 26 |Likes:
Published by api-3754658

More info:

Published by: api-3754658 on Oct 15, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

The Self-Managing Database:
Guided Application & SQL
Tuning

An Oracle White Paper
Nov. 2003
The Self-Managing Database: Guided Application &
SQL Tuning

Introduction........................................................................................... 3
Automatic SQL Tuning......................................................................... 6
Automatic Tuning Optimizer................................................................ 9
Statistics Analysis........................................................................... 10
SQL Profiling.................................................................................. 10
SQL Profile................................................................................. 11
Access Path Analysis...................................................................... 13
SQL Structure Analysis.................................................................. 13
SQL Tuning Sets................................................................................. 14
SQL Tuning Interface......................................................................... 16
Tuning ADDM SQL....................................................................... 16
Tuning Top SQL............................................................................. 17
Tuning an STS................................................................................ 17
Tuning Options............................................................................... 18
Viewing SQL Tuning Recommendations....................................... 19
DBMS_SQLTUNE Package............................................................... 21
Tuning Task Management.............................................................. 21
SQL Profile Management............................................................... 23
SQL Tuning Set Management........................................................ 23
Conclusion.......................................................................................... 25

The Self-Managing Database: Guided Application & SQL Tuning
Page 2
The Self-Managing Database: Guided Application &
SQL Tuning
INTRODUCTION

Over the past decade two clear trends have occurred: a) the database systems
have been deployed in new areas, such as electronic commerce, with new set of
database requirements, and b) the database applications have become
increasingly complex with support for very large numbers of concurrent users.
As a result, the performance of database systems has become highly visible and
thus critical to the success of the businesses running these applications.

One important part of database system performance tuning is the tuning of SQL
statements. SQL tuning involves three basic steps:

Identify high load or top SQL statements that are responsible for a large share of
the application workload and system resources, by looking at the past SQL
execution history available in the system (e.g., the cursor cache statistics stored
in the V$SQL dynamic view),

Verify that the execution plans produced by the query optimizer for these
statements perform reasonably well,
Take possible corrective actions to generate better execution plans for poorly
performing SQL statements.

The three steps are repeated until the system performance reaches a satisfactory
level or no more statements can be tuned. An expert, such as a DBA or an
application developer, who has a deep knowledge of the application and
database system usually performs this tuning process.

The corrective actions can be one or more of the following:

1. Gather or refresh the statistics that are used by the query optimizer to build an execution plan. For example, create a histogram on a column that contains skewed data,

2. Change the value of some configuration parameter that will affect how
the optimizer builds an execution plan. For example, set the value of
optimizer_mode to first_rows_10,

3. Rewrite the SQL statement to use appropriate SQL constructs. For
example, replace UNION by UNION-ALL operator when possible,
The Self-Managing Database: Guided Application & SQL Tuning
Page 3

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->