ITPub博客

首页 > 数据库 > Oracle > Monitor Current SQL Running(10g)

Monitor Current SQL Running(10g)

原创 Oracle 作者:tolilong 时间:2016-01-26 16:37:56 0 删除 编辑
如下是Oracle10g Monitor Current SQL Running Script:

select vs.LAST_CALL_ET elapsed_time,vs.SID,vs.SERIAL#,vp.SPID,vs.USERNAME,vs.OSUSER,vs.MACHINE,
vs.EVENT,vs.PROGRAM,vs.MODULE,vs.SQL_ID,vsql.SQL_TEXT,vsql.SQL_FULLTEXT,vs.SCHEMANAME,vs.STATUS,vsql.EXECUTIONS,
(select value from v$sesstat where sid=vs.SID and statistic#=10 and rownum=1)  "logical reads",  --session logical reads
(select value from v$sesstat where sid=vs.SID and statistic#=59 and rownum=1)  "physical reads", --physical reads
(select value from v$sesstat where sid=vs.SID and statistic#=64 and rownum=1)  "block changes", --db block changes 
(select value from v$sesstat where sid=vs.SID and statistic#=3 and rownum=1)  "opened cursors current",  --opened cursors current
(select value from v$sesstat where sid=vs.SID and statistic#=26 and rownum=1)  "session pga memory",  --session pga memory
vsql.COMMAND_TYPE,vsql.PLAN_HASH_VALUE,vs.ACTION,vs.LOGON_TIME,vs.TYPE,vs.SQL_HASH_VALUE,
vs.SADDR,vs.P1,vs.P2,vs.P3
from v$session vs,v$sqlarea vsql,v$process vp 
where vs.SQL_ID=vsql.SQL_ID and vs.PADDR=vp.ADDR and vs.status='ACTIVE' order by 1 desc  

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24237320/viewspace-1982598/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-07-13

  • 博文量
    406
  • 访问量
    1095718