暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片
active_session
emcs
46次下载
820次浏览
2019-07-24
4.5

脚本内容

--活动会话的sql语句
prompt Active session with sql text
column USERNAME format a14
set linesize 200
column EVENT format a30
select /*+rule */ distinct ses.SID, ses.sql_hash_value, ses.USERNAME, pro.SPID "OS PID", substr(stx.sql_text,1,200)
from V$SESSION ses
    ,V$SQL stx
    ,V$PROCESS pro 
where ses.paddr = pro.addr 
and ses.status = 'ACTIVE' 
and stx.hash_value = ses.sql_hash_value ;

--活动会话的等待事件
prompt Active session with wait
select  /*+rule */ sw.event,sw.wait_time,s.username,s.sid,s.serial#,s.SQL_HASH_VALUE  
from v$session s, v$session_wait sw  
where s.sid=sw.sid  
and s.USERNAME is not null 
and s.status = 'ACTIVE'; 

评论

贡献排行榜