Tags

, ,


 
— get backup handle and backup pieces

select

d.name,

       b.bs_key,S.HANDLE,
       decode(b.incremental_level,null,decode(b.backup_type,'D','Ctrl','I','Inc','L','Arch','n/k'),
        'Inc'||b.incremental_level) backup_type,

       decode(b.status,'A','Avail.','O','Obsolete',b.status) status,

       b.pieces,
       b.start_time,
       decode(b.controlfile_included,'NONE','No','BACKUP','Yes','STANDBY','Standby','n/k') controlfile_included,
       b.keep,b.keep_options,
       b.keep_until
from rc_database d,
     rc_backup_set b,
     rc_backup_piece s
where d.db_key=b.db_key and d.db_key=s.db_key
      and B.SET_COUNT=S.SET_COUNT and B.SET_STAMP=S.SET_STAMP
      and upper(d.name) like upper('ADMP01')
      and B.START_TIME > to_date('12/01/2011 09:00','DD/MM/YY HH24:MI')
order by start_time desc;

 
— change keep option

select 'CHANGE BACKUPSET '|| b.bs_key||' keep until time ''sysdate+10'' logs;'

from rc_database d,
rc_backup_set b, rc_backup_piece s
where d.db_key=b.db_key and d.db_key=s.db_key
and B.SET_COUNT=S.SET_COUNT and B.SET_STAMP=S.SET_STAMP
and upper(d.name) like upper('ADMP01')
and B.START_TIME > to_date('12/01/2011 09:00','DD/MM/YY HH24:MI')
and B.BACKUP_TYPE<>'L'
order by b.start_time desc, b.bs_key;
Advertisements