Wednesday, 31 May 2023

How to check if RMAN backup is still running and how much approx time is left to complete

Below script will confirm if the RMAN back up is still running and also confirm approximately how much time is left to complete.



REM How to check if RMAN backup is still running and how much approx time is left to complete

set lines 200
set pages 200
col opname format a40
col module format a30

alter session set nls_date_format='DD-MON-RR HH24:MI:SS';

select  opname,
    sofar,
    TOTALWORK,
    round(sofar*100/totalwork,2) "% Work",
    module,
    p.spid as OS_PROCESS,
    START_TIME,
    LAST_UPDATE_TIME
from    
    v$session_longops lops,
    v$session s,
    v$process p
where   TOTALWORK > 0
and     opname like 'RMAN%'
and     sofar<>totalwork
and s.sid=lops.sid
and s.serial#=lops.serial#
and s.paddr=p.addr;