cancel
Showing results for 
Search instead for 
Did you mean: 

Delete archive logs from "saparch" directory

Former Member
0 Kudos

Hi Gurus,

I am searching for an option to delete archive log files from saparch

directory leavy a copy of 2 days archive logs in sapcrch directory.

On Development & Quality servers we have set an option "-sd" where it

is deleting the archive logs once they are backed up to sapbackup

directory.

I would request you to let me know if there is any option which leaves 2

days of archives in saparch directory and deletes the previous days.

Right now in PRD we have set an option "-s" where it is leaving the

archive logs as it is in saparch even after the backup, because of this

our saparchive directory space came to very low.

I need to rectify this ASAP. please reply back ASAP

Let me know if you need any furthur information from my end

Thanks a lot in advance

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Lakshmana

Well, in my opinion if u have an online backup, teh n there is not much need of keeping old archive files. As already mentioned, brarchive runs with parameter -cds to represent copy-delete-save.

The archives are required to reach teh DB to the last archived taken level but after restoration of the last full online backup. So if you have a latest online backup, then after restoration of the same, you wud require only the archives later than that. So older files are of no use.

A word of caution : Do ensure that your online backup restores back too as many a times people kept taking backup only to know in the end that it won't restore back. In case your partition is getting filled up, you can move the old files to some other location or delete them manually.

Hope it helps

Regards

Lokesh Gupta

Former Member
0 Kudos

You could use a simple find command to delete all those older than 3 days.

I've done something similar before.

1. It involved backing up archive files to tape using -s.

2. Then backing up to another area on disk using -s and -d disk

3. Then removing from saparch using -ds.

4. Finally using a find command, remove all those older than 3 days from the disk area in step 2.

Alternatively, you could perform the following:

a. Count number of archive files in saparch older than x days.

b. Run brarchive -s to save all DBF files.

b. Run

brarchive -ds -n X

where X is count from a.

Message was edited by:

Stephen Kerr

Former Member
0 Kudos

Hello Lakshmana,

Why do you want to keep archive files in saparch after archive backup?

Won't it be a good idea to save these elsewhere?

You can always bring them back, if you require a receovery...

1) Use the -cds which will save your archive files twice.

For your specific requirements, I suggest you do the following.

Option 2:

1) Schedule archivals with -s option (as in your production system)

2) Schedule a crontab (incase of UNIX) or AT (incase of Windows) which will run everyday and delete files that are older than 'n' days

Make sure than archivals are run everyday or this scheduled job will delete your archive files before they are backup.

to overcome this you can plan the crontab / AT job to copy the archive files to 'other' location before it deletes them.

Regards,

Ammey Kesarkar

Former Member
0 Kudos

Hi Manas & Ammey

Thanks a lot for your quick response.

We are on SUN OS. Right now we are backing up the DB as full online backup + archives to disk. and then Tivoli is comming in to take the backup to tape

We are maintaining 3 copies of Full online back up + archives on the disk and also we are taking the backup to tape.

when ever I check I have full online DB backup + archives for 3 days long on disk

I am just feeling that y I still need to maintain them in SAPARCH directory

Please suggest

Thanks

Former Member
0 Kudos

Hi,

Taking bkups to disk first it means backup_dev_type is set to disk.

During a backup to disk, an offline redo log file has the status DISK. A second

copy is not supported. The only statuses here are DISKSAV (first save to disk)

and DISKDEL (deletion after a save to disk).

Regards

Former Member
0 Kudos

Hi,

SAP recommends using the option -cds

(copy_delete_save), which is also the default option when starting BRARCHIVE

from transaction DB13.

First, all offline redo log files with status SAVED are saved to tape for a second

time, and subsequently deleted from disk. Then, all offline redo log files with

status ARCHIVE are backed up to tape for the first time, and their status is

changed to SAVED.

After the backup, all offline redo log files exist at two locations: either in directory

oraarch and on tape, or on two different tapes. Thus, you can achieve a high

fail-safe rate without drastically increasing the tape requirement.

During a backup to tape, an offline redo log file has the status ARCHIVE. At first

save, the file status is SAVED; the second time, it is COPIED; and after deletion

it has the status DELETED.

I dont think there is a parameter which can regulate the no of days to hold the redolog files for a specific no of days.

Hope this can resolve you requirement.

Regards