Documente Academic
Documente Profesional
Documente Cultură
March 2008
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
Performance Tuning
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
2-1
2-1
2-2
2-2
2-3
iii
iv
Part III
4
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
6-1
6-2
6-3
6-3
6-4
6-5
6-5
6-6
6-8
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
vii
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
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
ix
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