Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Delete history from 'Job Activity Montor'

Author  Topic 

Big_tim
Starting Member

22 Posts

Posted - 2010-03-16 : 05:16:36
Hi guys,
I've got a question about the Job Activity Monitor.
I'm running a script each morning that pulls back daily check data on a number of servers and on one of them I get the same warnings that jobs have failed. Going into activity monitor these jobs are ones that failed quite some time ago, but I can't delete them as they may be needed in the future. What I want to do is just delete the history that says they failed. However, if I 'View History' of the jobs there is nothing in there so I can't delete it!!
Any one have any idea on how to clear the failed job reports? It has to be just these ones, not any others so can't run sp_cycle_errorlog (unless you know otherwise?)
Thanks
Tim

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-16 : 14:41:08
sp_cycle_errorlog is irrelevant to this problem as that only cycles the SQL Server Error Log, which is not related to the job history.

Just change your job step to "select 1" and then run it. It'll show as success now, so change your job step back to the original. This is the easiest way to show a job as being successful. It's better not to mess with the msdb tables that store this data.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

Big_tim
Starting Member

22 Posts

Posted - 2010-03-17 : 08:16:54
Thanks Tara,
Just to clarify do you mean to just change the t-sql in the job to:
Select 1
And comment out the rest?
I'm thinking it would be ok to just add another step to the end (with select 1) and start the job from that step and then remove the step afterwards?

Tim
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-03-17 : 09:50:39
or you can modify your script. sounds like the job(s) in question are disabled now. add WHERE enabled = 1
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-17 : 16:14:42
quote:
Originally posted by Big_tim

Thanks Tara,
Just to clarify do you mean to just change the t-sql in the job to:
Select 1
And comment out the rest?
I'm thinking it would be ok to just add another step to the end (with select 1) and start the job from that step and then remove the step afterwards?

Tim



Either way works, just as long as you can get it to be successful.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -