RMAN - list only last successful backup via script

I would like to compose a script to list backup statuses, but I am having difficulty filtering out all but the last backup from a RMAN> list backup; command.  Optimally, i would like just the last backup's date/time and it's success/failure status.

My databases are all running on Solaris 5, but are a mixture of 9.2.0.7, 10.2.0.4, and 11.1.0.7
STLOracleDudeAsked:
Who is Participating?
 
it-rexCommented:
select * from  v$rman_status
where trunc(start_time)=trunc(sysdate-1)

instead of the star(*) use the columns you are interested in.

also;
To include the time information in the RMAN output,set the NLS_DATE_FORMAT=DD-MON-RRRR HH24:MI:SS at the OS level prior to running RMAN. This is useful especially when checking the exact RMAN backup completion date and time as generated in the RMAN log
0
 
STLOracleDudeAuthor Commented:
is there any way to get just the success or fail status of the backup database command only?  it looks like that view shows every file being copied.  

My rman script is posted below.

Also, is there a similar view in 9i?
connect target
configure default device type to disk;
configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to '/data/orabkup/${DIRECTORY}/%F';
configure channel device type disk format '/data/orabkup/${DIRECTORY}/backup_db_%d_S_%s_P_%p_T_%t' maxpiecesize 2G;
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1;
sql 'alter system archive log current';
backup archivelog all delete all input;
backup database;
sql 'alter system archive log current';

Open in new window

0
 
STLOracleDudeAuthor Commented:
Here is the output of my v$rman_status query.
SQL> select operation,status,mbytes_processed,start_time,end_time from v$rman_status where trunc(start_time)=trunc(sysdate-1);
DELETE                            COMPLETED                              0 04-JAN-10 04-JAN-10
LIST                              COMPLETED                              0 04-JAN-10 04-JAN-10
LIST                              COMPLETED                              0 04-JAN-10 04-JAN-10
RMAN                              COMPLETED WITH ERRORS                  0 04-JAN-10 04-JAN-10
REPORT                            COMPLETED                              0 04-JAN-10 04-JAN-10
RMAN                              COMPLETED                              0 04-JAN-10 04-JAN-10
LIST                              COMPLETED                              0 04-JAN-10 04-JAN-10
DELETE                            COMPLETED                              0 04-JAN-10 04-JAN-10
BACKUP                            COMPLETED                           2058 04-JAN-10 04-JAN-10
LIST                              COMPLETED                              0 04-JAN-10 04-JAN-10
CONTROL FILE AND SPFILE AUTOBACK  COMPLETED                             11 04-JAN-10 04-JAN-10
REPORT                            COMPLETED                              0 04-JAN-10 04-JAN-10
DELETE                            COMPLETED                              0 04-JAN-10 04-JAN-10
BACKUP                            COMPLETED                           1217 04-JAN-10 04-JAN-10
DELETE                            COMPLETED                              0 04-JAN-10 04-JAN-10
CONTROL FILE AND SPFILE AUTOBACK  COMPLETED                             11 04-JAN-10 04-JAN-10
RMAN                              COMPLETED WITH ERRORS               3297 04-JAN-10 04-JAN-10
RMAN                              COMPLETED                              0 04-JAN-10 04-JAN-10

18 rows selected.

Open in new window

0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
peter991Commented:
Hi,
Perhaps this will help you.

RMAN> list backup of database completed after 'SYSDATE-30';
0
 
STLOracleDudeAuthor Commented:
That works.  Is there any way to pull just the portion below from that output or will i have to grep through it manually?  Not that big a deal, I can spool it to a file and grep for disk, I guess.
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
181     Full    134.67M    DISK        00:03:43     04-JAN-10

Open in new window

0
 
peter991Commented:
I guess spool and grep will do the job.
I don't think "set serveroutput on|off" and "set heading on|off" works in RMAN.

Regards
0
 
terra spardlingCommented:
Good suggestions ! Just to add my thoughts , if your business is requiring a DD 2058 , my colleagues filled a template form here <code>https://goo.gl/vW7Mcb</code>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.