Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Automatically start MS SQL Server


Automatically start MS SQL Server

Author
Message
Ambuj Mathur
Ambuj Mathur
SSC Rookie
SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)

Group: General Forum Members
Points: 48 Visits: 282
Can anyone suggest a way to bring-up the MS SQL Server if it is down apart from manually doing it. I would appreciate if someone can guide that through a script. I'm fighting and struggling to get a solution to it. Thanks in advance!
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52538 Visits: 40334
What do you mean? SQL Server will load on boot unless someone has tampered with the initial settings. Do you mean power was removed from the server and you want to "turn the server on"?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Ambuj Mathur
Ambuj Mathur
SSC Rookie
SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)

Group: General Forum Members
Points: 48 Visits: 282
I mean that for whatever reason- If I need to start the SQL Server services including the agent, how do I do it through a script? I want to avoid a person sitting and just monitoring the server and bringing it up when it goes down because of any reason (may be power off/shutdown).
Jeffrey Williams 3188
Jeffrey Williams 3188
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5094 Visits: 9858
SQL Server runs as a service on Windows. You set the service to start automatically and every time Windows is restarted, SQL Server will be automatically started.

Just set all SQL Server services that you want started when the server start to automatic. To do this, open Configuration Manager, select the services you want and modify the startup from Manual to Automatic.

Jeff

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

mobasha
mobasha
Right there with Babe
Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)

Group: General Forum Members
Points: 754 Visits: 1284
u can create a batch to do so just write this in:
net start MSSQLSERVER. if u have a default instance.
if u have a named instance just replace the MSSQLSERVER with ur instance name.
and for the agent write ur agent service name.
u can get the service name from the control panel---> administrative tools---> services

..>>..

MobashA
Ambuj Mathur
Ambuj Mathur
SSC Rookie
SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)

Group: General Forum Members
Points: 48 Visits: 282
Hi Jeff, Jeffery, mobasha

Thank you so much for your suggestions. This is the answer I wanted to confirm. Although I knew what you all have extended over to me but still would like if you could try to get over some script to bring SQL Server online or running. If any of you can try to manage it, it would be of a great help to me. Thanks again!
Jeffrey Williams 3188
Jeffrey Williams 3188
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5094 Visits: 9858
What do you want a script to do?

Check to see if SQL Server is running, and if not - start it? If so, I wouldn't want to just restart SQL Server automatically, because - if it crashed it crashed for a reason and just automatically restarting the service could cause additional corruption.

But, if you are really looking for something like that - then there are several options. Use a batch file that issues a NET START command and schedule it every few minutes, or install Powershell and look into Get-Service and Start-Service cmdlets, or use VBScript and use WMI to access the service and restart as needed, or other option.

Jeff

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

oldsoul1313
oldsoul1313
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 5
Hello everyone

I just installed SQL Server 2005 Evaluation edition on my desktop and laptop. Everything has been working fine; I've configured all of my services to run automatically and everything. However, today when I attempted to run SSMS I get an error that says that the Sql Server Agent could not start on the local computer. I've made sure that the account that I configured everything on is the account that I'm logged into but I'm still getting errors. Could anyone possibly help me out?

Also on my laptop I am attempting to connect to DAC with SQLCmd but it keeps telling me that the SQL Native Client has timed out; login expired. I unistalled all services and installed again and I am still getting the same errors.

If anyone could help me I would greatly appreciate it.
mobasha
mobasha
Right there with Babe
Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)Right there with Babe (754 reputation)

Group: General Forum Members
Points: 754 Visits: 1284
for the service if its not a problem change the account to local administrator and make sure that u r writing the right password.
and for the DAC please dont be offended but i have to ask, have u enabled the DAC connections from the Surface Configuration Aria?

..>>..

MobashA
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52538 Visits: 40334
One thing that you should be made aware of... Unless you're installing the Developer's Edition of SQL Server, it must run on a Windows Server.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search