ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 获取rman备份/恢复执行进度信息

获取rman备份/恢复执行进度信息

原创 Linux操作系统 作者:myownstars 时间:2011-06-02 17:40:07 2 删除 编辑

该sql同样适用于长时间执行未结束的sql,需要查询v$session_longops

select inst_id,sid,serial#,opname,COMPLETE,
trunc(((to_char(last_update_time,'dd')-to_char(start_time,'dd'))*60*24+(to_char(last_update_time,'hh24')-to_char(start_time,'hh24'))*60 +(to_char(last_update_time,'mi')-to_char(start_time,'mi')))*(100-complete)/complete) min from
(
SELECT inst_id,
sid,
serial#,
opname,
ROUND(SOFAR / TOTALWORK * 100, 2) COMPLETE,
LAST_UPDATE_TIME,
START_TIME
FROM gV$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%'
--AND OPNAME NOT LIKE '%aggregate%'
AND TOTALWORK != 0
AND SOFAR <> TOTALWORK
) t

结果输出

   INST_ID        SID    SERIAL# OPNAME                                                             COMPLETE        MIN
---------- ---------- ---------- ---------------------------------------------------------------- ---------- ----------
         1       1084          1 RMAN: full datafile restore                                           82.62        124
         1       1083          1 RMAN: full datafile restore                                           81.01        127
         1       1085          5 RMAN: full datafile restore                                           95.42        107
         1       1086         28 RMAN: aggregate input                                                   100        102

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

上一篇: enq: TS - contention
请登录后发表评论 登录
全部评论

注册时间:2010-03-18

  • 博文量
    375
  • 访问量
    3112698