Pages

Monday, April 16, 2012

Query to check datafile / controlfile / spfile backup status


use following query to check db backup status.


SELECT dbfiles||' out of '||numfiles||' datafiles backed up' "Datafiles backed up",
                          cfiles "Control Files backed up", spfiles "SPFiles backed up"
          FROM    (select count(*) numfiles from v$datafile),
                         (select count(*) dbfiles  from v$backup_datafile a, v$datafile b
                          where a.file# = b.file#   and a.completion_time > sysdate - 1),
                         (select count(*) cfiles from v$backup_datafile
                          where file# = 0 and completion_time > sysdate - 1),
                         (select count(*) spfiles from v$backup_spfile
                         where completion_time > sysdate - 1);

1 comment: