Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a big problem with the SQL Server Agent hostory. it has become VERY VERY slow when i try to view it. If I try through Management Studio I often get a timeout and if I try viewing it with sp_help_jobhistory it is just running for a long time.

I tried reducing the hostory size and the sysjobhistory table has only 8000 rows....

Is there any way to optimize this somehow?

Thx a lot Nicolaj

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Ensure that the sysjobhistiory table is not fragmented. The easiest thing to do is reindex it. Since the table is so small, the reindex should happen quickly.

share|improve this answer
    
that did the trick! thx –  NicolajB Jun 11 '12 at 12:57

You could try to more regularly cycle (start new) your agent log. That can be done with EXEC msdb.dbo.sp_cycle_agent_errorlog; . Perform this periodically and your logs will remain both smaller and more manageable. (I generally create an Agent job that cycles the log weekly.) BTW, you can also cycle the error log as well with EXEC master.sys.sp_cycle_errorlog;.

share|improve this answer
    
good idea.... i do it already on the error log –  NicolajB Jun 11 '12 at 12:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.