會話等待(Session Waits)

leon830216發表於2014-03-01
-- -----------------------------------------------------------------------------------
-- File Name    :
-- Author       : DR Timothy S Hall
-- Description  : Displays information on all database session waits.
-- Requirements : Access to the V$ views.
-- Call Syntax  : @session_waits
-- Last Modified: 11/03/2005
-- -----------------------------------------------------------------------------------
SET LINESIZE 200
SET PAGESIZE 1000
COLUMN username FORMAT A20
COLUMN event FORMAT A30
COLUMN wait_class FORMAT A15
SELECT NVL(s.username, '(oracle)') AS username,
       s.sid,
       s.serial#,
       sw.event,
       sw.wait_class,
       sw.wait_time,
       sw.seconds_in_wait,
       sw.state
FROM   v$session_wait sw,
       v$session s
WHERE  s.sid = sw.sid
ORDER BY sw.seconds_in_wait DESC;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22558114/viewspace-1097822/,如需轉載,請註明出處,否則將追究法律責任。

相關文章