Re: How to restart executing jobs after server reboot?



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@xxxxxxxxxxx> wrote in message news:1114722340.235401.165580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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.
>


.



Relevant Pages

  • Re: At job not executing
    ... >output of that command will go in the user's email. ... while crontab jobs are correctly executed on ... >possible that cron keeps subsequent at jobs in the queue if the limit ... not just not executing. ...
    (comp.unix.sco.misc)
  • Re: SQL agent jobs fail after upgrading windows2000 to windows2003
    ... It sounds like you are executing something other than T-SQL in your jobs. ... > Executed as user: SQLAdmin. ...
    (microsoft.public.sqlserver.server)
  • Re: TSQL to find all running SQL Agent jobs
    ... executing. ... you can refer to system tables like sysjobs* for making the query. ... > list all jobs that are currently running ...
    (microsoft.public.sqlserver.programming)
  • How to restart executing jobs after server reboot?
    ... the server maintenance people reboot the server? ... After the reboot, I ... have been manually restarting any jobs that were executing or retrying. ...
    (microsoft.public.sqlserver.dts)
  • Re: DBA dissappointed in sql server 2005
    ... "Charles Pritt" wrote in message ... > it backsup a database. ... I have 75 seperate sql server boxes, some with multiple instance, all ... > with many many databases and scores of jobs. ...
    (microsoft.public.sqlserver.server)