Wednesday, March 28, 2012

Making sure that SQL Agent is running

On several occasions, the SQL Service has been shut down
and restart. In these cases, the SQL Agent does not auto
re-start, and overnight processing has not been completed.
Is there:
a) A way to make sure that the SQL Agent ALWAYS starts
when the SQL Service is started. I know I can do this if
the server is re-booted, but if you just stop and re-start
the SQL Service, the SQL Agent doesn't re-start.
b) From a stored procedure, or perhaps VB, inquire on the
running status of the SQL Agent (we have a monitor tool
that could be expended to report if the agent isn't
running) How does the SQL Enterprise Manager determin if
the SQL Agent is running ?
Thanks,
Joe.You can write a proc which uses xp_cmdshell and executed NET START and then park the proc as an auto
start proc (sp_procoption).
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Joe Farr" <joefarr@.hotmail.com> wrote in message news:091801c36e0d$179a1530$a401280a@.phx.gbl...
> On several occasions, the SQL Service has been shut down
> and restart. In these cases, the SQL Agent does not auto
> re-start, and overnight processing has not been completed.
> Is there:
> a) A way to make sure that the SQL Agent ALWAYS starts
> when the SQL Service is started. I know I can do this if
> the server is re-booted, but if you just stop and re-start
> the SQL Service, the SQL Agent doesn't re-start.
> b) From a stored procedure, or perhaps VB, inquire on the
> running status of the SQL Agent (we have a monitor tool
> that could be expended to report if the agent isn't
> running) How does the SQL Enterprise Manager determin if
> the SQL Agent is running ?
> Thanks,
> Joe.
>|||That will do fine - thanks Tibor.
>--Original Message--
>You can write a proc which uses xp_cmdshell and executed
NET START and then park the proc as an auto
>start proc (sp_procoption).
>--
>Tibor Karaszi, SQL Server MVP
>Archive at: http://groups.google.com/groups?oi=djq&as
ugroup=microsoft.public.sqlserver
>
>"Joe Farr" <joefarr@.hotmail.com> wrote in message
news:091801c36e0d$179a1530$a401280a@.phx.gbl...
>> On several occasions, the SQL Service has been shut down
>> and restart. In these cases, the SQL Agent does not auto
>> re-start, and overnight processing has not been
completed.
>> Is there:
>> a) A way to make sure that the SQL Agent ALWAYS starts
>> when the SQL Service is started. I know I can do this if
>> the server is re-booted, but if you just stop and re-
start
>> the SQL Service, the SQL Agent doesn't re-start.
>> b) From a stored procedure, or perhaps VB, inquire on
the
>> running status of the SQL Agent (we have a monitor tool
>> that could be expended to report if the agent isn't
>> running) How does the SQL Enterprise Manager determin if
>> the SQL Agent is running ?
>> Thanks,
>> Joe.
>
>.
>|||For a robust production-grade setup, you may want to
configure your monitoring tool, which should be
independent of SQL Server, to restart the SQLAgent
service. Most enterprise-class monitoring tools such as
NetIQ and Patrol suppor such a configuration.
Linchi
>--Original Message--
>On several occasions, the SQL Service has been shut down
>and restart. In these cases, the SQL Agent does not auto
>re-start, and overnight processing has not been completed.
>Is there:
>a) A way to make sure that the SQL Agent ALWAYS starts
>when the SQL Service is started. I know I can do this if
>the server is re-booted, but if you just stop and re-
start
>the SQL Service, the SQL Agent doesn't re-start.
>b) From a stored procedure, or perhaps VB, inquire on the
>running status of the SQL Agent (we have a monitor tool
>that could be expended to report if the agent isn't
>running) How does the SQL Enterprise Manager determin if
>the SQL Agent is running ?
>Thanks,
>Joe.
>.
>

No comments:

Post a Comment