Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

RMAN SCRIPT TO CLEAR THE BACKUP PIECES OLDER THAN 2 DAYS...

979633Jan 7 2013 — edited Jan 8 2013
Hi

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...
This post has been answered by Hemant K Chitale on Jan 8 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 5 2013
Added on Jan 7 2013
7 comments
13,154 views