檢視RMAN備份進度的兩條SQL
近期在生產系統重新部署DG時網上收集發現如下兩條SQL還是挺好用的,在此作為記錄分享一下。
SELECT SID,
SERIAL#,
CONTEXT,
SOFAR,
TOTALWORK,
ROUND(SOFAR / TOTALWORK * 100, 2) "%_COMPLETE"
FROM gV$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%' AND OPNAME NOT LIKE '%aggregate%' AND
TOTALWORK != 0 AND SOFAR <> TOTALWORK;
SELECT SID,
SERIAL#,
CONTEXT,
SOFAR,
TOTALWORK,
ROUND(SOFAR / TOTALWORK * 100, 2) "%_COMPLETE"
FROM gV$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%' AND OPNAME NOT LIKE '%aggregate%' AND
TOTALWORK != 0 AND SOFAR <> TOTALWORK;
或
col opname for a30
set linesize 500
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 ;
如下為在系統查詢的結果:
SQL> SELECT SID,
2 SERIAL#,
3 CONTEXT,
4 SOFAR,
5 TOTALWORK,
6 ROUND(SOFAR / TOTALWORK * 100, 2) "%_COMPLETE"
7 FROM gV$SESSION_LONGOPS
8 WHERE OPNAME LIKE 'RMAN%' AND OPNAME NOT LIKE '%aggregate%' AND
9 TOTALWORK != 0 AND SOFAR <> TOTALWORK;
SID SERIAL# CONTEXT SOFAR TOTALWORK %_COMPLETE
---------- ---------- ---------- ---------- ---------- ----------
892 10655 1 23280622 53423998 43.58
SQL> col opname for a30
SQL> set linesize 500
SQL>
SQL> select inst_id,sid,serial#,opname,COMPLETE,
2 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
3 (
4 SELECT inst_id,
5 sid,
6 serial#,
7 opname,
8 ROUND(SOFAR / TOTALWORK * 100, 2) COMPLETE,
9 LAST_UPDATE_TIME,
10 START_TIME
11 FROM gV$SESSION_LONGOPS
12 WHERE OPNAME LIKE 'RMAN%'
13 --AND OPNAME NOT LIKE '%aggregate%'
14 AND TOTALWORK != 0
15 AND SOFAR <> TOTALWORK
16 ) t ;
INST_ID SID SERIAL# OPNAME COMPLETE MIN
---------- ---------- ---------- ------------------------------ ---------- ----------
2 1057 37067 RMAN: aggregate input 78.34 139
2 892 10655 RMAN: full datafile backup 43.65 156
SQL>
第二條SQL語句還顯示剩餘時間(估計時間)。
col opname for a30
set linesize 500
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 ;
如下為在系統查詢的結果:
SQL> SELECT SID,
2 SERIAL#,
3 CONTEXT,
4 SOFAR,
5 TOTALWORK,
6 ROUND(SOFAR / TOTALWORK * 100, 2) "%_COMPLETE"
7 FROM gV$SESSION_LONGOPS
8 WHERE OPNAME LIKE 'RMAN%' AND OPNAME NOT LIKE '%aggregate%' AND
9 TOTALWORK != 0 AND SOFAR <> TOTALWORK;
SID SERIAL# CONTEXT SOFAR TOTALWORK %_COMPLETE
---------- ---------- ---------- ---------- ---------- ----------
892 10655 1 23280622 53423998 43.58
SQL> col opname for a30
SQL> set linesize 500
SQL>
SQL> select inst_id,sid,serial#,opname,COMPLETE,
2 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
3 (
4 SELECT inst_id,
5 sid,
6 serial#,
7 opname,
8 ROUND(SOFAR / TOTALWORK * 100, 2) COMPLETE,
9 LAST_UPDATE_TIME,
10 START_TIME
11 FROM gV$SESSION_LONGOPS
12 WHERE OPNAME LIKE 'RMAN%'
13 --AND OPNAME NOT LIKE '%aggregate%'
14 AND TOTALWORK != 0
15 AND SOFAR <> TOTALWORK
16 ) t ;
INST_ID SID SERIAL# OPNAME COMPLETE MIN
---------- ---------- ---------- ------------------------------ ---------- ----------
2 1057 37067 RMAN: aggregate input 78.34 139
2 892 10655 RMAN: full datafile backup 43.65 156
SQL>
第二條SQL語句還顯示剩餘時間(估計時間)。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18841027/viewspace-1792151/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RMAN備份進度查詢
- RMAN備份進度查詢:
- rman的備份檢視的指令碼指令碼
- oracle rman備份驗證和備份進度監控Oracle
- RMAN備份相關的動態效能檢視
- oracle rman備份驗證和備份/恢復進度監控Oracle
- 【手摸手玩轉 OceanBase 170】如何檢視備份清理進度?
- 獲取rman備份/恢復執行進度資訊
- RMAN備份中冗餘度和Obsolete的備份的關係
- 監控資料備份恢復完成進度(EXPDP/IMPDP/RMAN)
- 使用v$session_longops來監控rman備份進度SessionGo
- Xamarin iOS教程之進度條和滾動檢視iOS
- 【手摸手玩轉 OceanBase 165】怎麼檢視資料備份進度?
- 【RMAN】RMAN的備份保留策略
- 熱備或RMAN備份期間 fractured (split) block 的檢測BloC
- RMAN的備份原理
- RMAN的備份加密加密
- 【新特性速遞】進度條,進度條,進度條
- Backup And Recovery User's Guide-備份RMAN備份-使用RMAN備份備份集GUIIDE
- 檢視備份資訊指令碼指令碼
- Backup And Recovery User's Guide-RMAN備份概念-RMAN備份的多個拷貝-備份的備份GUIIDE
- RMAN說,我能備份(9)--RMAN增量備份與備份保留策略
- exp備份和rman備份的區別
- 【RMAN】RMAN備份至ASMASM
- 檢查sql or session 執行的進度SQLSession
- RMAN說,我能備份(14)--實戰RMAN備份
- RMAN說,我能備份(11)--RMAN中的備份集屬性
- rman 備份策略
- RMAN備份原理
- Backup And Recovery User's Guide-備份RMAN備份-用RMAN備份映象拷貝備份GUIIDE
- 檢視慢查詢進度
- rman備份的其它特性
- RMAN備份的並行並行
- oracle實驗記錄 (rman 備份檢查&preview)OracleView
- Oracle的RMAN備份恢復,先從進入RMAN開始總結Oracle
- Oracle 11g 檢查 RMAN 備份的有效性Oracle
- Oracle裡邏輯備份、物理備份、Rman備份的區別Oracle
- RMAN說,我能備份(3)--RMAN全庫備份和表空間備份