• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

Clear system logs in Event Viewer

My system logs in the event viewer are always full every now and then. A dialog will often pop up to say system log full. Thus it is quite troublesome to clear them manually. I would like to generate a script to clear the system and application log every week. Do you have any suggestion to go about doing it?

I would like to learn to write scripts in NT. Do you know where to get the resource or books on this area? Recently, I want to write a script to view the v$session in the database.
So I tried to execute the sever manager by putting C:\orant\Bin\svrmgr23.exe in the script. But I do not know how to pass the parameter such as "connect internal" to svrmgr. In unix this can be done using back file like this
svrmgrl << !
connect internal
spool session.log
#another script which select from #v$session
@session
spool off
exit.

How to do this in NT?
0
rosetalk
Asked:
rosetalk
  • 3
  • 2
1 Solution
 
rosetalkAuthor Commented:
Edited text of question.
0
 
j2Commented:
As for event viewer, just set it to "overwrite as needed" then the old entries will be deleted when the log is full.

in nt you can "command < file" but stdin / out on NT is pretty broken, so most commands have a switch for "use this file" look inte manuals.
0
 
rosetalkAuthor Commented:
I have tried your method but is doesn't seem to work.
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
j2Commented:
As i said.. "it doesnt work in most cases". Read the manual and look for an option to read from a file.
0
 
carmineCommented:
Why don't you use:

....\svrmgr23 @cmdfile

Where cmdfile.sql contains:
connect internal
spool session.log
#another script which select from #v$session
@session
spool off
exit


Mark
0
 
rosetalkAuthor Commented:
Thanks, I will try it out
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now