delete backup of archivelog until time='sysdate-30';
Solution two:
configure retention policy to recovery window of 30 days;
delete obsolete;
Oracle Certified Master - September, 2003, the Second OCM in China
*** LOOKING for PART TIME JOB***
Data Warehouse & Business Intelligence Expert
MCSE, CCNA, SCJP, SCSA from 1998
Take a look at the script below. It needs some ajustments for your specific environment. If you run in sqlplus it will generate RMAN script to delete backup for both:
datafiles and archive logs.
set echo off;
set verify off;
set feedback off;
SET HEADING OFF;
SET PAGESIZE 0;
set linesize 132;
Prompt
Prompt
ACCEPT id char PROMPT 'Enter the full or partial Database Identifier ex UP003: '
ACCEPT days number PROMPT 'Enter the number of days you want to retain: '
/* This program will create a script to delete old database and archive backupsets */
/* saving one extra day of archived logs */
/* Backups sets must be in the format DBID_db_* */
/* Archive sets must be in the format DBID_ar_* */
spool delete_backup.rmn;
select 'allocate channel for maintenance type "sbt_tape" ;' from dual;
select unique 'CHANGE BACKUPSET ' || bs_key || ' DELETE ;'
, ' # '||to_char(completion_time, 'MM/DD/YYYY')|| ' Archive Logs'
from bp
where handle like '%'||upper('&id')||'_ar%' and
completion_time < (sysdate - (&days )) ;
select unique 'CHANGE BACKUPSET ' || bs_key || ' DELETE ;'
,' # '||to_char(completion_time, 'MM/DD/YYYY')||' Datafiles' from bp
where handle like '%'||upper('&id')||'_db%' and
completion_time < (sysdate - &days )
order by 1;
select 'release channel ;' from dual;
spool off;
set pagesize 60;
set feedback on;
set verify on;
set echo on;
exit;
One, who thinks that the other one who thinks that know and does not know, does not know either!
Bookmarks