檢視過去的session鎖情況指令碼

yezhibin發表於2010-01-22
 select filter from t1 where rownum=1 for update;
 
 select FILTER from t1 where FILTER=6 for update;
 
break on MY_TIME
column my_sid format 999
column my_ser format 99999
column my_state format a30
column my_blkr format 999
select to_char(a.sample_time, 'HH24:MI:SS') MY_TIME,a.session_id MY_SID,a.session_serial# MY_SER,
        DECODE(a.session_state, 'WAITING' ,a.event, a.session_state) MY_STATE,a.xid, a.sql_id,
        a.blocking_session MY_BLKR
from v$active_session_history a, dba_users u
where u.user_id = a.user_id
and u.username = 'PERFSTAT'
and a.sample_time > SYSTIMESTAMP-(2/1440);

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

相關文章