Views

Sunday, September 17, 2017

Oracle - Script to monitor RMAN running backup

Script to monitor RMAN running backup.

col Timestarted format a16
set linesize 160
col opname for a18
select sid,opname,trunc((totalwork*8192)/1024/1024) "Total work(MB)",
trunc((sofar*8192)/1024/1024) "Work Done(MB)", to_char(start_time, 'MM-DD-YYYY HH24:MI:SSAM') "Timestarted", trunc(time_remaining/60) "Time remaining(min)",round(elapsed_seconds/60) "Time Elasped(min)", round(sofar/totalwork*100,2) "% Complete" from v$session_longops
where opname like 'RMAN%'
and totalwork != 0
and sofar != totalwork
order by start_time, totalwork desc
/

SQL> col Timestarted format a16
SQL> set linesize 160
SQL> col opname for a18
SQL> select sid,opname,trunc((totalwork*8192)/1024/1024) "Total work(MB)",
  2  trunc((sofar*8192)/1024/1024) "Work Done(MB)", to_char(start_time, 'MM-DD-YYYY HH24:MI:SSAM') "Timestarted", trunc(time_remaining/60) "Time remaining(min)",round(elapsed_seconds/60) "Time Elasped(min)", round(sofar/totalwork*100,2) "% Complete" from v$session_longops
  3  where opname like 'RMAN%'
  4  and totalwork != 0
  5  and sofar != totalwork
  6  order by start_time, totalwork desc
/
                                       Work Do                  Time rema   Time Elap
SID OPNAME             Total work(MB)  ne(MB)  Timestarted      ining(min)  sed(min) %Complete
--- ------------------ -------------- -------- ---------------- ---------    ------- ----------
522 RMAN: aggregate in       17886759  5031515 09-16-2017 18:00      1436     562      28.13
    put                                        :34PM

609 RMAN: incremental        10518528  2409091 09-16-2017 18:00      1893     562       22.9
    datafile backup                            :35PM

648 RMAN: incremental         3665920   645958 09-16-2017 18:00      2629     562      17.62
    datafile backup                            :35PM

698 RMAN: incremental         1413120   554313 09-16-2017 18:00       871     562      39.23
    datafile backup                            :35PM

739 RMAN: incremental         1402880   568512 09-16-2017 18:00       825     562      40.52
    datafile backup                            :35PM


No comments:

Post a Comment

Leave a Reply...