 |
|
Oracle Database Tips by Donald Burleson |
System-wide events by time
waited
Notice the similarity of the events in these
two figures. This demonstrates that either of these scripts will
point out the biggest wait events which have occurred on the
system. The time waited sorted report (Figure 5.1,
show_system_events.sql) helps to identify the scale or magnitude of
difference between these events. The average time waited sorted
report (Figure 5.2, show_system_events2.sql) helps identify the
impact on each occurrence.
After getting a feel for the system by
looking at the output from the previous scripts, it is time to start
narrowing down the scope. Run session_event_users.sql to see which
users are spending the most time waiting, and what events they are
waiting for.
* session_event_users.sql
--
*************************************************
-- Copyright © 2003 by Rampant TechPress
-- This script is free for non-commercial
purposes
-- with no warranties. Use at your own
risk.
--
-- To license this script for a commercial
purpose,
-- contact info@rampant.cc
--
*************************************************
/* session_event_users.sql */
column USERNAME format a8
column EVENT format a30
column SID format 9999
column AVERAGE_WAIT format 99999 head "AVG|WAIT"
column TOTAL_WAITS format 99999 head "TOTAL|WAITS"
column TOTAL_TIMEOUTS format 9999 head "TOTAL|TIME|OUTS"
column TIME_WAITED format 999999 head
"TIME|WAITED"
column MAX_WAIT format 99999 head "MAX|WAIT"
column TIME_WAITED_MICRO format 9999999 head
"TIME|WAITED|MICRO"
set pagesize 100
select
b.USERNAME,
a.*
from
V$SESSION_EVENT a,
V$SESSION b
where
See Code Depot
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 |