Skip Headers

Oracle9i Database Performance Tuning Guide and Reference
Release 2 (9.2)

Part Number A96533-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page Go to next page
View PDF


Preface

This preface contains these topics:

Audience

Oracle9i Database Performance Tuning Guide and Reference is an aid for people responsible for the operation, maintenance, and performance of Oracle. This book describes detailed ways to enhance Oracle performance by writing and tuning SQL properly, using performance tools, and optimizing instance performance. It also explains how to create an initial database for good performance and includes performance-related reference information.

This book could be useful for database administrators, application designers, and programmers. Readers should be familiar with Oracle9i, Oracle9i Database Performance Planning, the operating system, and application design before reading this manual.

Many client/server application programmers consider SQL a messaging language, because queries are issued and data is returned. However, client tools often generate inefficient SQL statements. Therefore, a good understanding of the database SQL processing engine is necessary for writing optimal SQL. This is especially true for high transaction processing systems.

Typically, SQL statements issued by OLTP applications operate on relatively few rows at a time. If an index can point to the exact rows that you want, then Oracle can construct an accurate plan to access those rows efficiently through the shortest possible path. In DSS environments, selectivity is less important, because they often access most of a table's rows. In such situations, full table scans are common, and indexes are not even used. This book is primarily focussed on OLTP-type applications. For detailed information on DSS and mixed environments, see the Oracle9i Data Warehousing Guide.

Before using this performance tuning reference, make sure you have read Oracle9i Database Performance Planning. Oracle Corporation has designed a new performance methodology, based on years of Oracle designing and performance experience. This brief book explains clear and simple activities that can dramatically improve system performance. It discusses the following topics:

Organization

This document contains:

Part I, "Writing and Tuning SQL"

This section provides information to help understand and manage SQL statements.

Chapter 1, "Introduction to the Optimizer"

This chapter discusses SQL processing, Oracle optimization, and how the Oracle optimizer chooses how to execute SQL statements.

Chapter 2, "Optimizer Operations"

This chapter provides details of how the CBO provides specific operations.

Chapter 3, "Gathering Optimizer Statistics"

This chapter explains why statistics are important for the cost-based optimizer and describes how to gather and use statistics.

Chapter 4, "Understanding Indexes and Clusters"

This chapter describes how to create indexes and clusters, and when to use them.

Chapter 5, "Optimizer Hints"

This chapter offers recommendations on how to use cost-based optimizer hints to enhance Oracle performance.

Chapter 6, "Optimizing SQL Statements"

This chapter describes how Oracle optimizes SQL using the cost-based optimizer (CBO).

Chapter 7, "Using Plan Stability"

This chapter describes how to use plan stability (stored outlines) to preserve performance characteristics.

Chapter 8, "Using the Rule-Based Optimizer"

This chapter discusses Oracle's rule-based optimizer (RBO).

Part II, "SQL-Related Performance Tools"

This section provides information about Oracle SQL-related performance tools.

Chapter 9, "Using EXPLAIN PLAN"

This chapter shows how to use the SQL statement EXPLAIN PLAN and format its output.

Chapter 10, "Using SQL Trace and TKPROF"

This chapter describes the use of the SQL trace facility and TKPROF, two basic performance diagnostic tools that can help you monitor and tune applications that run against the Oracle Server.

Chapter 11, "Using Autotrace in SQL*Plus"

This chapter describes the use of Autotrace, which can automatically get reports on the execution path used by the SQL optimizer and the statement execution statistics to help you monitor and tune statement performance.

Chapter 12, "Using Oracle Trace"

This chapter provides an overview of Oracle Trace usage and describes the Oracle Trace initialization parameters.


Note:

Oracle Trace will be deprecated in a future release. Oracle Corporation strongly advises the use of SQL Trace and TKPROF instead.


Part III, "Creating a Database for Good Performance"

This section describes how to create and configure a database for good performance.

Chapter 13, "Building a Database for Performance"

This chapter describes how to design and create a database for the intended needs.

Chapter 14, "Memory Configuration and Use"

This chapter explains how to allocate memory to database structures.

Chapter 15, "I/O Configuration and Design"

This chapter introduces fundamental I/O concepts, discusses the I/O requirements of different parts of the database, and provides sample configurations for I/O subsystem design.

Chapter 16, "Understanding Operating System Resources"

This chapter explains how to tune the operating system for optimal performance of Oracle.

Chapter 17, "Configuring Instance Recovery Performance"

This chapter explains how to tune recovery performance.

Chapter 18, "Configuring Undo and Temporary Segments"

This chapter explains how to configure undo segments (using automatic undo management or using rollback segments) and how to configure temporary tablespaces.

Chapter 19, "Configuring Shared Servers"

This chapter explains how to identify and reduce contention for dispatcher processes and for shared servers.

Part IV, "System-Related Performance Tools"

This section provides information about Oracle's system-related performance tools.

Chapter 20, "Oracle Tools to Gather Database Statistics"

Oracle provides a number of tools that allow a performance engineer to gather information regarding instance and database performance. This chapter explains why performance data gathering is important, and it describes how to use available tools.

Chapter 21, "Using Statspack"

This chapter describes the use of Statspack to collect, store, and analyze system data.

Part V, "Optimizing Instance Performance"

This section describes how to tune various elements of a database system to optimize performance of an Oracle instance.

Chapter 22, "Instance Tuning"

This chapter discusses the method used for performing tuning. It also describes Oracle statistics and wait events.

Chapter 23, "Tuning Networks"

This chapter describes different connection models and networking issues that affect tuning.

Part VI, "Performance-Related Reference Information"

This section provides reference information regarding dynamic performance views and wait events.

Chapter 24, "Dynamic Performance Views for Tuning"

This chapter provides detailed information on several dynamic performance views that can help you tune your system and investigate performance problems.

Appendix

Appendix A, "Schemas Used in Performance Examples"

This appendix describes the tables used in examples in Chapter 9, "Using EXPLAIN PLAN".

Related Documentation

Before reading this manual, you should have already read Oracle9i Database Performance Planning, Oracle9i Database Concepts, the Oracle9i Application Developer's Guide - Fundamentals, and the Oracle9i Database Administrator's Guide.

For more information about Oracle Enterprise Manager and its optional applications, see Oracle Enterprise Manager Concepts Guide, Oracle Enterprise Manager Administrator's Guide, and Database Tuning with the Oracle Tuning Pack.

For more information about tuning data warehouse environments, see the Oracle9i Data Warehousing Guide.

Many of the examples in this book use the sample schemas of the seed database, which is installed by default when you install Oracle. Refer to Oracle9i Sample Schemas for information on how these schemas were created and how you can use them yourself.

Printed documentation is available for sale in the Oracle Store at

http://oraclestore.oracle.com/

To download free release notes, installation documentation, white papers, or other collateral, please visit the Oracle Technology Network (OTN). You must register online before using OTN; registration is free and can be done at

http://otn.oracle.com/admin/account/membership.html

If you already have a username and password for OTN, then you can go directly to the documentation section of the OTN Web site at

http://otn.oracle.com/docs/index.htm

To access the database documentation search engine directly, please visit

http://tahiti.oracle.com

Conventions

This section describes the conventions used in the text and code examples of the this documentation set. It describes:

Conventions in Text

We use various conventions in text to help you more quickly identify special terms. The following table describes those conventions and provides examples of their use.

Convention Meaning Example

Bold

Bold typeface indicates terms that are defined in the text or terms that appear in a glossary, or both.

When you specify this clause, you create an index-organized table.

Italics

Italic typeface indicates book titles, emphasis, syntax clauses, or placeholders.

Oracle9i Database Concepts

You can specify the parallel_clause.

Run Uold_release.SQL where old_release refers to the release you installed prior to upgrading.

UPPERCASE monospace (fixed-width font)

Uppercase monospace typeface indicates elements supplied by the system. Such elements include parameters, privileges, datatypes, RMAN keywords, SQL keywords, SQL*Plus or utility commands, packages and methods, as well as system-supplied column names, database objects and structures, user names, and roles.

You can specify this clause only for a NUMBER column.

You can back up the database using the BACKUP command.

Query the TABLE_NAME column in the USER_TABLES data dictionary view.

Specify the ROLLBACK_SEGMENTS parameter.

Use the DBMS_STATS.GENERATE_STATS procedure.

lowercase monospace (fixed-width font)

Lowercase monospace typeface indicates executables and sample user-supplied elements. Such elements include computer and database names, net service names, and connect identifiers, as well as user-supplied database objects and structures, column names, packages and classes, user names and roles, program units, and parameter values.

Enter sqlplus to open SQL*Plus.

The department_id, department_name, and location_id columns are in the hr.departments table.

Set the QUERY_REWRITE_ENABLED initialization parameter to true.

Connect as oe user.

Conventions in Code Examples

Code examples illustrate SQL, PL/SQL, SQL*Plus, or other command-line statements. They are displayed in a monospace (fixed-width) font and separated from normal text as shown in this example:

SELECT username FROM dba_users WHERE username = 'MIGRATE';

The following table describes typographic conventions used in code examples and provides examples of their use.

Convention Meaning Example

[ ]

Brackets enclose one or more optional items. Do not enter the brackets.

DECIMAL (digits [ , precision ])

{ }

Braces enclose two or more items, one of which is required. Do not enter the braces.

{ENABLE | DISABLE}

|

A vertical bar represents a choice of two or more options within brackets or braces. Enter one of the options. Do not enter the vertical bar.

{ENABLE | DISABLE}

[COMPRESS | NOCOMPRESS]

...

Horizontal ellipsis points indicate either:

  • That we have omitted parts of the code that are not directly related to the example
  • That you can repeat a portion of the code

CREATE TABLE ... AS subquery;

SELECT col1, col2, ... , coln FROM employees;

 .
 .
 .

Vertical ellipsis points indicate that we have omitted several lines of code not directly related to the example.

SQL> SELECT NAME FROM V$DATAFILE;
NAME
------------------------------------
/fsl/dbs/tbs_01.dbf
/fs1/dbs/tbs_02.dbf
.
.
.
/fsl/dbs/tbs_09.dbf
9 rows selected.

Other notation

You must enter symbols other than brackets, braces, vertical bars, and ellipsis points as shown.

acctbal NUMBER(11,2);

acct CONSTANT NUMBER(4) := 3;

Italics

Italicized text indicates placeholders or variables for which you must supply particular values.

CONNECT SYSTEM/system_password

DB_NAME = database_name

UPPERCASE

Uppercase typeface indicates elements supplied by the system. We show these terms in uppercase in order to distinguish them from terms you define. Unless terms appear in brackets, enter them in the order with the spelling shown. However, because these terms are not case sensitive, you can enter them in lowercase.

SELECT last_name, employee_id FROM employees;

SELECT * FROM USER_TABLES;

DROP TABLE hr.employees;

lowercase

Lowercase typeface indicates programmatic elements that you supply. For example, lowercase indicates names of tables, columns, or files.

Note: Some programmatic elements use a mixture of UPPERCASE and lowercase. Enter these elements as shown.

SELECT last_name, employee_id FROM employees;

sqlplus hr/my_hr_password

CREATE USER mjones IDENTIFIED BY ty3MU9;

Documentation Accessibility

Our goal is to make Oracle products, services, and supporting documentation accessible, with good usability, to the disabled community. To that end, our documentation includes features that make information available to users of assistive technology. This documentation is available in HTML format, and contains markup to facilitate access by the disabled community. Standards will continue to evolve over time, and Oracle Corporation is actively engaged with other market-leading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers. For additional information, visit the Oracle Accessibility Program Web site at

http://www.oracle.com/accessibility/
Accessibility of Code Examples in Documentation

JAWS, a Windows screen reader, may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, JAWS may not always read a line of text that consists solely of a bracket or brace.

Accessibility of Links to External Web Sites in Documentation

This documentation may contain links to Web sites of other companies or organizations that Oracle Corporation does not own or control. Oracle Corporation neither evaluates nor makes any representations regarding the accessibility of these Web sites.