cancel
Showing results for 
Search instead for 
Did you mean: 

Backup to local disk, how to overwrite the old backups?

Former Member
0 Kudos

Hi evrybody, i hope this is the correct forum for my question,

in my dev machine with win2000, oracle 9.2.x and 4.6C running I am doing complete offline backup to a local USB disk every week.

The backup is working, in my backup dir i can found the \SID directory with the logs of the backups, and a directory for every backup done called somthing like \bebdxxx.

I see that the new backup never overwrite any of the old one, so obviously the disk is growing on size.

The only value that I think have to do with this in my init<SID>.sap is expir_period that is currently = 1.

I would like to set a number of day in which keep the backup, but later than that when doing a new backup i want to overwrite the old one, or delete the old one and do the new backup.

Or otherwise always overwrite the old backup.

Any suggestion?

Thanks in advance, Arturo Bardelli

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

> Or otherwise always overwrite the old backup.

> Any suggestion?

Hello Arturo,

overwriting an old backup really is the worst thing you can do.

What if something is wrong with your new backup?

What if you start to take the new backup, partially overwrite the old (good) one and then your dev box crashes and the database needs a restore?

No, overwriting backups is utmost nonsense!

So, what can you do here?

Well, usually backups to local disks are meant to serve as intermediate backup locations from where you save the backuped files to the real backup medium e.g. a tape.

After this real backup it's safe to delete the file system backup.

With brbackup you can do that (save to tape and delete filesystem copy) with the -bd (backup_delete) action. (reading the [documentation|http://help.sap.com/saphelp_erp2004/helpdata/en/44/d8f1902adc11d29fe90000e8a5ae06/content.htm] helps... )

If you're really going to stick with your "USB-BACKUP-SOLUTION" (the wording alone is funny - ever wondered where you would get your data back from, if, say there is a fire in the server room?), then you may want to use the -db (delete_backup) action. (again... the [documentation|http://help.sap.com/saphelp_erp2004/helpdata/en/38/2fe03a00281877e10000000a11402f/content.htm] has it all...).

But please - don't use this action with the option "last", as this would simply delete the last successfull backup...

regards,

Lars

Former Member
0 Kudos

Hello Lars, thanks for your answer,

unfortunatly my backup tape device is broken on that machine, so I have to arrange with an external disk, or to a remote location on a remote disk.

When I say that I was thinking about to overwrite the last backup I meant that before to overwrite that backup for sure I have to take a copy.

But I would like to keep more than 1 backup in my backup directory and to delete the oldest backup with an automatic operation, I think that with the comand you suggested me " BRBACKUP -db <backup_logname> " Is not easy to do that in automatic because the last backup always has a different logname. (like beauxxx)

Instead if I use a script that copy the last backup to another location, and after I schedule a command like " BRBACKUP -db last " maybe is going to work completely in automatic.

Do you know if is possible to schedule a command like that by DB13? Or I should schedule an extern comand from sm36, or by operating system?

Thanks in advance.

Arturo

lbreddemann
Active Contributor
0 Kudos

> Instead if I use a script that copy the last backup to another location, and after I schedule a command like " BRBACKUP -db last " maybe is going to work completely in automatic.

Yes, that should work.

> Do you know if is possible to schedule a command like that by DB13? Or I should schedule an extern comand from sm36, or by operating system?

DB13 is not a general scheduler but just offers the build-in commands.

Therefore, if you want to schedule a home-grown script, you've to resort to other schedulers, e.g. the windows task scheduler.

regards,

Lars

Answers (0)