SlideShare ist ein Scribd-Unternehmen logo
1 von 474
Downloaden Sie, um offline zu lesen
Oracle® Database
Performance Tuning Guide
10g Release 2 (10.2)
B14211-03

March 2008
Oracle Database Performance Tuning Guide, 10g Release 2 (10.2)
B14211-03
Copyright © 2000, 2008, Oracle. All rights reserved.
Primary Author:

Immanuel Chan

Contributors: Aditya Agrawal, James Barlow, Vladimir Barriere, Ruth Baylis, Eric Belden, Pete Belknap,
Qiang Cao, Sunil Chakkappen, Sumanta Chatterjee, Alvaro Corena, Benoit Dageville, Dinesh Das, Karl Dias,
Vinayagam Djegaradjane, Harvey Eneman, Bjorn Engsig, Mike Feng, Cecilia Gervasio, Bhaskar Ghosh, Ray
Glasstone, Leslie Gloyd, Prabhaker Gongloor, Connie Dialeris Green, Russell Green, Joan Gregoire, Lester
Gutierrez, Lex de Haan, Karl Haas, Brian Hirano, Lilian Hobbs, Andrew Holdsworth, Mamdouh Ibrahim,
Hakan Jacobsson, Christopher Jones, Srinivas Kareenhalli, Feroz Khan, Stella Kister, Paul Lane, Sue K. Lee,
Herve Lejeune, Yunrui Li, Juan Loaiza, Diana Lorentz, George Lumpkin, Joe McDonald, Bill McKenna,
Mughees Minhas, Valarie Moore, Sujatha Muthulingam, Gary Ngai, Michael Orlowski, Kant C. Patel,
Richard Powell, Mark Ramacher, Shankar Raman, Yair Sarig, Uri Shaft, Vinay Srihari, Sankar Subramanian,
Margaret Susairaj, Hal Takahara, Misha Tyulenev, Mark Van de Wiel, Venkateshwaran Venkataramani,
Nitin Vengurlekar, Stephen Vivian, Simon Watt, Andrew Witkowski, Graham Wood, Khaled Yagoub,
Mohamed Zait
The Programs (which include both the software and documentation) contain proprietary information; they
are provided under a license agreement containing restrictions on use and disclosure and are also protected
by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly,
or decompilation of the Programs, except to the extent required to obtain interoperability with other
independently created software or as specified by law, is prohibited.
The information contained in this document is subject to change without notice. If you find any problems in
the documentation, please report them to us in writing. This document is not warranted to be error-free.
Except as may be expressly permitted in your license agreement for these Programs, no part of these
Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose.
If the Programs are delivered to the United States Government or anyone licensing or using the Programs
on behalf of the United States Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data
delivered to U.S. Government customers are "commercial computer software" or "commercial technical
data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental
regulations. As such, use, duplication, disclosure, modification, and adaptation of the Programs, including
documentation and technical data, shall be subject to the licensing restrictions set forth in the applicable
Oracle license agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19,
Commercial Computer Software--Restricted Rights (June 1987). Oracle USA, Inc., 500 Oracle Parkway,
Redwood City, CA 94065.
The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently
dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup,
redundancy and other measures to ensure the safe use of such applications if the Programs are used for such
purposes, and we disclaim liability for any damages caused by such use of the Programs.
Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
The Programs may provide links to Web sites and access to content, products, and services from third
parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites.
You bear all risks associated with the use of such content. If you choose to purchase any products or services
from a third party, the relationship is directly between you and the third party. Oracle is not responsible for:
(a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the
third party, including delivery of products or services and warranty obligations related to purchased
products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from
dealing with any third party.
Contents
Preface ............................................................................................................................................................. xxiii
Audience...................................................................................................................................................
Documentation Accessibility .................................................................................................................
Related Documents .................................................................................................................................
Conventions .............................................................................................................................................

xxiii
xxiii
xxiv
xxiv

What's New in Oracle Performance? ............................................................................................ xxv
Part I
1

Performance Tuning

Performance Tuning Overview
Introduction to Performance Tuning....................................................................................................
Performance Planning .......................................................................................................................
Instance Tuning ..................................................................................................................................
Performance Principles ..............................................................................................................
Baselines .......................................................................................................................................
The Symptoms and the Problems.............................................................................................
When to Tune .............................................................................................................................
Proactive Monitoring ..........................................................................................................
Bottleneck Elimination ........................................................................................................
SQL Tuning .........................................................................................................................................
Query Optimizer and Execution Plans ....................................................................................
Introduction to Performance Tuning Features and Tools ................................................................
Automatic Performance Tuning Features ......................................................................................
Additional Oracle Tools ....................................................................................................................
V$ Performance Views ...............................................................................................................

Part II
2

1-1
1-1
1-1
1-2
1-2
1-2
1-3
1-3
1-3
1-3
1-4
1-4
1-5
1-5
1-5

Performance Planning

Designing and Developing for Performance
Oracle Methodology ................................................................................................................................
Understanding Investment Options.....................................................................................................
Understanding Scalability......................................................................................................................
What is Scalability? ............................................................................................................................
System Scalability...............................................................................................................................

2-1
2-1
2-2
2-2
2-3
iii
Factors Preventing Scalability .......................................................................................................... 2-4
System Architecture................................................................................................................................. 2-5
Hardware and Software Components ............................................................................................ 2-5
Hardware Components.............................................................................................................. 2-5
CPU ........................................................................................................................................ 2-5
Memory ................................................................................................................................. 2-5
I/O Subsystem ..................................................................................................................... 2-5
Network ................................................................................................................................ 2-6
Software Components ................................................................................................................ 2-6
Managing the User Interface.............................................................................................. 2-6
Implementing Business Logic ............................................................................................ 2-6
Managing User Requests and Resource Allocation........................................................ 2-6
Managing Data and Transactions...................................................................................... 2-7
Configuring the Right System Architecture for Your Requirements ......................................... 2-7
Application Design Principles.............................................................................................................. 2-9
Simplicity In Application Design.................................................................................................. 2-10
Data Modeling ................................................................................................................................. 2-10
Table and Index Design.................................................................................................................. 2-10
Appending Columns to an Index or Using Index-Organized Tables .............................. 2-11
Using a Different Index Type................................................................................................. 2-11
B-Tree Indexes .................................................................................................................. 2-11
Bitmap Indexes ................................................................................................................. 2-11
Function-based Indexes .................................................................................................. 2-11
Partitioned Indexes........................................................................................................... 2-11
Reverse Key Indexes......................................................................................................... 2-12
Finding the Cost of an Index .................................................................................................. 2-12
Serializing within Indexes ...................................................................................................... 2-12
Ordering Columns in an Index .............................................................................................. 2-12
Using Views ..................................................................................................................................... 2-12
SQL Execution Efficiency ............................................................................................................... 2-13
Implementing the Application ..................................................................................................... 2-14
Trends in Application Development............................................................................................ 2-15
Workload Testing, Modeling, and Implementation ...................................................................... 2-16
Sizing Data ....................................................................................................................................... 2-16
Estimating Workloads .................................................................................................................... 2-17
Extrapolating From a Similar System ................................................................................... 2-17
Benchmarking........................................................................................................................... 2-17
Application Modeling .................................................................................................................... 2-18
Testing, Debugging, and Validating a Design ............................................................................ 2-18
Deploying New Applications ............................................................................................................. 2-19
Rollout Strategies ............................................................................................................................ 2-19
Performance Checklist.................................................................................................................... 2-20

3

Performance Improvement Methods
The Oracle Performance Improvement Method ................................................................................ 3-1
Steps in The Oracle Performance Improvement Method............................................................. 3-2
A Sample Decision Process for Performance Conceptual Modeling.......................................... 3-3

iv
Top Ten Mistakes Found in Oracle Systems .................................................................................. 3-4
Emergency Performance Methods ........................................................................................................ 3-6
Steps in the Emergency Performance Method............................................................................... 3-6

Part III
4

Optimizing Instance Performance

Configuring a Database for Performance
Performance Considerations for Initial Instance Configuration ....................................................
Initialization Parameters ...................................................................................................................
Configuring Undo Space...................................................................................................................
Sizing Redo Log Files ........................................................................................................................
Creating Subsequent Tablespaces....................................................................................................
Creating Permanent Tablespaces - Automatic Segment-Space Management ...................
Creating Temporary Tablespaces .............................................................................................
Creating and Maintaining Tables for Good Performance ...............................................................
Table Compression ............................................................................................................................
Estimating the Compression factor ..........................................................................................
Tuning to Achieve a Better Compression Ratio .....................................................................
Reclaiming Unused Space.................................................................................................................
Indexing Data .....................................................................................................................................
Specifying Memory for Sorting Data .......................................................................................
Performance Considerations for Shared Servers ...............................................................................
Identifying Contention Using the Dispatcher-Specific Views ....................................................
Reducing Contention for Dispatcher Processes .....................................................................
Identifying Contention for Shared Servers.....................................................................................

5

4-1
4-1
4-3
4-3
4-4
4-4
4-5
4-5
4-6
4-6
4-6
4-6
4-7
4-7
4-7
4-8
4-9
4-9

Automatic Performance Statistics
Overview of Data Gathering.................................................................................................................. 5-1
Database Statistics .............................................................................................................................. 5-2
Wait Events .................................................................................................................................. 5-2
Time Model Statistics ................................................................................................................. 5-3
Active Session History (ASH) ................................................................................................... 5-3
System and Session Statistics .................................................................................................... 5-4
Operating System Statistics .............................................................................................................. 5-4
CPU Statistics............................................................................................................................... 5-5
Virtual Memory Statistics .......................................................................................................... 5-5
Disk Statistics............................................................................................................................... 5-5
Network Statistics ....................................................................................................................... 5-5
Operating System Data Gathering Tools................................................................................. 5-6
Interpreting Statistics......................................................................................................................... 5-6
Overview of the Automatic Workload Repository ............................................................................ 5-7
Snapshots............................................................................................................................................. 5-8
Baselines .............................................................................................................................................. 5-8
Space Consumption ........................................................................................................................... 5-8
Managing the Automatic Workload Repository ................................................................................ 5-9
Managing Snapshots....................................................................................................................... 5-10

v
Creating Snapshots ..................................................................................................................
Dropping Snapshots ................................................................................................................
Modifying Snapshot Settings .................................................................................................
Managing Baselines ........................................................................................................................
Creating a Baseline ..................................................................................................................
Dropping a Baseline ................................................................................................................
Transporting Automatic Workload Repository Data ................................................................
Extracting AWR Data ..............................................................................................................
Loading AWR Data..................................................................................................................
Using Automatic Workload Repository Views ..........................................................................
Generating Automatic Workload Repository Reports ..............................................................
Running the awrrpt.sql Report ..............................................................................................
Running the awrrpti.sql Report .............................................................................................
Running the awrsqrpt.sql Report ..........................................................................................
Running the awrsqrpi.sql Report ..........................................................................................
Running the awrddrpt.sql Report .........................................................................................
Running the awrddrpi.sql Report .........................................................................................
Generating Active Session History Reports ................................................................................
Running the ashrpt.sql Report ...............................................................................................
Running the ashrpti.sql Report..............................................................................................

6

Automatic Performance Diagnostics
Introduction to Database Diagnostic Monitoring .............................................................................
Automatic Database Diagnostic Monitor ............................................................................................
ADDM Analysis Results ...................................................................................................................
An ADDM Example...........................................................................................................................
Setting Up ADDM..............................................................................................................................
Diagnosing Database Performance Issues with ADDM...............................................................
Running ADDM Using addmrpt.sql........................................................................................
Running ADDM using DBMS_ADVISOR APIs.....................................................................
Views with ADDM Information ......................................................................................................

7

6-1
6-2
6-3
6-3
6-4
6-5
6-5
6-6
6-8

Memory Configuration and Use
Understanding Memory Allocation Issues .........................................................................................
Oracle Memory Caches .....................................................................................................................
Automatic Shared Memory Management ......................................................................................
Dynamically Changing Cache Sizes................................................................................................
Viewing Information About Dynamic Resize Operations....................................................
Application Considerations..............................................................................................................
Operating System Memory Use.......................................................................................................
Reduce paging .............................................................................................................................
Fit the SGA into main memory .................................................................................................
Allow adequate memory to individual users .........................................................................
Iteration During Configuration........................................................................................................
Configuring and Using the Buffer Cache............................................................................................
Using the Buffer Cache Effectively ..................................................................................................
Sizing the Buffer Cache .....................................................................................................................

vi

5-10
5-10
5-11
5-11
5-11
5-12
5-12
5-13
5-14
5-15
5-15
5-16
5-16
5-17
5-17
5-18
5-19
5-20
5-20
5-21

7-1
7-2
7-2
7-3
7-4
7-4
7-5
7-5
7-5
7-5
7-5
7-6
7-6
7-6
Buffer Cache Advisory Statistics .............................................................................................. 7-6
Using V$DB_CACHE_ADVICE ............................................................................................... 7-6
Calculating the Buffer Cache Hit Ratio.................................................................................... 7-8
Interpreting and Using the Buffer Cache Advisory Statistics ..................................................... 7-9
Increasing Memory Allocated to the Buffer Cache ............................................................. 7-10
Reducing Memory Allocated to the Buffer Cache .............................................................. 7-10
Considering Multiple Buffer Pools............................................................................................... 7-11
Random Access to Large Segments....................................................................................... 7-11
Oracle Real Application Cluster Instances........................................................................... 7-12
Using Multiple Buffer Pools ................................................................................................... 7-12
Buffer Pool Data in V$DB_CACHE_ADVICE ............................................................................ 7-12
Buffer Pool Hit Ratios ..................................................................................................................... 7-12
Determining Which Segments Have Many Buffers in the Pool ............................................... 7-13
KEEP Pool......................................................................................................................................... 7-14
RECYCLE Pool ................................................................................................................................ 7-15
Configuring and Using the Shared Pool and Large Pool .............................................................. 7-15
Shared Pool Concepts ..................................................................................................................... 7-16
Dictionary Cache Concepts .................................................................................................... 7-16
Library Cache Concepts .......................................................................................................... 7-16
SQL Sharing Criteria................................................................................................................ 7-17
Using the Shared Pool Effectively ................................................................................................ 7-18
Shared Cursors ........................................................................................................................ 7-19
Single-User Logon and Qualified Table Reference ............................................................. 7-19
Use of PL/SQL ......................................................................................................................... 7-20
Avoid Performing DDL .......................................................................................................... 7-20
Cache Sequence Numbers ...................................................................................................... 7-20
Cursor Access and Management ........................................................................................... 7-20
Reducing Parse Calls with OCI ...................................................................................... 7-21
Reducing Parse Calls with the Oracle Precompilers ................................................... 7-21
Reducing Parse Calls with SQLJ..................................................................................... 7-21
Reducing Parse Calls with JDBC .................................................................................... 7-21
Reducing Parse Calls with Oracle Forms ...................................................................... 7-21
Sizing the Shared Pool.................................................................................................................... 7-21
Shared Pool: Library Cache Statistics.................................................................................... 7-22
V$LIBRARYCACHE................................................................................................................ 7-22
Shared Pool Advisory Statistics ............................................................................................. 7-24
V$SHARED_POOL_ADVICE ........................................................................................ 7-24
V$LIBRARY_CACHE_MEMORY .................................................................................. 7-24
V$JAVA_POOL_ADVICE and V$JAVA_LIBRARY_CACHE_MEMORY............... 7-24
Shared Pool: Dictionary Cache Statistics .............................................................................. 7-24
Interpreting Shared Pool Statistics ............................................................................................... 7-26
Increasing Memory Allocation............................................................................................... 7-26
Allocating Additional Memory for the Library Cache ............................................... 7-26
Allocating Additional Memory to the Data Dictionary Cache .................................. 7-26
Reducing Memory Allocation ................................................................................................ 7-27
Using the Large Pool ...................................................................................................................... 7-27
Tuning the Large Pool and Shared Pool for the Shared Server Architecture ................. 7-27

vii
Determining an Effective Setting for Shared Server UGA Storage ...........................
Checking System Statistics in the V$SESSTAT View .................................................
Limiting Memory Use for Each User Session by Setting PRIVATE_SGA................
Reducing Memory Use with Three-Tier Connections.................................................
Using CURSOR_SPACE_FOR_TIME...........................................................................................
Caching Session Cursors ................................................................................................................
Configuring the Reserved Pool .....................................................................................................
Using SHARED_POOL_RESERVED_SIZE..........................................................................
When SHARED_POOL_RESERVED_SIZE Is Too Small...................................................
When SHARED_POOL_RESERVED_SIZE Is Too Large ..................................................
When SHARED_POOL_SIZE is Too Small .........................................................................
Keeping Large Objects to Prevent Aging ....................................................................................
CURSOR_SHARING for Existing Applications .........................................................................
Similar SQL Statements...........................................................................................................
CURSOR_SHARING ...............................................................................................................
When to use CURSOR_SHARING ........................................................................................
Maintaining Connections...............................................................................................................
Configuring and Using the Redo Log Buffer ..................................................................................
Sizing the Log Buffer ......................................................................................................................
Log Buffer Statistics ........................................................................................................................
PGA Memory Management ................................................................................................................
Configuring Automatic PGA Memory ........................................................................................
Setting PGA_AGGREGATE_TARGET Initially ..................................................................
Monitoring the Performance of the Automatic PGA Memory Management ................
V$PGASTAT......................................................................................................................
V$PROCESS.......................................................................................................................
V$PROCESS_MEMORY ..................................................................................................
V$SQL_WORKAREA_HISTOGRAM ...........................................................................
V$SQL_WORKAREA_ACTIVE......................................................................................
V$SQL_WORKAREA.......................................................................................................
Tuning PGA_AGGREGATE_TARGET ...............................................................................
V$PGA_TARGET_ADVICE ............................................................................................
How to Tune PGA_AGGREGATE_TARGET ..............................................................
V$PGA_TARGET_ADVICE_HISTOGRAM ................................................................
V$SYSSTAT and V$SESSTAT ................................................................................................
Configuring OLAP_PAGE_POOL_SIZE .....................................................................................

8

I/O Configuration and Design
Understanding I/O ...................................................................................................................................
Basic I/O Configuration ..........................................................................................................................
Lay Out the Files Using Operating System or Hardware Striping.............................................
Requested I/O Size.....................................................................................................................
Concurrency of I/O Requests ...................................................................................................
Alignment of Physical Stripe Boundaries with Block Size Boundaries ..............................
Manageability of the Proposed System ...................................................................................
Manually Distributing I/O ...............................................................................................................
When to Separate Files ......................................................................................................................

viii

7-28
7-28
7-29
7-30
7-30
7-30
7-31
7-32
7-32
7-32
7-32
7-33
7-33
7-34
7-34
7-34
7-35
7-35
7-36
7-36
7-37
7-38
7-39
7-39
7-39
7-41
7-42
7-42
7-44
7-44
7-46
7-46
7-49
7-50
7-51
7-51

8-1
8-1
8-2
8-2
8-3
8-3
8-4
8-4
8-5
Tables, Indexes, and TEMP Tablespaces .................................................................................
Redo Log Files .............................................................................................................................
Archived Redo Logs ...................................................................................................................
Three Sample Configurations...........................................................................................................
Stripe Everything Across Every Disk.......................................................................................
Move Archive Logs to Different Disks ....................................................................................
Move Redo Logs to Separate Disks ..........................................................................................
Oracle-Managed Files ........................................................................................................................
Tuning Oracle-Managed Files...................................................................................................
Choosing Data Block Size .................................................................................................................
Reads.............................................................................................................................................
Writes............................................................................................................................................
Block Size Advantages and Disadvantages ............................................................................

9

Understanding Operating System Resources
Understanding Operating System Performance Issues....................................................................
Using Operating System Caches......................................................................................................
Asynchronous I/O......................................................................................................................
FILESYSTEMIO_OPTIONS Initialization Parameter ............................................................
Memory Usage....................................................................................................................................
Buffer Cache Limits ....................................................................................................................
Parameters Affecting Memory Usage......................................................................................
Using Operating System Resource Managers................................................................................
Solving Operating System Problems ...................................................................................................
Performance Hints on UNIX-Based Systems .................................................................................
Performance Hints on Windows Systems ......................................................................................
Performance Hints on HP OpenVMS Systems ..............................................................................
Understanding CPU.................................................................................................................................
Finding System CPU Utilization ...........................................................................................................
Checking Memory Management .....................................................................................................
Paging and Swapping ...............................................................................................................
Oversize Page Tables .................................................................................................................
Checking I/O Management..............................................................................................................
Checking Network Management.....................................................................................................
Checking Process Management .......................................................................................................
Scheduling and Switching ........................................................................................................
Context Switching ......................................................................................................................
Post-wait Driver ...................................................................................................................
Memory-mapped System Timer........................................................................................
List I/O Interfaces to Submit Multiple Asynchronous I/Os in One Call....................
Starting New Operating System Processes .............................................................................

10

8-5
8-5
8-6
8-7
8-7
8-7
8-7
8-7
8-8
8-8
8-8
8-8
8-9

9-1
9-2
9-2
9-2
9-3
9-3
9-3
9-3
9-4
9-4
9-5
9-5
9-5
9-7
9-8
9-8
9-8
9-8
9-8
9-8
9-9
9-9
9-9
9-9
9-9
9-9

Instance Tuning Using Performance Views
Instance Tuning Steps .......................................................................................................................... 10-1
Define the Problem ......................................................................................................................... 10-2
Examine the Host System .............................................................................................................. 10-2

ix
CPU Usage ................................................................................................................................
Non-Oracle Processes.......................................................................................................
Oracle Processes................................................................................................................
Oracle CPU Statistics........................................................................................................
Interpreting CPU Statistics ..............................................................................................
Detecting I/O Problems..........................................................................................................
Network.....................................................................................................................................
Examine the Oracle Statistics.........................................................................................................
Setting the Level of Statistics Collection...............................................................................
V$STATISTICS_LEVEL ...................................................................................................
Wait Events ...............................................................................................................................
Dynamic Performance Views Containing Wait Event Statistics.......................................
System Statistics .......................................................................................................................
V$ACTIVE_SESSION_HISTORY ...................................................................................
V$SYSSTAT .......................................................................................................................
V$FILESTAT......................................................................................................................
V$ROLLSTAT....................................................................................................................
V$ENQUEUE_STAT ........................................................................................................
V$LATCH ..........................................................................................................................
Segment-Level Statistics..........................................................................................................
Implement and Measure Change..................................................................................................
Interpreting Oracle Statistics ..............................................................................................................
Examine Load ................................................................................................................................
Changing Load .......................................................................................................................
High Rates of Activity ...........................................................................................................
Using Wait Event Statistics to Drill Down to Bottlenecks.......................................................
Table of Wait Events and Potential Causes ...............................................................................
Additional Statistics......................................................................................................................
Redo Log Space Requests Statistic.......................................................................................
Read Consistency ..................................................................................................................
Table Fetch by Continued Row............................................................................................
Parse-Related Statistics..........................................................................................................
Wait Events Statistics..........................................................................................................................
SQL*Net Events .............................................................................................................................
SQL*Net message from client ..............................................................................................
Network Bottleneck........................................................................................................
Resource Bottleneck on the Client Process..................................................................
SQL*Net message from dblink.............................................................................................
SQL*Net more data to client.................................................................................................
buffer busy waits...........................................................................................................................
Causes ......................................................................................................................................
Actions .....................................................................................................................................
segment header ...............................................................................................................
data block .........................................................................................................................
undo header.....................................................................................................................
undo block .......................................................................................................................
db file scattered read.....................................................................................................................

x

10-3
10-3
10-3
10-3
10-3
10-4
10-5
10-5
10-5
10-6
10-6
10-6
10-8
10-8
10-8
10-8
10-8
10-8
10-8
10-8
10-9
10-9
10-10
10-10
10-10
10-10
10-12
10-13
10-13
10-13
10-14
10-15
10-16
10-17
10-17
10-17
10-18
10-18
10-18
10-18
10-18
10-19
10-19
10-19
10-19
10-20
10-20
Actions .....................................................................................................................................
Managing Excessive I/O.......................................................................................................
Inadequate I/O Distribution ................................................................................................
Finding the SQL Statement executed by Sessions Waiting for I/O ...............................
Finding the Object Requiring I/O .......................................................................................
db file sequential read ..................................................................................................................
Actions .....................................................................................................................................
direct path read and direct path read temp ..............................................................................
Causes ......................................................................................................................................
Actions .....................................................................................................................................
Sorts to Disk ....................................................................................................................
Full Table Scans...............................................................................................................
Hash Area Size ................................................................................................................
direct path write and direct path write temp............................................................................
Causes ......................................................................................................................................
Actions .....................................................................................................................................
enqueue (enq:) waits .....................................................................................................................
Finding Locks and Lock Holders.........................................................................................
Actions .....................................................................................................................................
ST enqueue.......................................................................................................................
HW enqueue....................................................................................................................
TM enqueue.....................................................................................................................
TX enqueue ......................................................................................................................
events in wait class other .............................................................................................................
free buffer waits.............................................................................................................................
Causes ......................................................................................................................................
Actions .....................................................................................................................................
Writes................................................................................................................................
Cache is Too Small..........................................................................................................
Cache Is Too Big for One DBWR ..................................................................................
Consider Multiple Database Writer (DBWR) Processes or I/O Slaves..........................
DB_WRITER_PROCESSES............................................................................................
DBWR_IO_SLAVES .......................................................................................................
Choosing Between Multiple DBWR Processes and I/O Slaves ...............................
latch events.....................................................................................................................................
Actions .....................................................................................................................................
Example: Find Latches Currently Waited For ...................................................................
Shared Pool and Library Cache Latch Contention............................................................
Unshared SQL .................................................................................................................
Reparsed Sharable SQL..................................................................................................
By Session.........................................................................................................................
cache buffers lru chain ...................................................................................................
cache buffers chains........................................................................................................
row cache objects ............................................................................................................
log file parallel write.....................................................................................................................
library cache pin ............................................................................................................................
library cache lock...........................................................................................................................

10-20
10-20
10-21
10-21
10-21
10-21
10-22
10-22
10-23
10-23
10-23
10-23
10-23
10-24
10-24
10-24
10-24
10-25
10-25
10-25
10-26
10-26
10-26
10-27
10-27
10-27
10-27
10-27
10-27
10-28
10-28
10-28
10-28
10-28
10-29
10-29
10-29
10-31
10-31
10-31
10-31
10-32
10-32
10-33
10-33
10-33
10-33

xi
log buffer space..............................................................................................................................
log file switch .................................................................................................................................
Actions .....................................................................................................................................
log file sync.....................................................................................................................................
rdbms ipc reply..............................................................................................................................
Idle Wait Events...................................................................................................................................

Part IV
11

Optimizing SQL Statements

SQL Tuning Overview
Introduction to SQL Tuning ...............................................................................................................
Goals for Tuning ...................................................................................................................................
Reduce the Workload .....................................................................................................................
Balance the Workload.....................................................................................................................
Parallelize the Workload................................................................................................................
Identifying High-Load SQL ................................................................................................................
Identifying Resource-Intensive SQL ............................................................................................
Tuning a Specific Program .....................................................................................................
Tuning an Application / Reducing Load.............................................................................
Gathering Data on the SQL Identified .........................................................................................
Information to Gather During Tuning..................................................................................
Automatic SQL Tuning Features........................................................................................................
Developing Efficient SQL Statements ..............................................................................................
Verifying Optimizer Statistics .......................................................................................................
Reviewing the Execution Plan.......................................................................................................
Restructuring the SQL Statements................................................................................................
Compose Predicates Using AND and = ...............................................................................
Avoid Transformed Columns in the WHERE Clause ........................................................
Write Separate SQL Statements for Specific Tasks .............................................................
Use of EXISTS versus IN for Subqueries ..............................................................................
Example 1: Using IN - Selective Filters in the Subquery...........................................
Example 2: Using EXISTS - Selective Predicate in the Parent ..................................
Controlling the Access Path and Join Order with Hints .........................................................
Use Caution When Managing Views ..................................................................................
Use Caution When Joining Complex Views ...............................................................
Do Not Recycle Views....................................................................................................
Use Caution When Unnesting Subqueries..................................................................
Use Caution When Performing Outer Joins to Views ...............................................
Store Intermediate Results....................................................................................................
Restructuring the Indexes ...........................................................................................................
Modifying or Disabling Triggers and Constraints ...................................................................
Restructuring the Data .................................................................................................................
Maintaining Execution Plans Over Time...................................................................................
Visiting Data as Few Times as Possible ....................................................................................
Combine Multiples Scans with CASE Statements ............................................................
Use DML with RETURNING Clause .................................................................................
Modify All the Data Needed in One Statement ................................................................

xii

10-33
10-33
10-34
10-34
10-35
10-35

11-1
11-1
11-2
11-2
11-2
11-2
11-2
11-3
11-3
11-4
11-4
11-5
11-5
11-6
11-6
11-7
11-7
11-7
11-8
11-9
11-10
11-11
11-13
11-14
11-14
11-15
11-15
11-15
11-15
11-16
11-16
11-16
11-16
11-16
11-17
11-17
11-17
12

Automatic SQL Tuning
Automatic SQL Tuning Overview .....................................................................................................
Query Optimizer Modes ................................................................................................................
Normal mode............................................................................................................................
Tuning mode ............................................................................................................................
Types of Tuning Analysis ..............................................................................................................
Statistics Analysis.....................................................................................................................
SQL Profiling ............................................................................................................................
Access Path Analysis ...............................................................................................................
SQL Structure Analysis ...........................................................................................................
SQL Tuning Advisor ............................................................................................................................
Input Sources ...................................................................................................................................
Tuning Options................................................................................................................................
Advisor Output ..............................................................................................................................
Using SQL Tuning Advisor APIs..................................................................................................
Creating a SQL Tuning Task ..................................................................................................
Executing a SQL Tuning Task................................................................................................
Checking the Status of a SQL Tuning Task..........................................................................
Checking the Progress of the SQL Tuning Advisor............................................................
Displaying the Results of a SQL Tuning Task .....................................................................
Additional Operations on a SQL Tuning Task ....................................................................
SQL Tuning Sets....................................................................................................................................
Creating a SQL Tuning Set ..........................................................................................................
Loading a SQL Tuning Set ...........................................................................................................
Displaying the Contents of a SQL Tuning Set ..........................................................................
Modifying a SQL Tuning Set .......................................................................................................
Transporting a SQL Tuning Set...................................................................................................
Dropping a SQL Tuning Set ........................................................................................................
Additional Operations on SQL Tuning Sets..............................................................................
SQL Profiles .........................................................................................................................................
Accepting a SQL Profile ...............................................................................................................
Altering a SQL Profile ..................................................................................................................
Dropping a SQL Profile................................................................................................................
SQL Tuning Information Views ......................................................................................................

13

12-1
12-1
12-1
12-2
12-2
12-2
12-2
12-4
12-4
12-4
12-5
12-5
12-6
12-6
12-7
12-8
12-8
12-8
12-9
12-9
12-9
12-11
12-11
12-11
12-12
12-12
12-13
12-13
12-13
12-14
12-15
12-15
12-15

The Query Optimizer
Optimizer Operations...........................................................................................................................
Choosing an Optimizer Goal ..............................................................................................................
OPTIMIZER_MODE Initialization Parameter ............................................................................
Optimizer SQL Hints for Changing the Query Optimizer Goal ..............................................
Query Optimizer Statistics in the Data Dictionary ...................................................................
Enabling and Controlling Query Optimizer Features ...................................................................
Enabling Query Optimizer Features ............................................................................................
Controlling the Behavior of the Query Optimizer .....................................................................
Understanding the Query Optimizer ................................................................................................
Components of the Query Optimizer ..........................................................................................

13-1
13-2
13-3
13-4
13-4
13-4
13-5
13-5
13-6
13-7

xiii
Transforming Queries ............................................................................................................
View Merging....................................................................................................................
Predicate Pushing .............................................................................................................
Subquery Unnesting.........................................................................................................
Query Rewrite with Materialized Views ......................................................................
OR-expansion ....................................................................................................................
Peeking of User-Defined Bind Variables ..............................................................................
Estimating .................................................................................................................................
Selectivity ..........................................................................................................................
Cardinality ......................................................................................................................
Cost ..................................................................................................................................
Generating Plans ....................................................................................................................
Reading and Understanding Execution Plans ..........................................................................
Overview of EXPLAIN PLAN .............................................................................................
Steps in the Execution Plan...................................................................................................
Understanding Access Paths for the Query Optimizer................................................................
Full Table Scans .............................................................................................................................
Why a Full Table Scan Is Faster for Accessing Large Amounts of Data........................
When the Optimizer Uses Full Table Scans .......................................................................
Lack of Index ...................................................................................................................
Large Amount of Data ...................................................................................................
Small Table.......................................................................................................................
High Degree of Parallelism ...........................................................................................
Full Table Scan Hints.............................................................................................................
Parallel Query Execution ......................................................................................................
Rowid Scans ...................................................................................................................................
When the Optimizer Uses Rowids ......................................................................................
Index Scans.....................................................................................................................................
Assessing I/O for Blocks, not Rows....................................................................................
Index Unique Scans ...............................................................................................................
When the Optimizer Uses Index Unique Scans .........................................................
Index Unique Scan Hints ...............................................................................................
Index Range Scans .................................................................................................................
When the Optimizer Uses Index Range Scans ...........................................................
Index Range Scan Hints .................................................................................................
Index Range Scans Descending ...........................................................................................
When the Optimizer Uses Index Range Scans Descending .....................................
Index Range Scan Descending Hints ...........................................................................
Index Skip Scans.....................................................................................................................
Full Scans.................................................................................................................................
Fast Full Index Scans .............................................................................................................
Fast Full Index Scan Hints .............................................................................................
Index Joins...............................................................................................................................
Index Join Hints ..............................................................................................................
Bitmap Indexes .......................................................................................................................
Cluster Access................................................................................................................................
Hash Access ...................................................................................................................................

xiv

13-8
13-8
13-9
13-9
13-9
13-9
13-9
13-9
13-9
13-10
13-10
13-11
13-11
13-11
13-13
13-13
13-14
13-14
13-14
13-14
13-14
13-14
13-15
13-15
13-15
13-15
13-16
13-16
13-16
13-17
13-17
13-18
13-18
13-18
13-19
13-19
13-19
13-19
13-19
13-20
13-20
13-20
13-20
13-21
13-21
13-21
13-21
Sample Table Scans .......................................................................................................................
How the Query Optimizer Chooses an Access Path................................................................
Understanding Joins ..........................................................................................................................
How the Query Optimizer Executes Join Statements .............................................................
How the Query Optimizer Chooses Execution Plans for Joins ..............................................
Nested Loop Joins .........................................................................................................................
Nested Loop Example ...........................................................................................................
Outer loop ........................................................................................................................
Inner loop.........................................................................................................................
When the Optimizer Uses Nested Loop Joins ...................................................................
Nested Loop Join Hints.........................................................................................................
Nesting Nested Loops ...........................................................................................................
Hash Joins.......................................................................................................................................
When the Optimizer Uses Hash Joins.................................................................................
Hash Join Hints ......................................................................................................................
Sort Merge Joins ............................................................................................................................
When the Optimizer Uses Sort Merge Joins ......................................................................
Sort Merge Join Hints ............................................................................................................
Cartesian Joins ...............................................................................................................................
When the Optimizer Uses Cartesian Joins .........................................................................
Cartesian Join Hints...............................................................................................................
Outer Joins......................................................................................................................................
Nested Loop Outer Joins.......................................................................................................
Hash Join Outer Joins ............................................................................................................
Sort Merge Outer Joins..........................................................................................................
Full Outer Joins ......................................................................................................................

14

13-21
13-22
13-22
13-22
13-23
13-24
13-24
13-24
13-25
13-25
13-25
13-25
13-26
13-26
13-26
13-26
13-27
13-27
13-27
13-27
13-27
13-27
13-28
13-28
13-30
13-30

Managing Optimizer Statistics
Understanding Statistics ......................................................................................................................
Automatic Statistics Gathering...........................................................................................................
GATHER_STATS_JOB ...................................................................................................................
Enabling Automatic Statistics Gathering.....................................................................................
Considerations When Gathering Statistics..................................................................................
When to Use Manual Statistics ..............................................................................................
Restoring Previous Versions of Statistics .............................................................................
Locking Statistics......................................................................................................................
Manual Statistics Gathering................................................................................................................
Gathering Statistics with DBMS_STATS Procedures.................................................................
Statistics Gathering Using Sampling.....................................................................................
Parallel Statistics Gathering ...................................................................................................
Statistics on Partitioned Objects.............................................................................................
Column Statistics and Histograms ........................................................................................
Determining Stale Statistics ....................................................................................................
User-defined Statistics.............................................................................................................
When to Gather Statistics ...............................................................................................................
System Statistics ....................................................................................................................................
Workload Statistics .......................................................................................................................

14-1
14-2
14-2
14-3
14-3
14-3
14-4
14-4
14-5
14-5
14-6
14-6
14-7
14-7
14-7
14-8
14-8
14-8
14-10
xv
Gathering Workload Statistics .............................................................................................
Multiblock Read Count .........................................................................................................
Noworkload Statistics...................................................................................................................
Gathering Noworkload Statistics ........................................................................................
Managing Statistics.............................................................................................................................
Restoring Previous Versions of Statistics...................................................................................
Exporting and Importing Statistics.............................................................................................
Restoring Statistics Versus Importing or Exporting Statistics ................................................
Locking Statistics for a Table or Schema....................................................................................
Setting Statistics.............................................................................................................................
Estimating Statistics with Dynamic Sampling..........................................................................
How Dynamic Sampling Works ..........................................................................................
When to Use Dynamic Sampling.........................................................................................
How to Use Dynamic Sampling to Improve Performance ..............................................
Dynamic Sampling Levels ....................................................................................................
Handling Missing Statistics .........................................................................................................
Viewing Statistics ...............................................................................................................................
Statistics on Tables, Indexes and Columns................................................................................
Viewing Histograms .....................................................................................................................
Height-Balanced Histograms ...............................................................................................
Frequency Histograms .........................................................................................................

15

Using Indexes and Clusters
Understanding Index Performance....................................................................................................
Tuning the Logical Structure.........................................................................................................
Index Tuning using the SQLAccess Advisor ..............................................................................
Choosing Columns and Expressions to Index ............................................................................
Choosing Composite Indexes........................................................................................................
Choosing Keys for Composite Indexes.................................................................................
Ordering Keys for Composite Indexes .................................................................................
Writing Statements That Use Indexes ..........................................................................................
Writing Statements That Avoid Using Indexes ..........................................................................
Re-creating Indexes.........................................................................................................................
Compacting Indexes .......................................................................................................................
Using Nonunique Indexes to Enforce Uniqueness ....................................................................
Using Enabled Novalidated Constraints .....................................................................................
Using Function-based Indexes for Performance .............................................................................
Using Partitioned Indexes for Performance.....................................................................................
Using Index-Organized Tables for Performance ............................................................................
Using Bitmap Indexes for Performance ............................................................................................
Using Bitmap Join Indexes for Performance ...................................................................................
Using Domain Indexes for Performance ..........................................................................................
Using Clusters for Performance .......................................................................................................
Using Hash Clusters for Performance .............................................................................................

16

14-10
14-10
14-11
14-11
14-11
14-11
14-12
14-13
14-13
14-14
14-14
14-14
14-14
14-15
14-15
14-16
14-16
14-16
14-17
14-17
14-18

15-1
15-1
15-2
15-3
15-3
15-4
15-4
15-4
15-5
15-5
15-6
15-6
15-6
15-7
15-8
15-8
15-9
15-9
15-9
15-10
15-11

Using Optimizer Hints
Understanding Optimizer Hints ........................................................................................................ 16-1

xvi
Types of Hints..................................................................................................................................
Hints by Category ...........................................................................................................................
Hints for Optimization Approaches and Goals...................................................................
Hints for Access Paths.............................................................................................................
Hints for Query Transformations ..........................................................................................
Hints for Join Orders ...............................................................................................................
Hints for Join Operations........................................................................................................
Hints for Parallel Execution....................................................................................................
Additional Hints ......................................................................................................................
Specifying Hints....................................................................................................................................
Specifying a Full Set of Hints ........................................................................................................
Specifying a Query Block in a Hint ..............................................................................................
Specifying Global Table Hints.......................................................................................................
Specifying Complex Index Hints ..................................................................................................
Using Hints with Views.......................................................................................................................
Hints and Complex Views .............................................................................................................
Hints and Mergeable Views ..........................................................................................................
Hints and Nonmergeable Views.................................................................................................

17

16-1
16-2
16-2
16-3
16-3
16-4
16-4
16-4
16-5
16-5
16-5
16-6
16-7
16-8
16-9
16-9
16-9
16-10

SQL Access Advisor
Overview of the SQL Access Advisor in the DBMS_ADVISOR Package.................................
Overview of Using the SQL Access Advisor ..............................................................................
SQL Access Advisor Repository ............................................................................................
Using the SQL Access Advisor ...........................................................................................................
Steps for Using the SQL Access Advisor .....................................................................................
Privileges Needed to Use the SQL Access Advisor ...................................................................
Setting Up Tasks and Templates...................................................................................................
Creating Tasks ..........................................................................................................................
Using Templates.......................................................................................................................
Creating Templates..................................................................................................................
Managing Workloads .....................................................................................................................
Workload Objects.....................................................................................................................
Using Workloads .....................................................................................................................
Linking Tasks and Workloads .............................................................................................
Defining Workload Contents ...............................................................................................
SQL Tuning Sets..............................................................................................................
Loading User-Defined Workloads ...............................................................................
Loading SQL Cache Workloads ...................................................................................
Using Hypothetical Workloads ....................................................................................
Using Summary Advisor Oracle Database 9i Workloads.........................................
SQL Access Advisor Workload Parameters ...............................................................
Adding SQL Statements to a Workload .............................................................................
Deleting SQL Statements from a Workload.......................................................................
Changing SQL Statements in Workloads ...........................................................................
Maintaining Workloads ........................................................................................................
Setting Workload Attributes .........................................................................................
Resetting Workloads ......................................................................................................

17-1
17-2
17-5
17-5
17-5
17-6
17-6
17-7
17-7
17-8
17-8
17-9
17-9
17-10
17-10
17-10
17-11
17-12
17-13
17-13
17-14
17-14
17-15
17-15
17-16
17-16
17-16
xvii
Removing a Link Between a Workload and a Task...................................................
Removing Workloads............................................................................................................
Working with Recommendations...............................................................................................
Recommendation Options ....................................................................................................
Evaluation Mode....................................................................................................................
Generating Recommendations.............................................................................................
EXECUTE_TASK Procedure .........................................................................................
Viewing Recommendations .................................................................................................
SQL Workload Journal ..........................................................................................................
Stopping the Recommendation Process .............................................................................
Interrupting Tasks ..........................................................................................................
Canceling Tasks ..............................................................................................................
Marking Recommendations .................................................................................................
Modifying Recommendations..............................................................................................
Generating SQL Scripts .........................................................................................................
When Recommendations are no Longer Required ...........................................................
Performing a Quick Tune.............................................................................................................
Managing Tasks.............................................................................................................................
Updating Task Attributes .....................................................................................................
Deleting Tasks ........................................................................................................................
Setting the DAYS_TO_EXPIRE Parameter.........................................................................
Using SQL Access Advisor Constants .......................................................................................
Examples of Using the SQL Access Advisor.............................................................................
Recommendations From a User-Defined Workload ........................................................
Generate Recommendations Using a Task Template.......................................................
Filter a Workload from the SQL Cache...............................................................................
Evaluate Current Usage of Indexes and Materialized Views..........................................
Tuning Materialized Views for Fast Refresh and Query Rewrite.............................................
DBMS_ADVISOR.TUNE_MVIEW Procedure..........................................................................
TUNE_MVIEW Syntax and Operations .............................................................................
Accessing TUNE_MVIEW Output Results ........................................................................
USER_TUNE_MVIEW and DBA_TUNE_MVIEW Views ........................................
Script Generation DBMS_ADVISOR Function and Procedure................................
Fast Refreshable with Optimized Sub-Materialized View...............................................

18

Using Plan Stability
Using Plan Stability to Preserve Execution Plans ...........................................................................
Using Hints with Plan Stability.....................................................................................................
How Outlines Use Hints ........................................................................................................
Storing Outlines...............................................................................................................................
Enabling Plan Stability ...................................................................................................................
Using Supplied Packages to Manage Stored Outlines ..............................................................
Creating Outlines ............................................................................................................................
Using Category Names for Stored Outlines ........................................................................
Using Stored Outlines ....................................................................................................................
Viewing Outline Data.....................................................................................................................
Moving Outline Tables...................................................................................................................

xviii

17-16
17-17
17-17
17-17
17-18
17-18
17-19
17-19
17-23
17-23
17-23
17-24
17-24
17-24
17-25
17-26
17-26
17-27
17-27
17-28
17-28
17-28
17-29
17-29
17-31
17-32
17-33
17-34
17-35
17-35
17-36
17-37
17-37
17-41

18-1
18-1
18-2
18-2
18-3
18-3
18-3
18-4
18-4
18-6
18-6
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning
Oracle SQL Tunning

Weitere ähnliche Inhalte

Andere mochten auch

Presentatie Jozé v/d Sande 2013
Presentatie Jozé v/d Sande 2013Presentatie Jozé v/d Sande 2013
Presentatie Jozé v/d Sande 2013schippergroep
 
[sachsangtao.com] Sinh 12 ky yeu hoi thao cac truong chuyen hay
[sachsangtao.com] Sinh 12 ky yeu hoi thao cac truong chuyen hay[sachsangtao.com] Sinh 12 ky yeu hoi thao cac truong chuyen hay
[sachsangtao.com] Sinh 12 ky yeu hoi thao cac truong chuyen haySang Tao
 
The acl injury enigma
The acl injury enigmaThe acl injury enigma
The acl injury enigmahbarb003
 
Non contact acl injuries
Non contact acl injuriesNon contact acl injuries
Non contact acl injurieshbarb003
 
[sachsangtao.com] Ky yeu thhv 2010 vat ly
[sachsangtao.com] Ky yeu thhv 2010 vat ly[sachsangtao.com] Ky yeu thhv 2010 vat ly
[sachsangtao.com] Ky yeu thhv 2010 vat lySang Tao
 
[sachsangtao.com] Ky yeu trai he hung vuong mon hoa hoc
[sachsangtao.com] Ky yeu trai he hung vuong mon hoa hoc[sachsangtao.com] Ky yeu trai he hung vuong mon hoa hoc
[sachsangtao.com] Ky yeu trai he hung vuong mon hoa hocSang Tao
 
[sachsangtao.com] Ky yeu thhv english
[sachsangtao.com] Ky yeu thhv english[sachsangtao.com] Ky yeu thhv english
[sachsangtao.com] Ky yeu thhv englishSang Tao
 
Presentatie jan rutjes 2013
Presentatie jan rutjes 2013Presentatie jan rutjes 2013
Presentatie jan rutjes 2013schippergroep
 
Quy tich hua thuan phong
Quy tich hua thuan phongQuy tich hua thuan phong
Quy tich hua thuan phongSang Tao
 
Effective communication by mr. CHHUN Chanrith
Effective communication by mr. CHHUN ChanrithEffective communication by mr. CHHUN Chanrith
Effective communication by mr. CHHUN ChanrithChanrith Chhun
 

Andere mochten auch (12)

Presentatie Jozé v/d Sande 2013
Presentatie Jozé v/d Sande 2013Presentatie Jozé v/d Sande 2013
Presentatie Jozé v/d Sande 2013
 
biology lesson
biology lessonbiology lesson
biology lesson
 
[sachsangtao.com] Sinh 12 ky yeu hoi thao cac truong chuyen hay
[sachsangtao.com] Sinh 12 ky yeu hoi thao cac truong chuyen hay[sachsangtao.com] Sinh 12 ky yeu hoi thao cac truong chuyen hay
[sachsangtao.com] Sinh 12 ky yeu hoi thao cac truong chuyen hay
 
The acl injury enigma
The acl injury enigmaThe acl injury enigma
The acl injury enigma
 
Non contact acl injuries
Non contact acl injuriesNon contact acl injuries
Non contact acl injuries
 
[sachsangtao.com] Ky yeu thhv 2010 vat ly
[sachsangtao.com] Ky yeu thhv 2010 vat ly[sachsangtao.com] Ky yeu thhv 2010 vat ly
[sachsangtao.com] Ky yeu thhv 2010 vat ly
 
[sachsangtao.com] Ky yeu trai he hung vuong mon hoa hoc
[sachsangtao.com] Ky yeu trai he hung vuong mon hoa hoc[sachsangtao.com] Ky yeu trai he hung vuong mon hoa hoc
[sachsangtao.com] Ky yeu trai he hung vuong mon hoa hoc
 
[sachsangtao.com] Ky yeu thhv english
[sachsangtao.com] Ky yeu thhv english[sachsangtao.com] Ky yeu thhv english
[sachsangtao.com] Ky yeu thhv english
 
Presentatie jan rutjes 2013
Presentatie jan rutjes 2013Presentatie jan rutjes 2013
Presentatie jan rutjes 2013
 
Quy tich hua thuan phong
Quy tich hua thuan phongQuy tich hua thuan phong
Quy tich hua thuan phong
 
organisasi
organisasiorganisasi
organisasi
 
Effective communication by mr. CHHUN Chanrith
Effective communication by mr. CHHUN ChanrithEffective communication by mr. CHHUN Chanrith
Effective communication by mr. CHHUN Chanrith
 

Ähnlich wie Oracle SQL Tunning

Sql reference11 gr2
Sql reference11 gr2Sql reference11 gr2
Sql reference11 gr2xarlydbz
 
oracle easy upgrade to r12 details
oracle easy upgrade to r12 detailsoracle easy upgrade to r12 details
oracle easy upgrade to r12 detailsgundepudi
 
underground-php-oracle-manual
underground-php-oracle-manualunderground-php-oracle-manual
underground-php-oracle-manualtutorialsruby
 
underground-php-oracle-manual
underground-php-oracle-manualunderground-php-oracle-manual
underground-php-oracle-manualtutorialsruby
 
ORACLE DATABASE - Programmers Guide to the Oracle Precompilers.pdf
ORACLE DATABASE - Programmers Guide to the Oracle Precompilers.pdfORACLE DATABASE - Programmers Guide to the Oracle Precompilers.pdf
ORACLE DATABASE - Programmers Guide to the Oracle Precompilers.pdfPeter Asane
 
Oracle database 12c client installation guide 3
Oracle database 12c client installation guide 3Oracle database 12c client installation guide 3
Oracle database 12c client installation guide 3bupbechanhgmail
 
Odiun understanding oracle data integrator
Odiun understanding oracle data integratorOdiun understanding oracle data integrator
Odiun understanding oracle data integratorgutiejun
 
Oracle database 12c client installation guide 6
Oracle database 12c client installation guide 6Oracle database 12c client installation guide 6
Oracle database 12c client installation guide 6bupbechanhgmail
 
Engineering user guide
Engineering user guideEngineering user guide
Engineering user guideRajesh Kumar
 
Oracle® application server forms and reports services installation guide
Oracle® application server forms and reports services installation guideOracle® application server forms and reports services installation guide
Oracle® application server forms and reports services installation guideFITSFSd
 
Oracle® application server
Oracle® application serverOracle® application server
Oracle® application serverFITSFSd
 
Oracle database 12c sql tuning
Oracle database 12c sql tuningOracle database 12c sql tuning
Oracle database 12c sql tuningFemi Adeyemi
 

Ähnlich wie Oracle SQL Tunning (20)

B14200
B14200B14200
B14200
 
Sql reference11 gr2
Sql reference11 gr2Sql reference11 gr2
Sql reference11 gr2
 
E25494
E25494E25494
E25494
 
oracle easy upgrade to r12 details
oracle easy upgrade to r12 detailsoracle easy upgrade to r12 details
oracle easy upgrade to r12 details
 
underground-php-oracle-manual
underground-php-oracle-manualunderground-php-oracle-manual
underground-php-oracle-manual
 
underground-php-oracle-manual
underground-php-oracle-manualunderground-php-oracle-manual
underground-php-oracle-manual
 
ORACLE DATABASE - Programmers Guide to the Oracle Precompilers.pdf
ORACLE DATABASE - Programmers Guide to the Oracle Precompilers.pdfORACLE DATABASE - Programmers Guide to the Oracle Precompilers.pdf
ORACLE DATABASE - Programmers Guide to the Oracle Precompilers.pdf
 
Oracle 11g concept
Oracle 11g conceptOracle 11g concept
Oracle 11g concept
 
Backup and recovery basics
Backup and recovery basicsBackup and recovery basics
Backup and recovery basics
 
Oracle database 12c client installation guide 3
Oracle database 12c client installation guide 3Oracle database 12c client installation guide 3
Oracle database 12c client installation guide 3
 
Instalacion de apex
Instalacion de apexInstalacion de apex
Instalacion de apex
 
Odiun understanding oracle data integrator
Odiun understanding oracle data integratorOdiun understanding oracle data integrator
Odiun understanding oracle data integrator
 
Oracle_10g_PLSQL_Guia_Ref.pdf
Oracle_10g_PLSQL_Guia_Ref.pdfOracle_10g_PLSQL_Guia_Ref.pdf
Oracle_10g_PLSQL_Guia_Ref.pdf
 
Oracle database 12c client installation guide 6
Oracle database 12c client installation guide 6Oracle database 12c client installation guide 6
Oracle database 12c client installation guide 6
 
Engineering user guide
Engineering user guideEngineering user guide
Engineering user guide
 
Oracle® application server forms and reports services installation guide
Oracle® application server forms and reports services installation guideOracle® application server forms and reports services installation guide
Oracle® application server forms and reports services installation guide
 
Oracle® application server
Oracle® application serverOracle® application server
Oracle® application server
 
120faug
120faug120faug
120faug
 
Oracle 11g
Oracle 11gOracle 11g
Oracle 11g
 
Oracle database 12c sql tuning
Oracle database 12c sql tuningOracle database 12c sql tuning
Oracle database 12c sql tuning
 

Kürzlich hochgeladen

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Kürzlich hochgeladen (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Oracle SQL Tunning

  • 1. Oracle® Database Performance Tuning Guide 10g Release 2 (10.2) B14211-03 March 2008
  • 2. Oracle Database Performance Tuning Guide, 10g Release 2 (10.2) B14211-03 Copyright © 2000, 2008, Oracle. All rights reserved. Primary Author: Immanuel Chan Contributors: Aditya Agrawal, James Barlow, Vladimir Barriere, Ruth Baylis, Eric Belden, Pete Belknap, Qiang Cao, Sunil Chakkappen, Sumanta Chatterjee, Alvaro Corena, Benoit Dageville, Dinesh Das, Karl Dias, Vinayagam Djegaradjane, Harvey Eneman, Bjorn Engsig, Mike Feng, Cecilia Gervasio, Bhaskar Ghosh, Ray Glasstone, Leslie Gloyd, Prabhaker Gongloor, Connie Dialeris Green, Russell Green, Joan Gregoire, Lester Gutierrez, Lex de Haan, Karl Haas, Brian Hirano, Lilian Hobbs, Andrew Holdsworth, Mamdouh Ibrahim, Hakan Jacobsson, Christopher Jones, Srinivas Kareenhalli, Feroz Khan, Stella Kister, Paul Lane, Sue K. Lee, Herve Lejeune, Yunrui Li, Juan Loaiza, Diana Lorentz, George Lumpkin, Joe McDonald, Bill McKenna, Mughees Minhas, Valarie Moore, Sujatha Muthulingam, Gary Ngai, Michael Orlowski, Kant C. Patel, Richard Powell, Mark Ramacher, Shankar Raman, Yair Sarig, Uri Shaft, Vinay Srihari, Sankar Subramanian, Margaret Susairaj, Hal Takahara, Misha Tyulenev, Mark Van de Wiel, Venkateshwaran Venkataramani, Nitin Vengurlekar, Stephen Vivian, Simon Watt, Andrew Witkowski, Graham Wood, Khaled Yagoub, Mohamed Zait The Programs (which include both the software and documentation) contain proprietary information; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. This document is not warranted to be error-free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose. If the Programs are delivered to the United States Government or anyone licensing or using the Programs on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial Computer Software--Restricted Rights (June 1987). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065. The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and we disclaim liability for any damages caused by such use of the Programs. Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. The Programs may provide links to Web sites and access to content, products, and services from third parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites. You bear all risks associated with the use of such content. If you choose to purchase any products or services from a third party, the relationship is directly between you and the third party. Oracle is not responsible for: (a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the third party, including delivery of products or services and warranty obligations related to purchased products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from dealing with any third party.
  • 3. Contents Preface ............................................................................................................................................................. xxiii Audience................................................................................................................................................... Documentation Accessibility ................................................................................................................. Related Documents ................................................................................................................................. Conventions ............................................................................................................................................. xxiii xxiii xxiv xxiv What's New in Oracle Performance? ............................................................................................ xxv Part I 1 Performance Tuning Performance Tuning Overview Introduction to Performance Tuning.................................................................................................... Performance Planning ....................................................................................................................... Instance Tuning .................................................................................................................................. Performance Principles .............................................................................................................. Baselines ....................................................................................................................................... The Symptoms and the Problems............................................................................................. When to Tune ............................................................................................................................. Proactive Monitoring .......................................................................................................... Bottleneck Elimination ........................................................................................................ SQL Tuning ......................................................................................................................................... Query Optimizer and Execution Plans .................................................................................... Introduction to Performance Tuning Features and Tools ................................................................ Automatic Performance Tuning Features ...................................................................................... Additional Oracle Tools .................................................................................................................... V$ Performance Views ............................................................................................................... Part II 2 1-1 1-1 1-1 1-2 1-2 1-2 1-3 1-3 1-3 1-3 1-4 1-4 1-5 1-5 1-5 Performance Planning Designing and Developing for Performance Oracle Methodology ................................................................................................................................ Understanding Investment Options..................................................................................................... Understanding Scalability...................................................................................................................... What is Scalability? ............................................................................................................................ System Scalability............................................................................................................................... 2-1 2-1 2-2 2-2 2-3 iii
  • 4. Factors Preventing Scalability .......................................................................................................... 2-4 System Architecture................................................................................................................................. 2-5 Hardware and Software Components ............................................................................................ 2-5 Hardware Components.............................................................................................................. 2-5 CPU ........................................................................................................................................ 2-5 Memory ................................................................................................................................. 2-5 I/O Subsystem ..................................................................................................................... 2-5 Network ................................................................................................................................ 2-6 Software Components ................................................................................................................ 2-6 Managing the User Interface.............................................................................................. 2-6 Implementing Business Logic ............................................................................................ 2-6 Managing User Requests and Resource Allocation........................................................ 2-6 Managing Data and Transactions...................................................................................... 2-7 Configuring the Right System Architecture for Your Requirements ......................................... 2-7 Application Design Principles.............................................................................................................. 2-9 Simplicity In Application Design.................................................................................................. 2-10 Data Modeling ................................................................................................................................. 2-10 Table and Index Design.................................................................................................................. 2-10 Appending Columns to an Index or Using Index-Organized Tables .............................. 2-11 Using a Different Index Type................................................................................................. 2-11 B-Tree Indexes .................................................................................................................. 2-11 Bitmap Indexes ................................................................................................................. 2-11 Function-based Indexes .................................................................................................. 2-11 Partitioned Indexes........................................................................................................... 2-11 Reverse Key Indexes......................................................................................................... 2-12 Finding the Cost of an Index .................................................................................................. 2-12 Serializing within Indexes ...................................................................................................... 2-12 Ordering Columns in an Index .............................................................................................. 2-12 Using Views ..................................................................................................................................... 2-12 SQL Execution Efficiency ............................................................................................................... 2-13 Implementing the Application ..................................................................................................... 2-14 Trends in Application Development............................................................................................ 2-15 Workload Testing, Modeling, and Implementation ...................................................................... 2-16 Sizing Data ....................................................................................................................................... 2-16 Estimating Workloads .................................................................................................................... 2-17 Extrapolating From a Similar System ................................................................................... 2-17 Benchmarking........................................................................................................................... 2-17 Application Modeling .................................................................................................................... 2-18 Testing, Debugging, and Validating a Design ............................................................................ 2-18 Deploying New Applications ............................................................................................................. 2-19 Rollout Strategies ............................................................................................................................ 2-19 Performance Checklist.................................................................................................................... 2-20 3 Performance Improvement Methods The Oracle Performance Improvement Method ................................................................................ 3-1 Steps in The Oracle Performance Improvement Method............................................................. 3-2 A Sample Decision Process for Performance Conceptual Modeling.......................................... 3-3 iv
  • 5. Top Ten Mistakes Found in Oracle Systems .................................................................................. 3-4 Emergency Performance Methods ........................................................................................................ 3-6 Steps in the Emergency Performance Method............................................................................... 3-6 Part III 4 Optimizing Instance Performance Configuring a Database for Performance Performance Considerations for Initial Instance Configuration .................................................... Initialization Parameters ................................................................................................................... Configuring Undo Space................................................................................................................... Sizing Redo Log Files ........................................................................................................................ Creating Subsequent Tablespaces.................................................................................................... Creating Permanent Tablespaces - Automatic Segment-Space Management ................... Creating Temporary Tablespaces ............................................................................................. Creating and Maintaining Tables for Good Performance ............................................................... Table Compression ............................................................................................................................ Estimating the Compression factor .......................................................................................... Tuning to Achieve a Better Compression Ratio ..................................................................... Reclaiming Unused Space................................................................................................................. Indexing Data ..................................................................................................................................... Specifying Memory for Sorting Data ....................................................................................... Performance Considerations for Shared Servers ............................................................................... Identifying Contention Using the Dispatcher-Specific Views .................................................... Reducing Contention for Dispatcher Processes ..................................................................... Identifying Contention for Shared Servers..................................................................................... 5 4-1 4-1 4-3 4-3 4-4 4-4 4-5 4-5 4-6 4-6 4-6 4-6 4-7 4-7 4-7 4-8 4-9 4-9 Automatic Performance Statistics Overview of Data Gathering.................................................................................................................. 5-1 Database Statistics .............................................................................................................................. 5-2 Wait Events .................................................................................................................................. 5-2 Time Model Statistics ................................................................................................................. 5-3 Active Session History (ASH) ................................................................................................... 5-3 System and Session Statistics .................................................................................................... 5-4 Operating System Statistics .............................................................................................................. 5-4 CPU Statistics............................................................................................................................... 5-5 Virtual Memory Statistics .......................................................................................................... 5-5 Disk Statistics............................................................................................................................... 5-5 Network Statistics ....................................................................................................................... 5-5 Operating System Data Gathering Tools................................................................................. 5-6 Interpreting Statistics......................................................................................................................... 5-6 Overview of the Automatic Workload Repository ............................................................................ 5-7 Snapshots............................................................................................................................................. 5-8 Baselines .............................................................................................................................................. 5-8 Space Consumption ........................................................................................................................... 5-8 Managing the Automatic Workload Repository ................................................................................ 5-9 Managing Snapshots....................................................................................................................... 5-10 v
  • 6. Creating Snapshots .................................................................................................................. Dropping Snapshots ................................................................................................................ Modifying Snapshot Settings ................................................................................................. Managing Baselines ........................................................................................................................ Creating a Baseline .................................................................................................................. Dropping a Baseline ................................................................................................................ Transporting Automatic Workload Repository Data ................................................................ Extracting AWR Data .............................................................................................................. Loading AWR Data.................................................................................................................. Using Automatic Workload Repository Views .......................................................................... Generating Automatic Workload Repository Reports .............................................................. Running the awrrpt.sql Report .............................................................................................. Running the awrrpti.sql Report ............................................................................................. Running the awrsqrpt.sql Report .......................................................................................... Running the awrsqrpi.sql Report .......................................................................................... Running the awrddrpt.sql Report ......................................................................................... Running the awrddrpi.sql Report ......................................................................................... Generating Active Session History Reports ................................................................................ Running the ashrpt.sql Report ............................................................................................... Running the ashrpti.sql Report.............................................................................................. 6 Automatic Performance Diagnostics Introduction to Database Diagnostic Monitoring ............................................................................. Automatic Database Diagnostic Monitor ............................................................................................ ADDM Analysis Results ................................................................................................................... An ADDM Example........................................................................................................................... Setting Up ADDM.............................................................................................................................. Diagnosing Database Performance Issues with ADDM............................................................... Running ADDM Using addmrpt.sql........................................................................................ Running ADDM using DBMS_ADVISOR APIs..................................................................... Views with ADDM Information ...................................................................................................... 7 6-1 6-2 6-3 6-3 6-4 6-5 6-5 6-6 6-8 Memory Configuration and Use Understanding Memory Allocation Issues ......................................................................................... Oracle Memory Caches ..................................................................................................................... Automatic Shared Memory Management ...................................................................................... Dynamically Changing Cache Sizes................................................................................................ Viewing Information About Dynamic Resize Operations.................................................... Application Considerations.............................................................................................................. Operating System Memory Use....................................................................................................... Reduce paging ............................................................................................................................. Fit the SGA into main memory ................................................................................................. Allow adequate memory to individual users ......................................................................... Iteration During Configuration........................................................................................................ Configuring and Using the Buffer Cache............................................................................................ Using the Buffer Cache Effectively .................................................................................................. Sizing the Buffer Cache ..................................................................................................................... vi 5-10 5-10 5-11 5-11 5-11 5-12 5-12 5-13 5-14 5-15 5-15 5-16 5-16 5-17 5-17 5-18 5-19 5-20 5-20 5-21 7-1 7-2 7-2 7-3 7-4 7-4 7-5 7-5 7-5 7-5 7-5 7-6 7-6 7-6
  • 7. Buffer Cache Advisory Statistics .............................................................................................. 7-6 Using V$DB_CACHE_ADVICE ............................................................................................... 7-6 Calculating the Buffer Cache Hit Ratio.................................................................................... 7-8 Interpreting and Using the Buffer Cache Advisory Statistics ..................................................... 7-9 Increasing Memory Allocated to the Buffer Cache ............................................................. 7-10 Reducing Memory Allocated to the Buffer Cache .............................................................. 7-10 Considering Multiple Buffer Pools............................................................................................... 7-11 Random Access to Large Segments....................................................................................... 7-11 Oracle Real Application Cluster Instances........................................................................... 7-12 Using Multiple Buffer Pools ................................................................................................... 7-12 Buffer Pool Data in V$DB_CACHE_ADVICE ............................................................................ 7-12 Buffer Pool Hit Ratios ..................................................................................................................... 7-12 Determining Which Segments Have Many Buffers in the Pool ............................................... 7-13 KEEP Pool......................................................................................................................................... 7-14 RECYCLE Pool ................................................................................................................................ 7-15 Configuring and Using the Shared Pool and Large Pool .............................................................. 7-15 Shared Pool Concepts ..................................................................................................................... 7-16 Dictionary Cache Concepts .................................................................................................... 7-16 Library Cache Concepts .......................................................................................................... 7-16 SQL Sharing Criteria................................................................................................................ 7-17 Using the Shared Pool Effectively ................................................................................................ 7-18 Shared Cursors ........................................................................................................................ 7-19 Single-User Logon and Qualified Table Reference ............................................................. 7-19 Use of PL/SQL ......................................................................................................................... 7-20 Avoid Performing DDL .......................................................................................................... 7-20 Cache Sequence Numbers ...................................................................................................... 7-20 Cursor Access and Management ........................................................................................... 7-20 Reducing Parse Calls with OCI ...................................................................................... 7-21 Reducing Parse Calls with the Oracle Precompilers ................................................... 7-21 Reducing Parse Calls with SQLJ..................................................................................... 7-21 Reducing Parse Calls with JDBC .................................................................................... 7-21 Reducing Parse Calls with Oracle Forms ...................................................................... 7-21 Sizing the Shared Pool.................................................................................................................... 7-21 Shared Pool: Library Cache Statistics.................................................................................... 7-22 V$LIBRARYCACHE................................................................................................................ 7-22 Shared Pool Advisory Statistics ............................................................................................. 7-24 V$SHARED_POOL_ADVICE ........................................................................................ 7-24 V$LIBRARY_CACHE_MEMORY .................................................................................. 7-24 V$JAVA_POOL_ADVICE and V$JAVA_LIBRARY_CACHE_MEMORY............... 7-24 Shared Pool: Dictionary Cache Statistics .............................................................................. 7-24 Interpreting Shared Pool Statistics ............................................................................................... 7-26 Increasing Memory Allocation............................................................................................... 7-26 Allocating Additional Memory for the Library Cache ............................................... 7-26 Allocating Additional Memory to the Data Dictionary Cache .................................. 7-26 Reducing Memory Allocation ................................................................................................ 7-27 Using the Large Pool ...................................................................................................................... 7-27 Tuning the Large Pool and Shared Pool for the Shared Server Architecture ................. 7-27 vii
  • 8. Determining an Effective Setting for Shared Server UGA Storage ........................... Checking System Statistics in the V$SESSTAT View ................................................. Limiting Memory Use for Each User Session by Setting PRIVATE_SGA................ Reducing Memory Use with Three-Tier Connections................................................. Using CURSOR_SPACE_FOR_TIME........................................................................................... Caching Session Cursors ................................................................................................................ Configuring the Reserved Pool ..................................................................................................... Using SHARED_POOL_RESERVED_SIZE.......................................................................... When SHARED_POOL_RESERVED_SIZE Is Too Small................................................... When SHARED_POOL_RESERVED_SIZE Is Too Large .................................................. When SHARED_POOL_SIZE is Too Small ......................................................................... Keeping Large Objects to Prevent Aging .................................................................................... CURSOR_SHARING for Existing Applications ......................................................................... Similar SQL Statements........................................................................................................... CURSOR_SHARING ............................................................................................................... When to use CURSOR_SHARING ........................................................................................ Maintaining Connections............................................................................................................... Configuring and Using the Redo Log Buffer .................................................................................. Sizing the Log Buffer ...................................................................................................................... Log Buffer Statistics ........................................................................................................................ PGA Memory Management ................................................................................................................ Configuring Automatic PGA Memory ........................................................................................ Setting PGA_AGGREGATE_TARGET Initially .................................................................. Monitoring the Performance of the Automatic PGA Memory Management ................ V$PGASTAT...................................................................................................................... V$PROCESS....................................................................................................................... V$PROCESS_MEMORY .................................................................................................. V$SQL_WORKAREA_HISTOGRAM ........................................................................... V$SQL_WORKAREA_ACTIVE...................................................................................... V$SQL_WORKAREA....................................................................................................... Tuning PGA_AGGREGATE_TARGET ............................................................................... V$PGA_TARGET_ADVICE ............................................................................................ How to Tune PGA_AGGREGATE_TARGET .............................................................. V$PGA_TARGET_ADVICE_HISTOGRAM ................................................................ V$SYSSTAT and V$SESSTAT ................................................................................................ Configuring OLAP_PAGE_POOL_SIZE ..................................................................................... 8 I/O Configuration and Design Understanding I/O ................................................................................................................................... Basic I/O Configuration .......................................................................................................................... Lay Out the Files Using Operating System or Hardware Striping............................................. Requested I/O Size..................................................................................................................... Concurrency of I/O Requests ................................................................................................... Alignment of Physical Stripe Boundaries with Block Size Boundaries .............................. Manageability of the Proposed System ................................................................................... Manually Distributing I/O ............................................................................................................... When to Separate Files ...................................................................................................................... viii 7-28 7-28 7-29 7-30 7-30 7-30 7-31 7-32 7-32 7-32 7-32 7-33 7-33 7-34 7-34 7-34 7-35 7-35 7-36 7-36 7-37 7-38 7-39 7-39 7-39 7-41 7-42 7-42 7-44 7-44 7-46 7-46 7-49 7-50 7-51 7-51 8-1 8-1 8-2 8-2 8-3 8-3 8-4 8-4 8-5
  • 9. Tables, Indexes, and TEMP Tablespaces ................................................................................. Redo Log Files ............................................................................................................................. Archived Redo Logs ................................................................................................................... Three Sample Configurations........................................................................................................... Stripe Everything Across Every Disk....................................................................................... Move Archive Logs to Different Disks .................................................................................... Move Redo Logs to Separate Disks .......................................................................................... Oracle-Managed Files ........................................................................................................................ Tuning Oracle-Managed Files................................................................................................... Choosing Data Block Size ................................................................................................................. Reads............................................................................................................................................. Writes............................................................................................................................................ Block Size Advantages and Disadvantages ............................................................................ 9 Understanding Operating System Resources Understanding Operating System Performance Issues.................................................................... Using Operating System Caches...................................................................................................... Asynchronous I/O...................................................................................................................... FILESYSTEMIO_OPTIONS Initialization Parameter ............................................................ Memory Usage.................................................................................................................................... Buffer Cache Limits .................................................................................................................... Parameters Affecting Memory Usage...................................................................................... Using Operating System Resource Managers................................................................................ Solving Operating System Problems ................................................................................................... Performance Hints on UNIX-Based Systems ................................................................................. Performance Hints on Windows Systems ...................................................................................... Performance Hints on HP OpenVMS Systems .............................................................................. Understanding CPU................................................................................................................................. Finding System CPU Utilization ........................................................................................................... Checking Memory Management ..................................................................................................... Paging and Swapping ............................................................................................................... Oversize Page Tables ................................................................................................................. Checking I/O Management.............................................................................................................. Checking Network Management..................................................................................................... Checking Process Management ....................................................................................................... Scheduling and Switching ........................................................................................................ Context Switching ...................................................................................................................... Post-wait Driver ................................................................................................................... Memory-mapped System Timer........................................................................................ List I/O Interfaces to Submit Multiple Asynchronous I/Os in One Call.................... Starting New Operating System Processes ............................................................................. 10 8-5 8-5 8-6 8-7 8-7 8-7 8-7 8-7 8-8 8-8 8-8 8-8 8-9 9-1 9-2 9-2 9-2 9-3 9-3 9-3 9-3 9-4 9-4 9-5 9-5 9-5 9-7 9-8 9-8 9-8 9-8 9-8 9-8 9-9 9-9 9-9 9-9 9-9 9-9 Instance Tuning Using Performance Views Instance Tuning Steps .......................................................................................................................... 10-1 Define the Problem ......................................................................................................................... 10-2 Examine the Host System .............................................................................................................. 10-2 ix
  • 10. CPU Usage ................................................................................................................................ Non-Oracle Processes....................................................................................................... Oracle Processes................................................................................................................ Oracle CPU Statistics........................................................................................................ Interpreting CPU Statistics .............................................................................................. Detecting I/O Problems.......................................................................................................... Network..................................................................................................................................... Examine the Oracle Statistics......................................................................................................... Setting the Level of Statistics Collection............................................................................... V$STATISTICS_LEVEL ................................................................................................... Wait Events ............................................................................................................................... Dynamic Performance Views Containing Wait Event Statistics....................................... System Statistics ....................................................................................................................... V$ACTIVE_SESSION_HISTORY ................................................................................... V$SYSSTAT ....................................................................................................................... V$FILESTAT...................................................................................................................... V$ROLLSTAT.................................................................................................................... V$ENQUEUE_STAT ........................................................................................................ V$LATCH .......................................................................................................................... Segment-Level Statistics.......................................................................................................... Implement and Measure Change.................................................................................................. Interpreting Oracle Statistics .............................................................................................................. Examine Load ................................................................................................................................ Changing Load ....................................................................................................................... High Rates of Activity ........................................................................................................... Using Wait Event Statistics to Drill Down to Bottlenecks....................................................... Table of Wait Events and Potential Causes ............................................................................... Additional Statistics...................................................................................................................... Redo Log Space Requests Statistic....................................................................................... Read Consistency .................................................................................................................. Table Fetch by Continued Row............................................................................................ Parse-Related Statistics.......................................................................................................... Wait Events Statistics.......................................................................................................................... SQL*Net Events ............................................................................................................................. SQL*Net message from client .............................................................................................. Network Bottleneck........................................................................................................ Resource Bottleneck on the Client Process.................................................................. SQL*Net message from dblink............................................................................................. SQL*Net more data to client................................................................................................. buffer busy waits........................................................................................................................... Causes ...................................................................................................................................... Actions ..................................................................................................................................... segment header ............................................................................................................... data block ......................................................................................................................... undo header..................................................................................................................... undo block ....................................................................................................................... db file scattered read..................................................................................................................... x 10-3 10-3 10-3 10-3 10-3 10-4 10-5 10-5 10-5 10-6 10-6 10-6 10-8 10-8 10-8 10-8 10-8 10-8 10-8 10-8 10-9 10-9 10-10 10-10 10-10 10-10 10-12 10-13 10-13 10-13 10-14 10-15 10-16 10-17 10-17 10-17 10-18 10-18 10-18 10-18 10-18 10-19 10-19 10-19 10-19 10-20 10-20
  • 11. Actions ..................................................................................................................................... Managing Excessive I/O....................................................................................................... Inadequate I/O Distribution ................................................................................................ Finding the SQL Statement executed by Sessions Waiting for I/O ............................... Finding the Object Requiring I/O ....................................................................................... db file sequential read .................................................................................................................. Actions ..................................................................................................................................... direct path read and direct path read temp .............................................................................. Causes ...................................................................................................................................... Actions ..................................................................................................................................... Sorts to Disk .................................................................................................................... Full Table Scans............................................................................................................... Hash Area Size ................................................................................................................ direct path write and direct path write temp............................................................................ Causes ...................................................................................................................................... Actions ..................................................................................................................................... enqueue (enq:) waits ..................................................................................................................... Finding Locks and Lock Holders......................................................................................... Actions ..................................................................................................................................... ST enqueue....................................................................................................................... HW enqueue.................................................................................................................... TM enqueue..................................................................................................................... TX enqueue ...................................................................................................................... events in wait class other ............................................................................................................. free buffer waits............................................................................................................................. Causes ...................................................................................................................................... Actions ..................................................................................................................................... Writes................................................................................................................................ Cache is Too Small.......................................................................................................... Cache Is Too Big for One DBWR .................................................................................. Consider Multiple Database Writer (DBWR) Processes or I/O Slaves.......................... DB_WRITER_PROCESSES............................................................................................ DBWR_IO_SLAVES ....................................................................................................... Choosing Between Multiple DBWR Processes and I/O Slaves ............................... latch events..................................................................................................................................... Actions ..................................................................................................................................... Example: Find Latches Currently Waited For ................................................................... Shared Pool and Library Cache Latch Contention............................................................ Unshared SQL ................................................................................................................. Reparsed Sharable SQL.................................................................................................. By Session......................................................................................................................... cache buffers lru chain ................................................................................................... cache buffers chains........................................................................................................ row cache objects ............................................................................................................ log file parallel write..................................................................................................................... library cache pin ............................................................................................................................ library cache lock........................................................................................................................... 10-20 10-20 10-21 10-21 10-21 10-21 10-22 10-22 10-23 10-23 10-23 10-23 10-23 10-24 10-24 10-24 10-24 10-25 10-25 10-25 10-26 10-26 10-26 10-27 10-27 10-27 10-27 10-27 10-27 10-28 10-28 10-28 10-28 10-28 10-29 10-29 10-29 10-31 10-31 10-31 10-31 10-32 10-32 10-33 10-33 10-33 10-33 xi
  • 12. log buffer space.............................................................................................................................. log file switch ................................................................................................................................. Actions ..................................................................................................................................... log file sync..................................................................................................................................... rdbms ipc reply.............................................................................................................................. Idle Wait Events................................................................................................................................... Part IV 11 Optimizing SQL Statements SQL Tuning Overview Introduction to SQL Tuning ............................................................................................................... Goals for Tuning ................................................................................................................................... Reduce the Workload ..................................................................................................................... Balance the Workload..................................................................................................................... Parallelize the Workload................................................................................................................ Identifying High-Load SQL ................................................................................................................ Identifying Resource-Intensive SQL ............................................................................................ Tuning a Specific Program ..................................................................................................... Tuning an Application / Reducing Load............................................................................. Gathering Data on the SQL Identified ......................................................................................... Information to Gather During Tuning.................................................................................. Automatic SQL Tuning Features........................................................................................................ Developing Efficient SQL Statements .............................................................................................. Verifying Optimizer Statistics ....................................................................................................... Reviewing the Execution Plan....................................................................................................... Restructuring the SQL Statements................................................................................................ Compose Predicates Using AND and = ............................................................................... Avoid Transformed Columns in the WHERE Clause ........................................................ Write Separate SQL Statements for Specific Tasks ............................................................. Use of EXISTS versus IN for Subqueries .............................................................................. Example 1: Using IN - Selective Filters in the Subquery........................................... Example 2: Using EXISTS - Selective Predicate in the Parent .................................. Controlling the Access Path and Join Order with Hints ......................................................... Use Caution When Managing Views .................................................................................. Use Caution When Joining Complex Views ............................................................... Do Not Recycle Views.................................................................................................... Use Caution When Unnesting Subqueries.................................................................. Use Caution When Performing Outer Joins to Views ............................................... Store Intermediate Results.................................................................................................... Restructuring the Indexes ........................................................................................................... Modifying or Disabling Triggers and Constraints ................................................................... Restructuring the Data ................................................................................................................. Maintaining Execution Plans Over Time................................................................................... Visiting Data as Few Times as Possible .................................................................................... Combine Multiples Scans with CASE Statements ............................................................ Use DML with RETURNING Clause ................................................................................. Modify All the Data Needed in One Statement ................................................................ xii 10-33 10-33 10-34 10-34 10-35 10-35 11-1 11-1 11-2 11-2 11-2 11-2 11-2 11-3 11-3 11-4 11-4 11-5 11-5 11-6 11-6 11-7 11-7 11-7 11-8 11-9 11-10 11-11 11-13 11-14 11-14 11-15 11-15 11-15 11-15 11-16 11-16 11-16 11-16 11-16 11-17 11-17 11-17
  • 13. 12 Automatic SQL Tuning Automatic SQL Tuning Overview ..................................................................................................... Query Optimizer Modes ................................................................................................................ Normal mode............................................................................................................................ Tuning mode ............................................................................................................................ Types of Tuning Analysis .............................................................................................................. Statistics Analysis..................................................................................................................... SQL Profiling ............................................................................................................................ Access Path Analysis ............................................................................................................... SQL Structure Analysis ........................................................................................................... SQL Tuning Advisor ............................................................................................................................ Input Sources ................................................................................................................................... Tuning Options................................................................................................................................ Advisor Output .............................................................................................................................. Using SQL Tuning Advisor APIs.................................................................................................. Creating a SQL Tuning Task .................................................................................................. Executing a SQL Tuning Task................................................................................................ Checking the Status of a SQL Tuning Task.......................................................................... Checking the Progress of the SQL Tuning Advisor............................................................ Displaying the Results of a SQL Tuning Task ..................................................................... Additional Operations on a SQL Tuning Task .................................................................... SQL Tuning Sets.................................................................................................................................... Creating a SQL Tuning Set .......................................................................................................... Loading a SQL Tuning Set ........................................................................................................... Displaying the Contents of a SQL Tuning Set .......................................................................... Modifying a SQL Tuning Set ....................................................................................................... Transporting a SQL Tuning Set................................................................................................... Dropping a SQL Tuning Set ........................................................................................................ Additional Operations on SQL Tuning Sets.............................................................................. SQL Profiles ......................................................................................................................................... Accepting a SQL Profile ............................................................................................................... Altering a SQL Profile .................................................................................................................. Dropping a SQL Profile................................................................................................................ SQL Tuning Information Views ...................................................................................................... 13 12-1 12-1 12-1 12-2 12-2 12-2 12-2 12-4 12-4 12-4 12-5 12-5 12-6 12-6 12-7 12-8 12-8 12-8 12-9 12-9 12-9 12-11 12-11 12-11 12-12 12-12 12-13 12-13 12-13 12-14 12-15 12-15 12-15 The Query Optimizer Optimizer Operations........................................................................................................................... Choosing an Optimizer Goal .............................................................................................................. OPTIMIZER_MODE Initialization Parameter ............................................................................ Optimizer SQL Hints for Changing the Query Optimizer Goal .............................................. Query Optimizer Statistics in the Data Dictionary ................................................................... Enabling and Controlling Query Optimizer Features ................................................................... Enabling Query Optimizer Features ............................................................................................ Controlling the Behavior of the Query Optimizer ..................................................................... Understanding the Query Optimizer ................................................................................................ Components of the Query Optimizer .......................................................................................... 13-1 13-2 13-3 13-4 13-4 13-4 13-5 13-5 13-6 13-7 xiii
  • 14. Transforming Queries ............................................................................................................ View Merging.................................................................................................................... Predicate Pushing ............................................................................................................. Subquery Unnesting......................................................................................................... Query Rewrite with Materialized Views ...................................................................... OR-expansion .................................................................................................................... Peeking of User-Defined Bind Variables .............................................................................. Estimating ................................................................................................................................. Selectivity .......................................................................................................................... Cardinality ...................................................................................................................... Cost .................................................................................................................................. Generating Plans .................................................................................................................... Reading and Understanding Execution Plans .......................................................................... Overview of EXPLAIN PLAN ............................................................................................. Steps in the Execution Plan................................................................................................... Understanding Access Paths for the Query Optimizer................................................................ Full Table Scans ............................................................................................................................. Why a Full Table Scan Is Faster for Accessing Large Amounts of Data........................ When the Optimizer Uses Full Table Scans ....................................................................... Lack of Index ................................................................................................................... Large Amount of Data ................................................................................................... Small Table....................................................................................................................... High Degree of Parallelism ........................................................................................... Full Table Scan Hints............................................................................................................. Parallel Query Execution ...................................................................................................... Rowid Scans ................................................................................................................................... When the Optimizer Uses Rowids ...................................................................................... Index Scans..................................................................................................................................... Assessing I/O for Blocks, not Rows.................................................................................... Index Unique Scans ............................................................................................................... When the Optimizer Uses Index Unique Scans ......................................................... Index Unique Scan Hints ............................................................................................... Index Range Scans ................................................................................................................. When the Optimizer Uses Index Range Scans ........................................................... Index Range Scan Hints ................................................................................................. Index Range Scans Descending ........................................................................................... When the Optimizer Uses Index Range Scans Descending ..................................... Index Range Scan Descending Hints ........................................................................... Index Skip Scans..................................................................................................................... Full Scans................................................................................................................................. Fast Full Index Scans ............................................................................................................. Fast Full Index Scan Hints ............................................................................................. Index Joins............................................................................................................................... Index Join Hints .............................................................................................................. Bitmap Indexes ....................................................................................................................... Cluster Access................................................................................................................................ Hash Access ................................................................................................................................... xiv 13-8 13-8 13-9 13-9 13-9 13-9 13-9 13-9 13-9 13-10 13-10 13-11 13-11 13-11 13-13 13-13 13-14 13-14 13-14 13-14 13-14 13-14 13-15 13-15 13-15 13-15 13-16 13-16 13-16 13-17 13-17 13-18 13-18 13-18 13-19 13-19 13-19 13-19 13-19 13-20 13-20 13-20 13-20 13-21 13-21 13-21 13-21
  • 15. Sample Table Scans ....................................................................................................................... How the Query Optimizer Chooses an Access Path................................................................ Understanding Joins .......................................................................................................................... How the Query Optimizer Executes Join Statements ............................................................. How the Query Optimizer Chooses Execution Plans for Joins .............................................. Nested Loop Joins ......................................................................................................................... Nested Loop Example ........................................................................................................... Outer loop ........................................................................................................................ Inner loop......................................................................................................................... When the Optimizer Uses Nested Loop Joins ................................................................... Nested Loop Join Hints......................................................................................................... Nesting Nested Loops ........................................................................................................... Hash Joins....................................................................................................................................... When the Optimizer Uses Hash Joins................................................................................. Hash Join Hints ...................................................................................................................... Sort Merge Joins ............................................................................................................................ When the Optimizer Uses Sort Merge Joins ...................................................................... Sort Merge Join Hints ............................................................................................................ Cartesian Joins ............................................................................................................................... When the Optimizer Uses Cartesian Joins ......................................................................... Cartesian Join Hints............................................................................................................... Outer Joins...................................................................................................................................... Nested Loop Outer Joins....................................................................................................... Hash Join Outer Joins ............................................................................................................ Sort Merge Outer Joins.......................................................................................................... Full Outer Joins ...................................................................................................................... 14 13-21 13-22 13-22 13-22 13-23 13-24 13-24 13-24 13-25 13-25 13-25 13-25 13-26 13-26 13-26 13-26 13-27 13-27 13-27 13-27 13-27 13-27 13-28 13-28 13-30 13-30 Managing Optimizer Statistics Understanding Statistics ...................................................................................................................... Automatic Statistics Gathering........................................................................................................... GATHER_STATS_JOB ................................................................................................................... Enabling Automatic Statistics Gathering..................................................................................... Considerations When Gathering Statistics.................................................................................. When to Use Manual Statistics .............................................................................................. Restoring Previous Versions of Statistics ............................................................................. Locking Statistics...................................................................................................................... Manual Statistics Gathering................................................................................................................ Gathering Statistics with DBMS_STATS Procedures................................................................. Statistics Gathering Using Sampling..................................................................................... Parallel Statistics Gathering ................................................................................................... Statistics on Partitioned Objects............................................................................................. Column Statistics and Histograms ........................................................................................ Determining Stale Statistics .................................................................................................... User-defined Statistics............................................................................................................. When to Gather Statistics ............................................................................................................... System Statistics .................................................................................................................................... Workload Statistics ....................................................................................................................... 14-1 14-2 14-2 14-3 14-3 14-3 14-4 14-4 14-5 14-5 14-6 14-6 14-7 14-7 14-7 14-8 14-8 14-8 14-10 xv
  • 16. Gathering Workload Statistics ............................................................................................. Multiblock Read Count ......................................................................................................... Noworkload Statistics................................................................................................................... Gathering Noworkload Statistics ........................................................................................ Managing Statistics............................................................................................................................. Restoring Previous Versions of Statistics................................................................................... Exporting and Importing Statistics............................................................................................. Restoring Statistics Versus Importing or Exporting Statistics ................................................ Locking Statistics for a Table or Schema.................................................................................... Setting Statistics............................................................................................................................. Estimating Statistics with Dynamic Sampling.......................................................................... How Dynamic Sampling Works .......................................................................................... When to Use Dynamic Sampling......................................................................................... How to Use Dynamic Sampling to Improve Performance .............................................. Dynamic Sampling Levels .................................................................................................... Handling Missing Statistics ......................................................................................................... Viewing Statistics ............................................................................................................................... Statistics on Tables, Indexes and Columns................................................................................ Viewing Histograms ..................................................................................................................... Height-Balanced Histograms ............................................................................................... Frequency Histograms ......................................................................................................... 15 Using Indexes and Clusters Understanding Index Performance.................................................................................................... Tuning the Logical Structure......................................................................................................... Index Tuning using the SQLAccess Advisor .............................................................................. Choosing Columns and Expressions to Index ............................................................................ Choosing Composite Indexes........................................................................................................ Choosing Keys for Composite Indexes................................................................................. Ordering Keys for Composite Indexes ................................................................................. Writing Statements That Use Indexes .......................................................................................... Writing Statements That Avoid Using Indexes .......................................................................... Re-creating Indexes......................................................................................................................... Compacting Indexes ....................................................................................................................... Using Nonunique Indexes to Enforce Uniqueness .................................................................... Using Enabled Novalidated Constraints ..................................................................................... Using Function-based Indexes for Performance ............................................................................. Using Partitioned Indexes for Performance..................................................................................... Using Index-Organized Tables for Performance ............................................................................ Using Bitmap Indexes for Performance ............................................................................................ Using Bitmap Join Indexes for Performance ................................................................................... Using Domain Indexes for Performance .......................................................................................... Using Clusters for Performance ....................................................................................................... Using Hash Clusters for Performance ............................................................................................. 16 14-10 14-10 14-11 14-11 14-11 14-11 14-12 14-13 14-13 14-14 14-14 14-14 14-14 14-15 14-15 14-16 14-16 14-16 14-17 14-17 14-18 15-1 15-1 15-2 15-3 15-3 15-4 15-4 15-4 15-5 15-5 15-6 15-6 15-6 15-7 15-8 15-8 15-9 15-9 15-9 15-10 15-11 Using Optimizer Hints Understanding Optimizer Hints ........................................................................................................ 16-1 xvi
  • 17. Types of Hints.................................................................................................................................. Hints by Category ........................................................................................................................... Hints for Optimization Approaches and Goals................................................................... Hints for Access Paths............................................................................................................. Hints for Query Transformations .......................................................................................... Hints for Join Orders ............................................................................................................... Hints for Join Operations........................................................................................................ Hints for Parallel Execution.................................................................................................... Additional Hints ...................................................................................................................... Specifying Hints.................................................................................................................................... Specifying a Full Set of Hints ........................................................................................................ Specifying a Query Block in a Hint .............................................................................................. Specifying Global Table Hints....................................................................................................... Specifying Complex Index Hints .................................................................................................. Using Hints with Views....................................................................................................................... Hints and Complex Views ............................................................................................................. Hints and Mergeable Views .......................................................................................................... Hints and Nonmergeable Views................................................................................................. 17 16-1 16-2 16-2 16-3 16-3 16-4 16-4 16-4 16-5 16-5 16-5 16-6 16-7 16-8 16-9 16-9 16-9 16-10 SQL Access Advisor Overview of the SQL Access Advisor in the DBMS_ADVISOR Package................................. Overview of Using the SQL Access Advisor .............................................................................. SQL Access Advisor Repository ............................................................................................ Using the SQL Access Advisor ........................................................................................................... Steps for Using the SQL Access Advisor ..................................................................................... Privileges Needed to Use the SQL Access Advisor ................................................................... Setting Up Tasks and Templates................................................................................................... Creating Tasks .......................................................................................................................... Using Templates....................................................................................................................... Creating Templates.................................................................................................................. Managing Workloads ..................................................................................................................... Workload Objects..................................................................................................................... Using Workloads ..................................................................................................................... Linking Tasks and Workloads ............................................................................................. Defining Workload Contents ............................................................................................... SQL Tuning Sets.............................................................................................................. Loading User-Defined Workloads ............................................................................... Loading SQL Cache Workloads ................................................................................... Using Hypothetical Workloads .................................................................................... Using Summary Advisor Oracle Database 9i Workloads......................................... SQL Access Advisor Workload Parameters ............................................................... Adding SQL Statements to a Workload ............................................................................. Deleting SQL Statements from a Workload....................................................................... Changing SQL Statements in Workloads ........................................................................... Maintaining Workloads ........................................................................................................ Setting Workload Attributes ......................................................................................... Resetting Workloads ...................................................................................................... 17-1 17-2 17-5 17-5 17-5 17-6 17-6 17-7 17-7 17-8 17-8 17-9 17-9 17-10 17-10 17-10 17-11 17-12 17-13 17-13 17-14 17-14 17-15 17-15 17-16 17-16 17-16 xvii
  • 18. Removing a Link Between a Workload and a Task................................................... Removing Workloads............................................................................................................ Working with Recommendations............................................................................................... Recommendation Options .................................................................................................... Evaluation Mode.................................................................................................................... Generating Recommendations............................................................................................. EXECUTE_TASK Procedure ......................................................................................... Viewing Recommendations ................................................................................................. SQL Workload Journal .......................................................................................................... Stopping the Recommendation Process ............................................................................. Interrupting Tasks .......................................................................................................... Canceling Tasks .............................................................................................................. Marking Recommendations ................................................................................................. Modifying Recommendations.............................................................................................. Generating SQL Scripts ......................................................................................................... When Recommendations are no Longer Required ........................................................... Performing a Quick Tune............................................................................................................. Managing Tasks............................................................................................................................. Updating Task Attributes ..................................................................................................... Deleting Tasks ........................................................................................................................ Setting the DAYS_TO_EXPIRE Parameter......................................................................... Using SQL Access Advisor Constants ....................................................................................... Examples of Using the SQL Access Advisor............................................................................. Recommendations From a User-Defined Workload ........................................................ Generate Recommendations Using a Task Template....................................................... Filter a Workload from the SQL Cache............................................................................... Evaluate Current Usage of Indexes and Materialized Views.......................................... Tuning Materialized Views for Fast Refresh and Query Rewrite............................................. DBMS_ADVISOR.TUNE_MVIEW Procedure.......................................................................... TUNE_MVIEW Syntax and Operations ............................................................................. Accessing TUNE_MVIEW Output Results ........................................................................ USER_TUNE_MVIEW and DBA_TUNE_MVIEW Views ........................................ Script Generation DBMS_ADVISOR Function and Procedure................................ Fast Refreshable with Optimized Sub-Materialized View............................................... 18 Using Plan Stability Using Plan Stability to Preserve Execution Plans ........................................................................... Using Hints with Plan Stability..................................................................................................... How Outlines Use Hints ........................................................................................................ Storing Outlines............................................................................................................................... Enabling Plan Stability ................................................................................................................... Using Supplied Packages to Manage Stored Outlines .............................................................. Creating Outlines ............................................................................................................................ Using Category Names for Stored Outlines ........................................................................ Using Stored Outlines .................................................................................................................... Viewing Outline Data..................................................................................................................... Moving Outline Tables................................................................................................................... xviii 17-16 17-17 17-17 17-17 17-18 17-18 17-19 17-19 17-23 17-23 17-23 17-24 17-24 17-24 17-25 17-26 17-26 17-27 17-27 17-28 17-28 17-28 17-29 17-29 17-31 17-32 17-33 17-34 17-35 17-35 17-36 17-37 17-37 17-41 18-1 18-1 18-2 18-2 18-3 18-3 18-3 18-4 18-4 18-6 18-6