Archive log question
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: Archive log question

  1. #1
    Join Date
    Jan 2001
    Posts
    642

    Archive log question

    Hi,

    I have a question on Archive logs. I am compressing the archive logs with a cron job. What will happen if arch process has just started to create a new file and the compress cron job start compressing it.

    As the arch file being written has compressed, will the oracle write to a different arch file or will it hang and fail.

    Badrinath
    There is always a better way to do the things.

  2. #2
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Not quite the answer to your question:
    Had the same prob under NT - pkzip created an unusable zip file (Oracle did not hang). Worked around it by moving the file to another directory before zipping. The move failed with a sharing violation if the file was still being written and the zip job found nothing new to do - so no zip file (get it in the next cycle) instead of a "corrupted" one.

    I hope you can translate that to UNIX.
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  3. #3
    Join Date
    Jan 2001
    Posts
    642
    Hi,

    The unix systems don't lock the files as the windows does. I allows to delete the file while it's in use!!
    There is always a better way to do the things.

  4. #4
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Sorry, didn't know that - I'm no UNIX expert.
    So one up to Bill Gates, eh?
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  5. #5
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    Use a script for cron that has to check date when a archile log was created.

  6. #6
    Join Date
    Jan 2001
    Posts
    642
    Hi Thanks,

    I am tring to understand what will happen in that scenario. I already have the script which will compress all the files except the recent ones.

    But in theory, what should happen if the arch process is writing and that arch file is deleted.

    Badrinath
    There is always a better way to do the things.

  7. #7
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843

    Re: Archive log question

    [QUOTE]Originally posted by badrinathn
    Hi,

    I have a question on Archive logs. I am compressing the archive logs with a cron job. What will happen if arch process has just started to create a new file and the compress cron job start compressing it.

    As the arch file being written has compressed, will the oracle write to a different arch file or will it hang and fail.

    Badrinath
    [/QUOTE

    Neither might happen.Unix will not remove the existing file (unzipped) until it zips 100% of the file. So, I guess oracle keeps writing the file and zipping process might get failed, but not archiving process of oracle. You can test it and go with it ELSE under benefit of doubt, Do not let your zipping process start instantly, give time atleast for 10 logs to be archived before your script capture logs for zipping.
    Reddy,Sam

  8. #8
    Join Date
    Jan 2001
    Posts
    642
    Hi Sam,

    Very convincing answer. I think that really make sence now!!

    Just another thing!! What if the file is deleted or moved while the arch is still writing to a file.

    Badrinath
    There is always a better way to do the things.

  9. #9
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    Originally posted by badrinathn
    Hi Sam,

    Very convincing answer. I think that really make sence now!!

    Just another thing!! What if the file is deleted or moved while the arch is still writing to a file.

    Badrinath
    It creates the file with less contents(say there is log of 100 MB, you deleted after archiving 50MB, you do get log but, only 50MB)You get incomplete file which can't be used for recovery most probably... forgot there is specific error it says incomplete file for recovery.
    Reddy,Sam

  10. #10
    Join Date
    Jan 2001
    Posts
    642

    Thumbs up

    Excellent, Thank you very much!!
    There is always a better way to do the things.

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