October 14, 2011 at 4:07 pm
We have SQL server 2008 standard edition.
Is there a way to setup something is SQL server is restarted or started or stopped, then send an email to DBA?
October 14, 2011 at 4:10 pm
well started or restarted sure, look up autorun stored procedures. You could write one that sends an email and it would be triggered on those two cases. Stopped on the other hand, no.. And to be honest a monitoring tool such as SQL Monitor would be a better choice..
CEWII
October 14, 2011 at 4:14 pm
Thanks, what is autorun procedure?
October 14, 2011 at 4:22 pm
It is a normal stored procedure stored in the master database that the sp_procoption sproc was used to make autotun. The sproc should not have any parameters. And I would recommend if you are doing that that it just do the absolute minimum required.
CEWII
October 14, 2011 at 4:29 pm
Thanks, will look into it.
Also if I can setup an alert notification using Policy management in SQL server to do similar thing like this?
I mean to notify the operator when sql server started.
Thanks
October 17, 2011 at 12:18 pm
sqlfriends (10/14/2011)
Thanks, will look into it.Also if I can setup an alert notification using Policy management in SQL server to do similar thing like this?
I mean to notify the operator when sql server started.
As for PBM I would say no, I looked and didn't see any facets that would give me the information needed. Also there is one other way but it only tells you when SQL Agent was started/re-started and not when SQL was. You can create a job in Agent with a schedule of starting when the Agent starts.
It sounds like you need a monitoring solution, why don't you see if your employer has any tools that might be able to be used to do this. Most of them have tools that can detect a particular service stopping and starting and can send alerts on that. I have been using the Red Gate SQL Monitor (plugged our hosts without even trying..) and I enjoy it. It keeps getting better.
CEWII
October 17, 2011 at 12:30 pm
Thanks, we do have a monitor server tool called ServerAlive for all network computers.
But I found it didn't catch up what we have for an issue recently happened on one of our SQL servers.
What happened is the SQL server randomly restarted itself once in a week, mostly at night, and it seems it crashed in the blue screen and quickly restarted itself. And everything works OK since then.
The serverAlive monitor tool didn't catch it, because it may setup to check every 2 minutes, but the restart of the SQl server may happen within one minute, but I do find a windows event log that says SQl server started at a basic mode, only from this, I know the server rebooted itself and no one noticed that.
So I think if I can set up a way in SQL server itself, it may help me to know this.
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply