Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to empty error log

Status
Not open for further replies.

holdahl

IS-IT--Management
Apr 4, 2006
213
NO
how do you empty the SQL Server Agent Error Logs?

should you empty these logs or keep them? where do you define how long to keep them (history)?


sH
 
Right click SQL Server Agent and navigate to Properties. Go to the Job System tab where you can set log sizes and clear the log by clicking the "Clear Log" button.

I know of no place where you can set the time limit on how long these logs are kept, though.



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
A better way to clear the log is to set a job that runs:

sp_cycle_errorlog

I run that every Friday morning. The default is (I believe) 6 error logs. One current and 5 'archive'. As a 7th is created, the oldest one is 'removed'.

-SQLBill

Posting advice: FAQ481-4875
 
there is no 'Clear log' button under Job System - in properties under Sql Server Agent
 
Really? How odd because I have one on my Properties -> Job System tab right under the "Maximum job history rows per job" box.

What version of SQL are you using? I wonder if this is something affected by a service pack.





Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
Catadmin,

I found the button to clear the 'Job History Log' where you describe. But not a button for the 'Error Log'.

-SQLBill

Posting advice: FAQ481-4875
 
Don't find a button for clear 'Job History Log' either...

I'm using SQL Server 2005.
 
Not sure if this will help, but I just discovered it in SQL 2005 SSMS.

If you create a new Maintenance Plan, one of the tasks available is a History Cleanup Task which cleans up all sorts of histories, like backup & restore / SQL Server Agent / Maintenance Plan histories.

Another task available is the Maintenance Cleanup Task which only does the MP stuff.



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
What are these error logs? How do you set these logs?
I see around 3000 error logs for 15 days and there is message within 5 minutues(it is not consistent, some times 5mnts and sometime it is 2mnts etc.,) and message is like
"[Log] Unable to read local eventlog (reason:The parameter is incorrect)"
what is this?

In the archive, I have million records for logs? What are these? Do they take any space?

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top