Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

RMAN backup to disk management techniques

SOLVED
Go to solution
Randy Hagedorn
Regular Advisor

RMAN backup to disk management techniques

Hi all,
I am trying to develope an RMAN database backup to disk which I then will fbackup to tape, but am having a problem with the management of the disk files that are created.

Once the fbackup is complete, what do I do with the files that now exist on disk? I probably will leave them there until the next RMAN session, at which time I think I need to delete the last backupset of many files, so I don't fill up my disk space.

I know that RMAN can delete old backupsets, but how can I write a script (???) to find and delete all of the old backuppieces (of which there are many) that I made with the last backup?

Am I crazy for do it this way?

Thanks in advance,
Randy
6 REPLIES
Robert-Jan Goossens
Honored Contributor

Re: RMAN backup to disk management techniques

Hi Randy,

How about cron

find /dir -name "backup*" -mtime +1 -exec rm {}\;

Regards,
Robert-Jan
Steven E. Protter
Exalted Contributor

Re: RMAN backup to disk management techniques

Attaching a script that includes the statments you need to do this.

let cron do it.

The library that is referred to is not necessary to do what you want. You can crank this right after the fbackup returns code zero.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Randy Hagedorn
Regular Advisor

Re: RMAN backup to disk management techniques

Steven,

Can you send me the attachment differently, I am having trouble opening it.

Thanks,
Randy
Robert-Jan Goossens
Honored Contributor

Re: RMAN backup to disk management techniques

Randy,

check this version.

Regards,
Robeert-Jan
Randy Hagedorn
Regular Advisor

Re: RMAN backup to disk management techniques

Robert,

Thanks a ton .. I got it this time!

Randy
Yogeeraj_1
Honored Contributor
Solution

Re: RMAN backup to disk management techniques

hi randy,

i use a similar script to generate one for me:
=============================================
#!/bin/sh
echo "rman target sys/manager@mydb rcvcat rman/rman@catalog msglog /backup/rman/logfiles/rman_full_delete-`date +%d%m%y-%H%M`.log </dev/null"
echo "allocate channel for delete type disk;"
for i in `ls -1 /backup*/rman/full/fs*/* `
do
echo "change backuppiece '$i' delete; "
done
echo "release channel;"
echo "exit;"
echo EOF
=============================================

hope this helps too!

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)