RMAN SCRIPT TO CLEAR THE BACKUP PIECES OLDER THAN 2 DAYS...
979633Jan 7 2013 — edited Jan 8 2013Hi
I am taking an full DB backup using an RMAN script. The script is as below:
grc_backup
{allocate channel ch1 type disk format '/home/oragrc/GRCbkup/rman_bkp/data/%T_%c_%s_%f';
backup database;
sql 'ALTER SYSTEM
ARCHIVE LOG CURRENT';
change archivelog all crosscheck;
backup archivelog all format '/home/oragrc/GRCbkup/rman_bkp/Archive/%T_al_%U.bck';
backup current controlfile format '/home/oragrc/GRCbkup/rman_bkp/%T_cf_%U.bck';
}
This script is scheduled to run daily through a OS script.
The problem is daily after the backup I have to delete the backups older than 2days. For this I am using an OS script which finds the backups older than 2 days by find command and deletes it. Also this script deletes archivelogs older than 2 days.
Just I came to know It is not advisable to delete the RMAN backups and archive logs from OS command when using RMAN.
I figured out the following script i changed the entire script and instance names are different please find below
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
configure device type disk parallelism 1 backup type to compressed backupset;
run
{
allocate channel d1 type disk ;
backup filesperset 5 format '/u06/backup/EBSDEV/EBSDEV_data_t%t_s%s_p%p' database ;
sql 'alter system archive log current' ;
backup filesperset 20 format '/u06/backup/EBSDV3/EBSDV3_arch_t%t_s%s_p%p' archivelog all delete input ;
backup format '/u06/backup/EBSDEV/EBSDEV_control%U' current controlfile ;
backup spfile format '/u06/backup/EBSDEV/EBSDEV_spfile_%U';
sql "alter database backup controlfile to trace as ''/tmp/control.trc'' reuse";
CROSSCHECK BACKUPSET;
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED BACKUP;
}
list backupset summary;
exit;
Can any one suggest me on this am i correct...