rem *********************************************************************
rem *                                                                   *
rem * Name     : backups.sql                                            *
rem * Synopsis : Shows online backup status of datafiles                *
rem * Source   : http://www.oracle-dba.fr.pl                            *
rem *                                                                   *
rem *********************************************************************

column "File No"       format 9999        wrapped
column "File Name"     format a50         wrapped
column "Size (bytes)"  format 99999999999 wrapped
column "Backup Status" format a10         wrapped heading "Backup|Status"
column "Start Time"    format a18         wrapped

set linesize  1000
set pagesize  32000
set trimspool on

select   b.file#                                "File No"
,        d.name                                 "File Name"
,        d.bytes                                "Size (bytes)"
,        b.status                               "Backup Status"
,        to_char(b.time,'DD-MON-YY HH24:MI:SS') "Start Time"
from     v$backup   b
,        v$datafile d
where    b.file# = d.file#
order by b.time
/

column "File No"       clear
column "File Name"     clear
column "Size (bytes)"  clear
column "Backup Status" clear
column "Start Time"    clear

