|
 |
|
Oracle Database Tips by Donald Burleson |
Using the Wait Interface
So why would anyone want to look at these
performance views anyway? Just like there are some people who like
to take things apart to see what's inside, some people just want to
know what makes the Oracle database "tick." However, most are more
interested is keeping their bosses and the end users happy. If
keeping everyone happy is the goal, this book is a great place to
learn how to solve performance problems. For the clinically
curious, this book is also a great place since knowing how to use
these views to solve problems is a good starting point for doing
further research.
There are several ways to use the Wait
Interface to identify the cause for a system slowdown. One way is
using a set of start/stop tables that are created and then dropped
when data review is complete. This way helps reduce the inherent
inaccuracies in the Wait Interface in the cumulative numbers
gathered by some of the tables. Refer to the
start_system_events.sql, finish_system_events.sql and
difference_system_events.sql in Chapter 2. Examples can be found in
the case study section of this chapter.
Another way to use the Wait Interface is to
look directly at v$session_wait. This approach works well when
there is a specific user or process that is running slower than
usual or slower than is required to meet business requirements.
* session_waits.sql
--
*************************************************
-- Copyright © 2003 by Rampant TechPress
--
*************************************************
/* session_waits.sql */
column SID format 999
column EVENT format a28
column P1TEXT format a15
column P3TEXT format a8
column P2TEXT format a8
column SECONDS_IN_WAIT format 99999 heading
SECONDS|IN_WAIT
column WAIT_TIME format 999 heading
WAIT|TIME
column STATE format a18
column P1 format 999999999999
column P2 format 9999
column P3 format 99
select
SID,
EVENT,
P1TEXT,
P1,
P2TEXT,
P2,
P3TEXT,
P3,
WAIT_TIME,
SECONDS_IN_WAIT,
STATE
from
V$SESSION_WAIT
where
See Code Depot
Note that in versions as recent as 9.2.0.3,
this query sometimes returns a high number of rows with "null
event." Do not automatically reject or ignore these rows. It
seems Oracle 9i has a bug that misclassifies some valid wait events
as "null event." Bug # 1743159 was mentioned in Chapter 2, so check
MOSC for an updated status of this and other bugs.
The above book excerpt is from:
Oracle Wait Event Tuning
High Performance with Wait
Event Iinterface Analysis
ISBN 0-9745993-7-9
Stephen Andert
http://www.rampant-books.com/book_2004_2_wait_tuning.htm |