PRB: Autostart Task Fails and Does Not Restart Automatically (197096)
The information in this article applies to:
This article was previously published under Q197096 SYMPTOMS
If a scheduled task is running in Autostart mode, it should start
automatically when the SQLExecutive service is started. However, if a
transient or network error causes the task to stop or fail, it is not
automatically restarted. This is the expected behavior and this article
addresses methods to restart such tasks automatically.
WORKAROUND
Simply restarting the task is not always a solution to the problem. In
cases where the real problem is transient (such as a network error or a
deadlock), a restart would help. However, in other cases, the failure may
occur because of a problem that requires manual intervention. The following
workarounds discuss how you can automatically restart an auto-start type
task.
To work around this problem and restart the task, do one of the following:
- Change the scheduled task to use a recurring schedule. For example,
change it so that it runs every 1 minute of every 1 day. This means
that, if it fails, the task will be started at the next one minute
mark. In the case of transient errors, this will fix the problem. Also,
note that this workaround may increase the latency for the task.
- Set up an alert to restart the task in the event of a failure. Note
that this method requires one alert per task. Also, you cannot set up
these alerts by using the SQL Enterprise Manager UI because, in the
"Response Definition" part, it only lists tasks that are not set to
Autostart. To set up these alerts, use the sp_addalert stored procedure.
For a sample script using this method, see the MORE INFORMATION section
of this article.
Modification Type: | Major | Last Reviewed: | 10/3/2003 |
---|
Keywords: | kbprb KB197096 |
---|
|