Oracle回滚段使用查询代码详解

编程学习 2021-07-05 16:08www.dzhlxh.cn编程入门
这篇文章主要介绍了Oracle回滚段使用查询代码详解的相关资料,需要的朋友可以参考下

大批量执行DML语句造成回滚段大量占用,又回退操作,如何直观查询数据回滚情况?

单机环境 查询回滚执行进度

select /*+ rule */s.sid,
   r.name rr,
    nvl(s.username,'no transaction') us,
    s.osuser os,
    s.terminal te,
    t.used_urec rec,
    t.used_ublk blk
 from v$lock l, v$session s, v$rollname r,v$transaction t
 where l.sid = s.sid(+) and
    trunc(l.id1/65536) = r.usn and
    l.type = 'TX' and
    t.ses_addr = s.saddr and
    l.lmode = 6;

单机环境 查询回滚执行进度

select /*+ rule */s.sid,
   r.name rr,
    nvl(s.username,'no transaction') us,
    s.osuser os,
    s.terminal te,
    t.used_urec rec,
    t.used_ublk blk
 from v$lock l, v$session s, v$rollname r,v$transaction t
 where l.sid = s.sid(+) and
    trunc(l.id1/65536) = r.usn and
    l.type = 'TX' and
    t.ses_addr = s.saddr and
    l.lmode = 6;

集群环境  查询回滚执行进度

select /*+ rule */s.sid,
   r.name rr,
    nvl(s.username,'no transaction') us,
    s.osuser os,
    s.terminal te,
    t.used_urec rec,
    t.used_ublk blk
 from gv$lock l, gv$session s, v$rollname r,gv$transaction t
 where l.sid = s.sid(+) and
    trunc(l.id1/65536) = r.usn and
    l.type = 'TX' and
    t.ses_addr = s.saddr and
    l.lmode = 6;

单机环境 查询回滚执行进度

select /*+ rule */s.sid,
   r.name rr,
    nvl(s.username,'no transaction') us,
    s.osuser os,
    s.terminal te,
    t.used_urec rec,
    t.used_ublk blk
 from v$lock l, v$session s, v$rollname r,v$transaction t
 where l.sid = s.sid(+) and
    trunc(l.id1/65536) = r.usn and
    l.type = 'TX' and
    t.ses_addr = s.saddr and
    l.lmode = 6;

总结

以上所述是长沙网络推广给大家介绍的Oracle回滚段使用查询代码详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,长沙网络推广会及时回复大家的。在此也非常感谢大家对狼蚁SEO网站的支持!

Copyright © 2016-2025 www.dzhlxh.cn 金源码 版权所有 Power by

网站模板下载|网络推广|微博营销|seo优化|视频营销|网络营销|微信营销|网站建设|织梦模板|小程序模板