May 9, 2007 at 10:01 am
Has anyone seen the below problem:
The SQL Agent Log has 9 log files totalling 260GB in size. How do I find out why this is happening and how to free up the space.
TIA.
May 9, 2007 at 11:03 am
It's normal behavior for SQL Server Agent to keep 9 archived error log files in addition to the current log. It opens a new one when the Agent service is stopped and started. You can delete the archived files while the Agent is stopped.
In SQL 2005, you can cycle the log without stopping the Agent.
Greg
Greg
May 9, 2007 at 11:18 am
I stopped the agent, deleted all the sqlagent.* files (except for .out) and restarted the agent and everything looks good at this time.
Thank you.
May 9, 2007 at 1:26 pm
You can run the following stored procedure to recycle your error logs.
EXEC sp_cycle_errorlog
May 9, 2007 at 2:24 pm
sp_cycle_errorlog cycles the SQL Server error log, not the SQL Server Agent error log.
Greg
Greg
May 10, 2007 at 6:05 pm
I would be seriously concerned if any of my SQL installations generated 260GB of log files. Are you doing full logging? And what sort of errors are you seeing in the log?
Leo
May 10, 2007 at 8:05 pm
These are agent logs and not error logs. It seems to me like 260GB of logs is unusual and this is the only server that i have had this problem on. The logs are pretty small since i had deleted the large files.
Anything in particular i should be looking for?
May 11, 2007 at 8:54 am
Here is a link, which may be helpful for the SQLAgent management.
http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=6645
May 11, 2007 at 2:00 pm
is there some way to limit the size of the error logs, for example 2 or 5 MB each? Would appreciate any pointers/advices.
May 11, 2007 at 4:13 pm
None that I know of. Just create a job that cycles the log. Try cycling it once a month. If that's not enough, do once a week.
-SQLBill
May 12, 2007 at 4:39 am
If the agent logs cycle each time you restart it then schedule a Windows job to do that every week or however often you think it is necessary
May 15, 2007 at 7:42 am
Not by size. But for each new server I setup, I make it standard practice to put in a job to run sp_cycle_errorlog and sp_cycle_agent_errorlog at midnight every day. This keeps the logs limited to one days worth of messages, at a size that is easily handled and loaded into text editor. I've seen servers where the SQL Server does not get restarted for months, and the log file will be > 100mb, and it is difficult to open and review the log for problems.
Also, I set the SQL Server Error Log to keep 30 days of log files, so I can check back up to a month.
Note that in SQL 2005, you can right-click on SQL Agent Error Log in Mgmt Studio and recycle the log manually.
Hope this helps
Mark
May 16, 2007 at 7:40 am
It's actually sp_cycle_agent_errorlog to cycle the sql agent log if you're on sql 2005.
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply