Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SCOME - Part 3: The Failed Jobs Report


SCOME - Part 3: The Failed Jobs Report

Author
Message
dwithroder
dwithroder
Mr or Mrs. 500
Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)

Group: General Forum Members
Points: 577 Visits: 596
I also had to exclude 5 (unknown) from last_run_outcome in usp_getFailedJob. Had a bunch of 0's in the last_run_date in this case and broke the convert.
Drew Salem
Drew Salem
Valued Member
Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)

Group: General Forum Members
Points: 72 Visits: 172
dwithroder (5/5/2009)
I also had to exclude 5 (unknown) from last_run_outcome in usp_getFailedJob. Had a bunch of 0's in the last_run_date in this case and broke the convert.


Hi

Are you refering to last_run_date/last_run_time or last_run_outcome? last_run_outcome should not be effected by last_run_outcome.

If you're refering to the latter, you can customise last_run_outcome. I chose it to fail whenever it was unsuccessful. "last_run_outcome <> 1" but you don't have to. There's a number for each status in books online such as Running, Disabled etc

If you are refering to the date, all my jobs have run dates, as they've all been run at sometime, so I rarely have this problem, but if you have a job has never had a run date, then you can give it one manually in the system table or by setting it to report successful when it fails (in the advanced tab of the job). Then run the job once. It will then fail, but report as being successful and give it a proper last_run_outcome date. Then change it back to report failure on failure. From then on, your convert wont break.
Drew Salem
Drew Salem
Valued Member
Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)

Group: General Forum Members
Points: 72 Visits: 172
gary.dunn (4/30/2009)
Thanks Drew, we're looking forward to the new articles.
Quick question: We have set up links to several servers that just have the default instance installed and it works great...however, how can we set up servers with named instances? For example, we have a SQL Server farm with 9 named instances. How can we link to each of the named instances for monitoring?

Thanks.

Gary and Ann


Hi Garry,

Did you get this working in the end? I've never tried it with named instance, but I can give it a shot tomorrow if you haven't.

Drew
dwithroder
dwithroder
Mr or Mrs. 500
Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)Mr or Mrs. 500 (577 reputation)

Group: General Forum Members
Points: 577 Visits: 596
I haven't gotten into all the existing jobs yet, but have a bunch with
last_run_outcome = 5
last_outcome_message = NULL
last_run_date = 0

and was tinkering with code (and commenting on the fact) just to get things to run and follow along with your articles. Have enjoyed the read.
Drew Salem
Drew Salem
Valued Member
Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)

Group: General Forum Members
Points: 72 Visits: 172
Fair enough. Here are the last_run_outcomes:

http://msdn.microsoft.com/en-us/library/ms187387.aspx

I hope to finish article 4 tonight. Thanks for joining in and the feedback.

Drew
gary.dunn
gary.dunn
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 113
Hi Drew, no we haven't got this working. We'll be adding more named instances to this server, so SCOME would really be a great tool to monitor them. Just need to be able to connect to them. Do you have any ideas?

Thanks,

Gary
Nick Hart
Nick Hart
SSC-Enthusiastic
SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)

Group: General Forum Members
Points: 179 Visits: 365
Hey Drew, nice set of articles. Have something similar at work and monitor 80+ instances and that's just MSSQL. Though we only use Rep Services to display results. The .Net is what we're thinking might be really good for us.

Gary - for named instances we have the linked server as "SERVERNAME\INSTANCENAME" and then in our servers table we have the servername as that SERVERNAME\INSTANCENAME. This wroks a treat for us. On one of our development boxes has 3 2000 and 3 2005 named instances. Can get stat's for all of them. Hope this help

Nick
gary.dunn
gary.dunn
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 113
Hi Nick, I thought we tried that and it didn't work. I tried it again and now it works?! I must've been doing something wrong. Next question: were you able to get the usp_GetFailedJob stored procedure to work? Here's what I did...I failed a job on my named instance SERVER1\TSTINST1. I also failed a job on a server with just the default instance called SERVER2. I added both servers to the Server_SQL_Details table. I execute usp_GetFailedJob with my named instance server as the parameter (like this - exec usp_GetFailedJob SERVER1\TSTINST1 and it gives an error:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '\'.
It doesn't like the \. How did you get around that?

Thanks!
Drew Salem
Drew Salem
Valued Member
Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)Valued Member (72 reputation)

Group: General Forum Members
Points: 72 Visits: 172
gary.dunn (5/7/2009)
Hi Nick, I thought we tried that and it didn't work. I tried it again and now it works?! I must've been doing something wrong. Next question: were you able to get the usp_GetFailedJob stored procedure to work? Here's what I did...I failed a job on my named instance SERVER1\TSTINST1. I also failed a job on a server with just the default instance called SERVER2. I added both servers to the Server_SQL_Details table. I execute usp_GetFailedJob with my named instance server as the parameter (like this - exec usp_GetFailedJob SERVER1\TSTINST1 and it gives an error:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '\'.
It doesn't like the \. How did you get around that?

Thanks!


Have you tried it with brackets? Exec usp_GetFailedJob [SERVER1\TSTINST1]
gary.dunn
gary.dunn
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 113
That did the trick! Thanks! I've added additional servers to table Server_SQL_Details for a total of 10. I have one job in failed state on my named instance server.

So I run it with the brackets and I check the Failed_Jobs table and there is one entry, which is good.

Then I run usp_Iterate_FailedJobs procedure and I get this:
(10 row(s) affected)

(1 row(s) affected)
Msg 241, Level 16, State 1, Line 3
Conversion failed when converting datetime from character string.

I check table Failed_Jobs and it is empty. Am I doing something wrong?

Thanks,
Gary
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search