oracle 6

监控事务回滚进度:
select n.USED_UBLK*x.VALUE/1024/1024 ,s.*
  from gv$transaction n, gv$session s,
       v$parameter   x
 where n.INST_ID = s.INST_ID  
   and n.ADDR = s.TADDR   
   and x.name = 'db_block_size'   
   and n.INST_ID = 2;
--
select ((select (nvl(sum(bytes), 0))
           from dba_undo_extents
          where tablespace_name  = 'UNDOTBS1'                
            and status in ('ACTIVE'/*, 'UNEXPIRED'*/ )) * 100) /
       (select sum(bytes)
          from dba_data_files
         where tablespace_name    = 'UNDOTBS1')
                  "PCT_INUSE"
  from dual;










Script to Monitor SMON Rollback Progress [ID 1352046.1]
Master Note: Troubleshooting Database Transaction Recovery (文档 ID 1494886.1)
Rollback Is Taking A Long Time After Session Killed (文档 ID 1060831.6)


V$FAST_START_TRANSACTIONS displays information about the progress of the transactions that Oracle is recovering.




评估事务回滚完成时间
select inst_id,
usn,
state,
undoblockstotal "Total",
undoblocksdone "Done",
undoblockstotal - undoblocksdone "ToDo",
decode(cputime,
0,
'unknown',
to_char(sysdate + (((undoblockstotal - undoblocksdone) /
(undoblocksdone / cputime)) / 86400),'yyyy-mm-dd hh24:mi:ss')) "Estimated time to complete"
from gv$fast_start_transactions;






select min(s.snap_id), max(s.snap_id)
From dba_hist_snapshot s
where s.end_interval_time >=
to_date('2014-06-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss')


根据XID找出造成回滚的语句 
select /*+ parallel(8) */
distinct h.sql_id
from gv$fast_start_transactions st, dba_hist_active_sess_history h where st.STATE = 'RECOVERING'
and st.XID = h.xid
and st.INST_ID = h.instance_number 
and h.snap_id >= 60197
and h.snap_id <= 60330;


《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《


查看权限:
select * from user_sys_privs where username in  ('PERFSTAT');
select * from user_role_privs where username in ('PERFSTAT');
  
select * from user_TAB_PRIVS where grantee in   ('PERFSTAT');
select * from dba_role_privs where grantee in   ('PERFSTAT');

select * from dba_sys_privs where grantee in    ('PERFSTAT');


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值