Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««1234»»»

SCOME - Part 3: The Failed Jobs Report Expand / Collapse
Author
Message
Posted Tuesday, May 5, 2009 8:53 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: 2 days ago @ 9:51 AM
Points: 571, Visits: 516
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.
Post #710317
Posted Tuesday, May 5, 2009 9:37 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, January 12, 2014 9:26 PM
Points: 68, 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.
Post #710385
Posted Tuesday, May 5, 2009 9:40 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, January 12, 2014 9:26 PM
Points: 68, 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
Post #710392
Posted Tuesday, May 5, 2009 9:51 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: 2 days ago @ 9:51 AM
Points: 571, Visits: 516
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.
Post #710406
Posted Tuesday, May 5, 2009 10:27 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, January 12, 2014 9:26 PM
Points: 68, 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
Post #710450
Posted Wednesday, May 6, 2009 9:59 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, March 15, 2013 9:20 AM
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
Post #711249
Posted Wednesday, May 6, 2009 4:52 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 10:12 PM
Points: 164, Visits: 269
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
Post #711682
Posted Thursday, May 7, 2009 3:31 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, March 15, 2013 9:20 AM
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!
Post #712483
Posted Thursday, May 7, 2009 5:25 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, January 12, 2014 9:26 PM
Points: 68, 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]
Post #712529
Posted Friday, May 8, 2009 12:55 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, March 15, 2013 9:20 AM
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



Post #713275
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse