If we want to track the process of rman which is currently running, use the below sql query to find how much percentage (%) of rman backup has been completed & how much percentage is remaining to complete.
Current status of running RMAN process
============================
set lines 300
set pages 1000
col START_TIME for a20
col SID for 99999
select SID, to_char(START_TIME,'dd-mm-yy hh24:mi:ss') START_TIME,TOTALWORK, sofar, (sofar/totalwork) * 100 done,
sysdate + TIME_REMAINING/3600/24 end_at
from v$session_longops
where totalwork > sofar
AND opname NOT LIKE '%aggregate%'
AND opname like 'RMAN%';
To find the total time elapsed for the RMAN backup in minutes, use the below sql query.
============================================================
set lines 300
set pages 500
set lines 300
set pages 1000
col STATUS for a10
col START_TIME for a20
col END_TIME for a20
select SESSION_KEY, INPUT_TYPE, STATUS,to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
to_char(END_TIME,'mm/dd/yy hh24:mi') end_time,elapsed_seconds/60 Mins
from V$RMAN_BACKUP_JOB_DETAILS order by SESSION_KEY,START_TIME;
Use the following query to check backup is completed successfully or not.
==================================================
set lines 1000
set lines 500
col STATUS for a21
select SID,RECID,STAMP,OPERATION,OBJECT_TYPE,STATUS,to_char(START_TIME,'dd-mm-yy hh24:mi:ss'),to_char(END_TIME,'dd-mm-yy hh24:mi:ss')
from v$rman_status order by START_TIME;
Use the following query to check particular day backup is completed successfully or not.
===========================================================
set pages 1000
set lines 1000
select SID,RECID,STAMP,OPERATION,OBJECT_TYPE,STATUS,to_char(START_TIME,'dd-mm-yy hh24:mi:ss') START_TIME,
to_char(END_TIME,'dd-mm-yy hh24:mi:ss') END_TIME from v$rman_status where to_char(START_TIME,'dd-mm-yy hh24:mi:ss')
between '09-05-14 14:44:51' and '09-05-14 15:16:41' order by START_TIME;
Current status of running RMAN process
============================
set lines 300
set pages 1000
col START_TIME for a20
col SID for 99999
select SID, to_char(START_TIME,'dd-mm-yy hh24:mi:ss') START_TIME,TOTALWORK, sofar, (sofar/totalwork) * 100 done,
sysdate + TIME_REMAINING/3600/24 end_at
from v$session_longops
where totalwork > sofar
AND opname NOT LIKE '%aggregate%'
AND opname like 'RMAN%';
To find the total time elapsed for the RMAN backup in minutes, use the below sql query.
============================================================
set lines 300
set pages 500
set lines 300
set pages 1000
col STATUS for a10
col START_TIME for a20
col END_TIME for a20
select SESSION_KEY, INPUT_TYPE, STATUS,to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
to_char(END_TIME,'mm/dd/yy hh24:mi') end_time,elapsed_seconds/60 Mins
from V$RMAN_BACKUP_JOB_DETAILS order by SESSION_KEY,START_TIME;
Use the following query to check backup is completed successfully or not.
==================================================
set lines 1000
set lines 500
col STATUS for a21
select SID,RECID,STAMP,OPERATION,OBJECT_TYPE,STATUS,to_char(START_TIME,'dd-mm-yy hh24:mi:ss'),to_char(END_TIME,'dd-mm-yy hh24:mi:ss')
from v$rman_status order by START_TIME;
Use the following query to check particular day backup is completed successfully or not.
===========================================================
set pages 1000
set lines 1000
select SID,RECID,STAMP,OPERATION,OBJECT_TYPE,STATUS,to_char(START_TIME,'dd-mm-yy hh24:mi:ss') START_TIME,
to_char(END_TIME,'dd-mm-yy hh24:mi:ss') END_TIME from v$rman_status where to_char(START_TIME,'dd-mm-yy hh24:mi:ss')
between '09-05-14 14:44:51' and '09-05-14 15:16:41' order by START_TIME;
To monitor the SBT events, you can run the following SQL query:
============================================
COLUMN EVENT FORMAT a10
COLUMN SECONDS_IN_WAIT FORMAT 999
COLUMN STATE FORMAT a20
COLUMN CLIENT_INFO FORMAT a30
SELECT p.SPID, EVENT, SECONDS_IN_WAIT AS SEC_WAIT,
sw.STATE, CLIENT_INFO
FROM V$SESSION_WAIT sw, V$SESSION s, V$PROCESS p
WHERE sw.EVENT LIKE 's%bt%'
AND s.SID=sw.SID
AND s.PADDR=p.ADDR;
COLUMN EVENT FORMAT a10
COLUMN SECONDS_IN_WAIT FORMAT 999
COLUMN STATE FORMAT a20
COLUMN CLIENT_INFO FORMAT a30
SELECT p.SPID, EVENT, SECONDS_IN_WAIT AS SEC_WAIT,
sw.STATE, CLIENT_INFO
FROM V$SESSION_WAIT sw, V$SESSION s, V$PROCESS p
WHERE sw.EVENT LIKE 's%bt%'
AND s.SID=sw.SID
AND s.PADDR=p.ADDR;
How would you query v$rman_status (or other view) for daily backup jobs that did *not* run the previous night?
ReplyDelete