帖两个大事务查询SQL

--大事务
select sid,serial#,start_time,last_update_time,sofar/totalwork*100,elapsed_seconds,time_remaining,
       round(elapsed_seconds/60) elapsed_minutes,
       round(elapsed_seconds/(sofar/totalwork)/60) total_minutes,
       round(elapsed_seconds/(sofar/totalwork)/60) - round(elapsed_seconds/60) need_minutes
       ,username,opname,target,target_desc,message
from v$session_longops
where totalwork <> 0 and sofar!=totalwork --sofar/totalwork < 1
order by sofar/totalwork*100

--大事务(查询执行的SQL语句)
select sid,serial#,start_time,last_update_time,sofar/totalwork*100,elapsed_seconds,time_remaining,
       round(elapsed_seconds/60) elapsed_minutes,
       round(elapsed_seconds/(sofar/totalwork)/60) total_minutes,
       round(elapsed_seconds/(sofar/totalwork)/60) - round(elapsed_seconds/60) need_minutes
       ,username,opname,target,target_desc,message
     ,s.SQL_TEXT,s.SQL_FULLTEXT,s.MODULE,s.SERVICE,s.PARSING_SCHEMA_NAME
     ,s.OPTIMIZER_MODE,s.OPTIMIZER_COST,s.ROWS_PROCESSED
     ,s.PLSQL_EXEC_TIME,s.USER_IO_WAIT_TIME,s.BUFFER_GETS,s.DISK_READS
     ,s.LAST_LOAD_TIME,s.LAST_ACTIVE_TIME,s.FIRST_LOAD_TIME,s.CPU_TIME
from v$session_longops l,v$sql s
where l.SQL_ADDRESS = s.ADDRESS and l.SQL_ID = s.SQL_ID
  and totalwork <> 0 and sofar!=totalwork --sofar/totalwork < 1
order by sofar/totalwork*100,l.ELAPSED_SECONDS desc,l.last_update_time desc

 

 

 

www.cects.cn

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值