Re: How long to keep archive logs?

  • From: TESTAJ3@xxxxxxxxxxxxxx
  • To: "jcmiranda" <jcmiranda@xxxxxxxxx>, "janine" <janine@xxxxxxxxxx>, "'oracle-l L'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 21 Apr 2010 06:36:38 -0400

That works great if you don't have a standby database.  If you'd like for me to 
relaborate, just ask.

Sent from the crackberry, so please excuse the typos and terseness.

----- Original Message -----
From: Juan Miranda [jcmiranda@xxxxxxxxx]
Sent: 04/21/2010 11:05 AM ZE2
To: <janine@xxxxxxxxxx>; "'oracle-l L'" <oracle-l@xxxxxxxxxxxxx>
Subject: RE: How long to keep archive logs?


This script delete archivelogs (older first) if free space on disk is less
than a value:

echo  "Free space in /archivelog"
free_space=`df -m /archivelog | grep dev | awk '{print $4}'`
echo $free_space

# Min free 10GB

while [ $free_space -lt $min_free_spc ]
  echo "deleting 10 archivelogs "
  find /archivelog -type f | xargs  ls -l --time-style=long-iso | grep .arch
| sort -r -k6 -k7 | awk '{print $8}' | tail | xargs rm
  free_space=`df -m /archive_orzan | grep dev | awk '{print $4}'`
  echo $free_space

You must create a cron task to execute it.
This way you always have an amount of archivelogs on disk AND free space

This is for linux, tell me if you need it for Windows.
And... try RMAN.


-----Mensaje original-----
De: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] En
nombre de Janine Sisk
Enviado el: martes, 20 de abril de 2010 21:07
Para: oracle-l L
Asunto: How long to keep archive logs?

Here comes another one of those extremely newbie questions...

I have turned on archive logging for the first time, so of course I now have
large archive log files piling up.

I currently do my backups via the caveman begin/end backup method, because
it works very well with Amazon EC2's snapshot feature.  I eventually plan to
implement RMAN backups as well, but have not done it yet.

I have gathered from the reading I have done that archive logs do not need
to be kept once a backup has been taken, but I'm not sure if that applies to
the type of backups I'm doing or if it is only true if RMAN is involved.  It
seems logical that I would not need them;  if I needed to recover back to
before the last snapshot, I would just restore that and be done with it.

Can anyone tell me what a reasonable deletion strategy would be for these
log files?






Other related posts: