--rman 進度查詢
SELECT vs.sid,vs.serial#,vs.machine,vs.program,
vsl.opname,vsl.target,vsl.message,vsl.sql_hash_value,
TRUNC(vsl.elapsed_seconds/60) || ':' || MOD(vsl.elapsed_seconds,60) as "所用時間(分:秒)",
TRUNC(vsl.time_remaining/60) || ':' || MOD(vsl.time_remaining,60) as "剩餘時間(分:秒)",
ROUND(vsl.sofar/vsl.totalwork*100, 2) as "進度"
FROM v$session vs,
v$session_longops vsl
WHERE vs.sid = vsl.sid
AND vs.serial# = vsl.serial#
AND vs.program like 'rman%'
AND vsl.totalwork>0
AND vsl.sofar<>vsl.totalwork ;