SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Nightly Failed Jobs Report


Nightly Failed Jobs Report

Author
Message
ckempste
ckempste
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2963 Visits: 1
Hi

Dont forget jobs that are "still" running, ie. havent finished from when they where scheduled to run at 1am for example and its now 10am, this is a classic item that is easily skipped by the DBA but can result in major problems.

Cheers

Chris


Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
Greg Larsen
Greg Larsen
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4167 Visits: 290
Good point. If I add that to the script some day, then I'll make sure I post it.

Gregory Larsen, DBA

If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

Gregory A. Larsen, MVP
tmftrauma
tmftrauma
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 1
Hi,

Great scripting, Greg. I am searching for an alternative to using xp_sendmail (we don't use it due to 1 way trust from data warehouse to domain with exchange). Perhaps a version of sp_sendmail that allowed the @query! Hmmm..



tmftrauma
tmftrauma
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 1
sorry perhaps i should clarify (since sp_sendmail is in house). Since our datawarehouse domain is seperate and not a trustee of our administration domain, xp_sendmail requires an exchange server (or other MAPI mail server) in the same domain. Thus we created sp_sendmail which doesn't include the @query function so Greg's script requires some tweaking. I'm almost complete with a stored proc that includes the name of the failed job in the subject. We use a DTS package for a weekly failed job report.



ALZDBA
ALZDBA
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28569 Visits: 8986
This is a nice solution if you only want to followup the sql-server-stuff.
We use HP-openview-managex/HP-OperationsW to followup the nt-eventlogs of our servers. All our jobs report failings to the eventlog.

Jobi

Johan


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
tmftrauma
tmftrauma
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 1
BTW, does anyone know how to include the name of a job in the subject of an email? msdb..sysjobhistory doesn't get updated until the job is complete (run_time). Does anyone know if this is possible?

thanks



Greg Larsen
Greg Larsen
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4167 Visits: 290
Not exactly sure what you are trying to do, but seems that if you know the job_id, then you can always uses the sysjobs table to get the jobname.

Gregory Larsen, DBA

If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

Gregory A. Larsen, MVP
Steve Jones
Steve Jones
SSC Guru
SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)

Group: Administrators
Points: 141298 Visits: 19416
Not a bad solution. I've done something similar, but I let each server query itself and store the results in a table. Then I have a master server that queries all these servers (use DTS, transform task) to roll up all information.

Couple things I found on jobs:
1. Don't like to do steps. I just want to know what failed. I can dig in if it's important. Also, for some jobs this gets cumbersome, like log dumps. We dump every 15 minutes. Having that fail all night really munges up the report, so I only report a single failed instance.
2. I store the last time I ran the report. Why? If the report job fails today and I spend a day getting it fixed, I want to get the report to return everything I may have missed, so I'll want more than a days worth of data. Plus this handles weekends as well.

Steve Jones
sjones@sqlservercentral.com
http://www.sqlservercentral.com/columnists/sjones

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
M&M
M&M
SSCertifiable
SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)

Group: General Forum Members
Points: 5889 Visits: 3913
How to configure this if we are using the other xp

xp_smtp_sendmail

I am not able to generate the full report...the report of nightly jobs

M&M
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