|
在ORACLE做RMAN备份的过程中,如果数据量较大,备份时间会非常耗时,并且对IO性能有较大影响,下面脚本可以查看RMAN的备份进度,从而估算剩余备份时间:
查看RMAN备份进度:
SQL> SQL> SELECT inst_id,
2 sid,
3 serial#,
4 opname,
5 ROUND(SOFAR / TOTALWORK * 100, 2) "%_COMPLETE"
6 FROM gV$SESSION_LONGOPS
7 WHERE OPNAME LIKE 'RMAN%'
8 --AND OPNAME NOT LIKE '%aggregate%'
9 AND TOTALWORK != 0
10 AND SOFAR <> TOTALWORK;
INST_ID SID SERIAL# OPNAME %_COMPLETE
---------- ---------- ---------- -------------------------------------------------- ----------
1 1876 61673 RMAN: incremental datafile backup 53.38
1 651 16867 RMAN: incremental datafile backup 2.59
1 2162 59344 RMAN: incremental datafile backup 50.3
1 1156 13310 RMAN: incremental datafile backup 49.44
若在生产环境上进行RMAN备份,如果时间较长,并且对业务性能影响较大,需要临时中断RMAN备份任务,由于RMAN进程是在后台运行,所以需要找出相应的RMAN后台进程并KILL掉,下面脚本是定位正在运行的RMAN进程:
查杀RMAN进程:
SQL> Select s.sid, s.serial#, p.spid, s.client_info
2 from v$process p, v$session s
3 where p.addr = s.paddr
4 and s.program like '%rman%';
SID SERIAL# SPID CLIENT_INFO
---------- ---------- ------------------------ ----------------------------------------------------------------
531 43498 16280
1379 39697 16285 rman channel=c1
1999 41055 11905
507 47031 16287 rman channel=c2
169 44971 16301 rman channel=c3
111 49240 16309 rman channel=c4
6 rows selected.
找到进程号,直接kill掉
|
|