9/09/2017

check rman backup completion time oracle

You can find your database backup time with the following query



SELECT * FROM (SELECT END.dt, 'Incremental' BACKUP, STAR.TIME started, END.TIME END,  
DECODE(TRUNC(END.TIME - star.TIME), 0, NULL, TRUNC(END.TIME - star.TIME) || ' Days' || ' + ') ||
TO_CHAR(TO_DATE(TRUNC(MOD(END.TIME - star.TIME,1) * 86400), 'SSSSS'), 'HH24:MI:SS') TIME
FROM 
(SELECT TRUNC(start_time) dt , MAX(COMPLETION_TIME) TIME FROM V$BACKUP_SET WHERE BACKUP_TYPE='I'
GROUP BY TRUNC(start_time)) END, 
(SELECT TRUNC(start_time) dt, MIN(START_TIME) TIME FROM V$BACKUP_SET WHERE BACKUP_TYPE='I'
GROUP BY TRUNC(start_time)) STAR
WHERE END.dt = STAR.dt 
UNION ALL
SELECT END.dt, 'Full Database' BACKUP, STAR.TIME started, END.TIME END,  
DECODE(TRUNC(END.TIME - star.TIME), 0, NULL, TRUNC(END.TIME - star.TIME) || ' Days' || ' + ') ||
TO_CHAR(TO_DATE(TRUNC(MOD(END.TIME - star.TIME,1) * 86400), 'SSSSS'), 'HH24:MI:SS') TIME
FROM 
(SELECT TRUNC(start_time) dt , MAX(COMPLETION_TIME) TIME FROM V$BACKUP_SET WHERE BACKUP_TYPE='D'
GROUP BY TRUNC(start_time)) END, 
(SELECT TRUNC(start_time) dt, MIN(START_TIME) TIME FROM V$BACKUP_SET WHERE BACKUP_TYPE='D'
GROUP BY TRUNC(start_time)) STAR
WHERE END.dt = STAR.dt) 
ORDER BY dt ASC;

DT         BACKUP        STARTED    END        TIME
---------- ------------- ---------- ---------- --------
13/10/2010 Incremental   13/10/2010 13/10/2010 01:16:39
14/10/2010 Incremental   14/10/2010 14/10/2010 02:03:00
16/10/2010 Full Database 16/10/2010 16/10/2010 05:40:09
18/10/2010 Incremental   18/10/2010 18/10/2010 01:55:08
19/10/2010 Incremental   19/10/2010 19/10/2010 01:55:57
20/10/2010 Incremental   20/10/2010 20/10/2010 02:29:29
21/10/2010 Incremental   21/10/2010 21/10/2010 02:10:50
23/10/2010 Full Database 23/10/2010 23/10/2010 06:08:06
25/10/2010 Incremental   25/10/2010 25/10/2010 02:27:07
26/10/2010 Incremental   26/10/2010 26/10/2010 01:34:12
27/10/2010 Incremental   27/10/2010 27/10/2010 01:50:09
28/10/2010 Incremental   28/10/2010 28/10/2010 01:35:10
30/10/2010 Full Database 30/10/2010 30/10/2010 05:24:12
01/11/2010 Incremental   01/11/2010 01/11/2010 02:03:43
02/11/2010 Incremental   02/11/2010 02/11/2010 00:47:35

No comments:

Post a Comment

Popular Posts