Configuring retention policy not for archive logs [message #403440] |
Fri, 15 May 2009 11:40 |
raj12
Messages: 15 Registered: May 2009
|
Junior Member |
|
|
I am configuring rman to disk backup and since I have to make room for future backup I want to delete the old backups. Since retention redundancy policy also mark archive logs as obsolete, is there any way that I can set redundacy only for database backup but not for archivelogs?
|
|
|
|
Re: Configuring retention policy not for archive logs [message #403442 is a reply to message #403441] |
Fri, 15 May 2009 12:05 |
raj12
Messages: 15 Registered: May 2009
|
Junior Member |
|
|
Here is what I want to setup:
1 full backups every other day of the week and daily archive logs backup to disk and then to tape
Based on the policy of having atleast 5 old archive logs I will be deleting these logs by saying "delete noprompt archivelog until time 'sysdate - 5' backed up 2 times"
This will take care of archive logs but I want to make space for database backup and trying to find a way to automate deletion of database backup only.
Keep option cannot be used for archive logs
[Updated on: Fri, 15 May 2009 12:10] Report message to a moderator
|
|
|
Re: Configuring retention policy not for archive logs [message #403443 is a reply to message #403442] |
Fri, 15 May 2009 12:18 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
Then you have to rely on manual methods to delete backups.
***Not so recommended***.
Write script that would list
the backupsets to be made unavailable.
Something like this (spool the output and run separately against catalog).
select 'change backupset '||bs_key||' unavailable;'
from rc_backup_set a, rc_database b
where a.db_key=b.db_key and
status = 'A' and
trunc(completion_time) < trunc(SYSDATE-yourNumberOfDays);
Use OS methods to delete the files.
Something like
find . -mtime +yourNumberOfdays -name "*.bak" -exec /bin/rm {} \;
Warning: Untested code.
[Updated on: Fri, 15 May 2009 12:21] Report message to a moderator
|
|
|
Re: Configuring retention policy not for archive logs [message #403444 is a reply to message #403443] |
Fri, 15 May 2009 12:29 |
raj12
Messages: 15 Registered: May 2009
|
Junior Member |
|
|
Thanks for the quick reply but I am not using the catalog and since I will be backing them to tape and deleting it I would also want to have their records in the control file for restore.
Is there any way that I can query the oldest backup in rman and delete all those backup pieces at OS level?
|
|
|
|
|
|
|
|
|
Re: Configuring retention policy not for archive logs [message #403456 is a reply to message #403440] |
Fri, 15 May 2009 13:30 |
raj12
Messages: 15 Registered: May 2009
|
Junior Member |
|
|
Sorry if I am confusing you guys.
Let me start over:
We were having tape backups before and now we want to implement disk backup and tape backup both.
Our current backup policy is
Full backup plus archivelog every Mon, Wed and Fri
Daily archive logs backup every 6 hrs
Now, considering the same for disk backup, how can I achieve this in a better way keeping in mind that I have to delete the old backup to make room for next backup
|
|
|
|
|
|
|
|
|
|
Re: Configuring retention policy not for archive logs [message #403895 is a reply to message #403440] |
Tue, 19 May 2009 07:07 |
raj12
Messages: 15 Registered: May 2009
|
Junior Member |
|
|
One more question - Full database and Archive logs backup creates 5 backup pieces each in separate backupset. As I will be deleting the files from the OS, is there any way that I can cross reference rman that I will be deleting only the old backup files.
For e.g full backups created 5 backup pieces:-
bckuppiece1
bckuppiece2
bckuppiece3
bckuppiece4
bckuppiece5
Now since bckuppiece1 is the oldest one how can I reference rman the rest of the backuppieces holding that full backup?
|
|
|
|
|
|
Re: Configuring retention policy not for archive logs [message #404108 is a reply to message #403951] |
Wed, 20 May 2009 07:10 |
raj12
Messages: 15 Registered: May 2009
|
Junior Member |
|
|
Deleting files before N days doesnt guarantee that it will delete only those files. What if n days ago backup didnt completed and its been backed up next day? what if backup runs before and after midnight then we will have 2 dates for 1 complete backup. So there must be a way that we can cross reference rman to delete only those backuppieces which are the oldest and belong to one full backup only
|
|
|
Re: Configuring retention policy not for archive logs [message #404111 is a reply to message #404108] |
Wed, 20 May 2009 07:38 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
>>So there must be a way that we can cross reference rman to delete only those backuppieces which are the oldest and belong to one full backup only
Already explained.
V$backup_file will give you the list of files backed up based on completion_time and bs_key. crosscheck with v$backup_set and v$backup_set_details.
>> What if n days ago backup didnt completed and its been backed up next day?
As said above (many times),
you have to generate the list of files to deleted based on v$views .
If you are talking about pushing the backupsets to tape within a window,
You have to take care of it.
Provide enough window for tape backups.
[Updated on: Wed, 20 May 2009 07:47] Report message to a moderator
|
|
|
Re: Configuring retention policy not for archive logs [message #404129 is a reply to message #404111] |
Wed, 20 May 2009 09:06 |
raj12
Messages: 15 Registered: May 2009
|
Junior Member |
|
|
Could you give me an example where you query views not based on date or n number of days but based on the oldest backup taken and get the list of only those backuppieces for that full backup (Note: Each backuppiece is contained in unique backupset with unique bs_key)
V$backup_file will give you the list of files backed up based on completion_time and bs_key. crosscheck with v$backup_set and v$backup_set_details
>>Considering the example that i gave earlier 1 full backup creates 3 backuppieces on the OS with unique backupset and bs_key. Could you give me an example how i can crossceck with v$backup_set and v$backup_set_details
|
|
|
|
Re: Configuring retention policy not for archive logs [message #404139 is a reply to message #404134] |
Wed, 20 May 2009 09:29 |
raj12
Messages: 15 Registered: May 2009
|
Junior Member |
|
|
Do you see the spot on the road?
That is where the horse died which had been beaten to death.
Since the carcass has been removed, perhaps we should just move on.
>> Do you have anything else to do beside commenting like this. if you dont have any technical knowledge why dont you just shut up and do your own business.
Do you even understand what we are talking about? lol...
I appreciate Mahesh's help but I am not forcing him to answer all my queries. If you dont want to answer why bother. Move on.. someone else may have the answer or better understanding .. thats what we have forums for...
[Updated on: Wed, 20 May 2009 09:34] Report message to a moderator
|
|
|
|
|