Removing Archived logs
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Removing Archived logs

Hybrid View

  1. #1
    Join Date
    Jun 2003
    Posts
    7

    Removing Archived logs

    As my username suggests, I'm more familiar with Informix than Oracle. I administer over 14 Informix instances here, and I have a few Oracle instances that I must maintain, also.

    In doing so, I've found that there are alot of archived log files (over 2yrs old) in the $ORACLE_HOME/admin/$SID/arch dir. I'm fairly sure most of these log files are not needed for recovery, and I'd like to delete them.

    Is deleting them with the unix "rm" command, the proper way to do so? Or does Oracle recommend a better way? I could not find any documentation on the removal of these files. Thanks for your help.

  2. #2
    Join Date
    Sep 2002
    Posts
    411
    take a cold back for system before your remove the archive

    and yeap "rm" will do the trick

  3. #3
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    You might want to consider compressing older archived logs. We do that via a nightly cron job:

    00 22,8 * * * /usr/contrib/bin/gzip /u623/oradata/arch/DBNAME/*.arc > /dev/null

    We delete the old archived logs after our weekly hot backup is completed.

    The cleanup script looks like this. (you pass in the instance name)

    >more cleanup_archive.sh
    #! /bin/sh

    INSTANCE=/u623/oradata/arch/$1

    cd $INSTANCE

    /bin/find "$INSTANCE" -type f -name "arch_$1_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].arc*" -mtime +7 -print -exec rm -f {
    } \;

    exit 0

    This deletes archive logs older than 7 days.
    Last edited by KenEwald; 06-12-2003 at 04:22 PM.
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

  4. #4
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Originally posted by mike2000
    take a cold back for system before your remove the archive

    and yeap "rm" will do the trick
    Why whats the need of taking a cold backup ??

    As for the question. You need to find out when the last few backups were taken. Keep the archive for last two (or three) backup and remove the rest of the archive logs. To be on the safer side copy them on some tape drives (not all but say archived log 1 week older than your 3rd last backup) and then remove the archived logs.

    HTH
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  5. #5
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    A cold backup would give a solid point at which to delete archived logs.

    For an informix guy that's a good, simple, straightforward suggestion.

    It's simple and it'll work.
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

  6. #6
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Originally posted by KenEwald
    A cold backup would give a solid point at which to delete archived logs.
    Hmmm... only if down time is allowed.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  7. #7
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    True.
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

  8. #8
    Join Date
    Jun 2003
    Posts
    7
    I have "cold" backups running every Sunday morning, so I should be ok to start deleting the "older" log files. Thanks for your help guys.

  9. #9
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by KenEwald
    A cold backup would give a solid point at which to delete archived logs.

    For an informix guy that's a good, simple, straightforward suggestion.

    It's simple and it'll work.
    Please! Don't give the informix_guy the wrong impresson that cold backup would be in any way more solid point to delete arch logs than a hot backup would. That would make him to be one more of the loosers that belive in urban legend that cold backup is anything safer (or simplier) than the hot backup

    Any full backup (either hot or cold) is the same in respect of which old arch logs you still need.

    I also don't understand the meaning of "[Cold backup (and recovery from it)] is simple and it'll work". In what part is it simplier than hot backup and in which case hot backup would not work?

    So informix_guy, here is the consise answer to your question:

    When performing media recovery, you'll never need any arch log that was created before your backup (either hot or cold), from which you restored the database, was taken. So you'll have to decide which backup is the earliest possible one that you'll ever need for recovery, and you can safely delete all arch logs that were created befor that backup started.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  10. #10
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Originally posted by jmodic
    When performing media recovery, you'll never need any arch log that was created before your backup (either hot or cold), from which you restored the database, was taken. So you'll have to decide which backup is the earliest possible one that you'll ever need for recovery, and you can safely delete all arch logs that were created befor that backup started.
    *clap* *clap* *clap*

    That's a very good answer indeed.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width