dbTalk Databases Forums  

Wait Events

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss Wait Events in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
The Magnet
 
Posts: n/a

Default Wait Events - 06-22-2011 , 10:44 AM






Hi,

I'm trying to understand these queries. They both gather data from
the wait event views, but they return totally different results. The
one that comes from the system views seems to be much more static.
Should I be looking at one over the other, or is one more accurate on
the system health?

SELECT a.event, a.total_waits, a.time_waited, a.average_wait
FROM v$system_event a, v$event_name b, v$system_wait_class c
WHERE a.event_id=b.event_id
AND b.wait_class#=c.wait_class#
AND c.wait_class IN ('Application','Concurrency')
ORDER BY average_wait DESC;

SELECT event, total_waits, time_waited, average_wait
FROM (SELECT a.event, a.total_waits, a.time_waited, a.average_wait,
ROW_NUMBER() OVER (PARTITION BY a.event ORDER BY average_wait DESC)
rnum
FROM v$session_event a, v$event_name b, v$session_wait_class
c
WHERE a.event_id=b.event_id
AND b.wait_class#=c.wait_class#
AND c.wait_class IN ('Application','Concurrency'))
WHERE rnum = 1
ORDER BY average_wait DESC;

Reply With Quote
  #2  
Old   
Mark D Powell
 
Posts: n/a

Default Re: Wait Events - 07-07-2011 , 12:04 PM






On Jun 22, 11:44*am, The Magnet <a... (AT) unsu (DOT) com> wrote:
Quote:
Hi,

I'm trying to understand these queries. *They both gather data from
the wait event views, but they return totally different results. *The
one that comes from the system views seems to be much more static.
Should I be looking at one over the other, or is one more accurate on
the system health?

SELECT a.event, a.total_waits, a.time_waited, a.average_wait
FROM v$system_event a, v$event_name b, v$system_wait_class c
WHERE a.event_id=b.event_id
AND b.wait_class#=c.wait_class#
AND c.wait_class IN ('Application','Concurrency')
ORDER BY average_wait DESC;

SELECT event, total_waits, time_waited, average_wait
FROM (SELECT a.event, a.total_waits, a.time_waited, a.average_wait,
ROW_NUMBER() OVER (PARTITION BY a.event ORDER BY average_wait DESC)
rnum
* * * * * FROM v$session_event a, v$event_name b, v$session_wait_class
c
* * * * * WHERE a.event_id=b.event_id
* * * * * AND b.wait_class#=c.wait_class#
* * * * *AND c.wait_class IN ('Application','Concurrency'))
WHERE rnum = 1
ORDER BY average_wait DESC;
The view v$session_event will contain information about current
sessions only. On a busy system new sessions are being created all
the time and others exit ceasing to exist. Session information is
rolled up into the system statistics which would go back to instance
startup.

HTH -- Mark D Powell --

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.