Hi,
Is it possible to config SQL mail send out a message when machine reboot or
SQL server shutdown?
Thanks,
JackHi
You can't do it during the shutdown process as you may not be notified, if
it is a quick one, there is an OS shut down or crash.
For Startup, create a Stored Procedure. Then with sp_procoption, mark it for
startup. But, in you SP, add a delay with "DELAY" for 20-30 seconds before
you send the mail. This gives the various MAPI components time to be loaded
by SQL Agent before you start to throw work their way.
If the SQL Server is really critical, it is best to get an external
monitoring tool to monitor the OS and SQL Server. Self monitoring on
software has its problems...It can't report on itself very well as it may
not be in a state to monitor itself.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jack" <chongh.hc@.gmail.com> wrote in message
news:u3WxXCaPFHA.2568@.TK2MSFTNGP14.phx.gbl...
> Hi,
> Is it possible to config SQL mail send out a message when machine reboot
> or SQL server shutdown?
> Thanks,
> Jack
>|||Hi, Mike,
Thanks for your reply, I'll try your suggestion.
To help me better understand this question, I have to know "how SQL react if
OS send shutdown command to it?", if I can know any trigger force SQL
server/agent shutdown, can we apply a SP run first before SQL server/agent
proceed shutdown command that OS send to it.
Hope you can understand me , my English is not good.
Regards,
Chong
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:uoHQEuaPFHA.3560@.TK2MSFTNGP14.phx.gbl...
> Hi
> You can't do it during the shutdown process as you may not be notified, if
> it is a quick one, there is an OS shut down or crash.
> For Startup, create a Stored Procedure. Then with sp_procoption, mark it
> for startup. But, in you SP, add a delay with "DELAY" for 20-30 seconds
> before you send the mail. This gives the various MAPI components time to
> be loaded by SQL Agent before you start to throw work their way.
> If the SQL Server is really critical, it is best to get an external
> monitoring tool to monitor the OS and SQL Server. Self monitoring on
> software has its problems...It can't report on itself very well as it may
> not be in a state to monitor itself.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Jack" <chongh.hc@.gmail.com> wrote in message
> news:u3WxXCaPFHA.2568@.TK2MSFTNGP14.phx.gbl...
>|||AFAIK, SQL behaves as any other service which is sent the STOP command - it
shuts down immediately. You would probably need to code your own WMI
application to trap service events, or use some 3rd-party monitoring
software.
One thing you might want to try is setting up a T-SQL job on another SQL
Server to try and connect (using osql.exe for example) and notify you if it
fails.
Adrian
"Jack" <chongh.hc@.gmail.com> wrote in message
news:%23biEK%23cPFHA.3336@.TK2MSFTNGP09.phx.gbl...
> Hi, Mike,
> Thanks for your reply, I'll try your suggestion.
> To help me better understand this question, I have to know "how SQL react
> if OS send shutdown command to it?", if I can know any trigger force SQL
> server/agent shutdown, can we apply a SP run first before SQL server/agent
> proceed shutdown command that OS send to it.
> Hope you can understand me , my English is not good.
> Regards,
> Chong
> "Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
> news:uoHQEuaPFHA.3560@.TK2MSFTNGP14.phx.gbl...
>
No comments:
Post a Comment