Quanto tempo falta para acabar o meu backup via rman
Estimar (em segundos) do tempo restante para a conclusão da operação = TIME_REMAINING
A minha rotina estima em minutos. Essa rotina é feito para Linux.
export ORACLE_SID=<instance_name>
sqlplus -s /nolog <<FIM
connect / as sysdba
set linesize 150
set pagesize 500
column username format a10
column opname format a30
column progress format a10
column min format 99,999
column target format a30
select a.sid,b.username,b.opname,round(b.SOFAR*100 / b.TOTALWORK,0) || '%' as progress,round(b.TIME_REMAINING/60,0) Min,b.target
from V\$SESSION_LONGOPS b,V\$SESSION a
where a.sid=b.sid and TIME_REMAINING <> 0
and SUBSTR(OPNAME,1,5)='RMAN:'
UNION
select a.sid,b.username,opname,'<N/A>' as progress,round(tIME_REMAINING/60,0) Min,b.target
from V\$SESSION_LONGOPS b,V\$SESSION a
where a.sid(+)=b.sid and TIME_REMAINING =0
and ELAPSED_SECONDS=0
and SUBSTR(OPNAME,1,5)='RMAN:'
order by 5
/
FIM