Home » RDBMS Server » Backup & Recovery » Deleting old RMAN backups (Oracle 10.2.0.4; RHEL-4)
Deleting old RMAN backups [message #391549] Thu, 12 March 2009 09:02 Go to next message
ridhi_sundar
Messages: 184
Registered: November 2007
Location: Bangalore
Senior Member
Hi

I am taking an full DB backup using an RMAN script. The script is as below:
Quote:
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.

Can any body tell what are the steps I need to take now? And how can I set RMAN to delete my old archives and old backups daily?

Regards
Ridhi SUndar
Re: Deleting old RMAN backups [message #391550 is a reply to message #391549] Thu, 12 March 2009 09:13 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
First, Look into rman retention policy.
Plan everything based on that.
You can delete the "expired" or "Obsolete" backup depending on need.
Then
You can selectively delete using
delete archivelog all completed before ' ';

Search this forum/google/docs for more examples.

[Updated on: Thu, 12 March 2009 09:18]

Report message to a moderator

Re: Deleting old RMAN backups [message #391710 is a reply to message #391550] Fri, 13 March 2009 02:30 Go to previous messageGo to next message
ridhi_sundar
Messages: 184
Registered: November 2007
Location: Bangalore
Senior Member
I am preparing an action plan. Please let me know if it is correct or not.
Quote:

1. I will set my retention policy
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
2. In my backup script I will include
DELETE OBSOLETE;
3. To delete my archive logs ;
Delete archive log all completed before 'sysdate-2';


Few doubts:
1.Will delete obsolete will delete the physical files?
2.What will happen to the files which are physically not present now i mean deleted by OS command before?

Regards
Ridhi Sundar
Re: Deleting old RMAN backups [message #391792 is a reply to message #391710] Fri, 13 March 2009 09:22 Go to previous message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
I am not trying to pick on you.
>>Please let me know if it is correct or not.

Backup would never be an issue. Restoring might be.
It is my personal policy not to certify anything related to backup policies over the forum. Nobody can.
I believe it should be yours too. Do not to take any anonymous poster's recommendation blindly from the web.

First read the docs.
See what others have done.
Try them in a safe/test environment.
Observe it. If you have questions, post it here/ask someone.
Document everything and script the procedures.
Use that as baseline.
This way, you can save yourself from some surprises.

>>2.What will happen to the files which are physically not present now i mean deleted by OS command before?
As said in my earlier post, there is a subtle difference between "expired" and "obsolete" backups.
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/maint003.htm#i1006294
Previous Topic: Incomplete and Complete backup recovery
Next Topic: Database transform with RMAN
Goto Forum:
  


Current Time: Sat Dec 03 08:14:09 CST 2016

Total time taken to generate the page: 0.08294 seconds