Remove arch log files-unix script needed
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Remove arch log files-unix script needed

  1. #1
    Join Date
    Sep 2000
    Location
    Chicago, IL
    Posts
    316

    Post

    I need to automate the removal of the archieve logs after a cold back-up.

    Can someone post that unix script, or a similar script here.

    Thank you.

    (If someone already has one, that will save me a lot of time; rather that starting one from scratch).

    Thanks.

  2. #2
    Join Date
    May 2000
    Location
    Portsmouth, NH, USA
    Posts
    378

    Wink heh



    hmm ... I just do this manually ...
    Maybe I should use a script as well. I normally keep about a 2 weeks worth of Archived Logs ...

  3. #3
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,095
    After a cold backup, you can remove all the archived redo logs (in theory of course). The point of a cold backup is that you get a complete copy of the database. Any changes after that point in time can be recoved via the archived redo-logs.

    Otherwise:
    find /u22/oraarch/$ORACLE_SID -mtime +5 -exec rm -f {} \;
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  4. #4
    Join Date
    Sep 2000
    Location
    Chicago, IL
    Posts
    316

    Question

    marist89 wrote:
    "find /u22/oraarch/$ORACLE_SID -mtime +5 -exec rm -f {} \"

    What is -mtime doing ?

    Also, all I really need to do is get a list of the files that are older than a certain time in a dir.-how do I do that?

    Anyone?

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,095
    man find

    -mtime detects files that have a modified time of x. If you specify +x, it finds files older than x days. If you specify -x, it finds files newer than x days old.

    To find files older than 15 days:
    find . -mtime +15 -print
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  6. #6
    Join Date
    Sep 2000
    Location
    Chicago, IL
    Posts
    316

    Unhappy

    OK, I have a related question:

    How to compare dates in UNIX. Can I day "if $x < $y", if x and y are variables ? If so, how ?

    Thanks.

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