dbTalk Databases Forums  

How to restart executing jobs after server reboot?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How to restart executing jobs after server reboot? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
annem96145@hotmail.com
 
Posts: n/a

Default How to restart executing jobs after server reboot? - 04-28-2005 , 04:05 PM






Has anyone had the issue where you have jobs executing or retrying and
the server maintenance people reboot the server? After the reboot, I
have been manually restarting any jobs that were executing or retrying.
Is there a way to restart the jobs automatically/progammatically? Is
there a table in the msdb database that can be queried to get this
information - then a job could be created that runs when sqlserver
agent starts to find jobs that were executing/retrying and restart
them. Any ideas? Thanks.


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How to restart executing jobs after server reboot? - 04-30-2005 , 01:52 AM






There may be a couple of ways open to you

Both would require:

Have a job that starts at agent startup.


1. In your jobs you create add a step at the start that inserts into a table the time it started. , Add anoher step at the end
which updates that same row to show when it finished. Anyjobs that failed or were stopped midway through will have no EndTime
value.

2. You could look in the msdb.dbo.sysjobhistory table in the message attribute for the following

"The job was stopped prior to completion by Shutdown". You can then look at when it was executed etc.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com


<annem96145 (AT) hotmail (DOT) com> wrote

Quote:
Has anyone had the issue where you have jobs executing or retrying and
the server maintenance people reboot the server? After the reboot, I
have been manually restarting any jobs that were executing or retrying.
Is there a way to restart the jobs automatically/progammatically? Is
there a table in the msdb database that can be queried to get this
information - then a job could be created that runs when sqlserver
agent starts to find jobs that were executing/retrying and restart
them. Any ideas? Thanks.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.