-
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
-
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.
-
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.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|