DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Win2K archive log cleanup script?

  1. #1
    Join Date
    Oct 2000
    Posts
    103

    Win2K archive log cleanup script?

    I have been tryin to write (what would be an easy script in unix) a script to delete archive logs on a win2k system that are over 3 days old. Does anyone have one written already? You would think that there would be a little better script capabilities for the money you pay for the OS!

    SM

  2. #2
    Join Date
    Nov 2000
    Location
    Potomac, Maryland
    Posts
    85
    You can do something like this:

    spool c:\delarc.bat
    select 'delete '||name ||' ' from v$archived_log where first_time < sysdate-3;
    spool off

    schedule aaaa.sql to run every night

    then schedule the delarc.bat file to run every night after aaaa.sql

    Please test this before inplementing it.

  3. #3
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    Originally posted by rmgirma
    You can do something like this:

    Code:
    -- Put this in a sql file called by a cmd file.
    spool c:\delarc.bat
    select 'delete '||name ||' >> delarch'||
        to_char(sysdate, 'YYYYDDMM')||'.log'
        from v$archived_log where first_time < sysdate-3;
    spool off
    Great idea! Here is some logging that you can add.

  4. #4
    Join Date
    Oct 2000
    Posts
    103
    thanks guys!
    for some reason i didnt even think about doing it from insode oracle, i was obsessing on getting the OS to do it with batch file commands.
    Ill give these a try.

    SM

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