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;
总结
相关推荐
oraclemch 2019-12-16
pfpfpfpfpf 2015-03-07
redis 2015-01-13
MySQLLelove 2019-06-27
xpaibeyond 2010-05-14
gongg0 2012-07-06
holyrong 2014-03-02
Cavlier 2012-10-04
LinuxOracleWf 2012-05-27
anshenoracle 2011-04-20
嵌入式天地 2011-01-28
LinuxOracleWf 2010-01-15
一昕之代码 2019-04-06
ltoper 2019-04-06
ltoper 2019-04-05
不怕猫的耗子A 2007-04-07