Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Automatically start MS SQL Server Expand / Collapse
Author
Message
Posted Tuesday, May 27, 2008 8:01 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, May 5, 2014 3:53 AM
Points: 26, Visits: 279
Jeffery: Do you have any script that uses the net start command utility that sufices such scenario? If so, do you mind forwarding it to me? Thanks!
Post #506939
Posted Tuesday, May 27, 2008 8:56 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Thursday, July 3, 2014 10:20 AM
Points: 770, Visits: 1,596
Hi Ambuj
You can use the below 2 scripts to check wether ur SQL server is running or not

-- This Gives u the state of SQL server, Running or Stopped
master.dbo.xp_servicecontrol 'QueryState', 'MSSQLServer'

-- You can start or stop SQL server with the line below from DOS Prompt
Net Start MSSQLServer

Remember to Start SQL Server Agent once you have started


Hope this helps
Post #506976
Posted Tuesday, May 27, 2008 10:48 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, March 23, 2009 3:40 PM
Points: 27, Visits: 68
I had a situation over the long weekend where the SQL Server was restarted manually and even though all the SQL Server Services were set to start "Automatically" the SQL Server Agent did not come up. Fortunately most of my batch loads do not use the job scheduler but run by way of DOS batch scripts.

When I went to restart the Service I noticed that in the properties for the Services for all the SQL Server services that in the recovery tab that the First Failure, Second Failure and Subsequent failures were all defaulted to "take no action".

My question is what should they be set to "Restart the Service"? I searched MSDN and the web and didn't find anything on this subject. Is there any harm is setting them all to "Restart the Service"? (we have no OLTP databases only OLAPs in this server).

This leads me to wonder why wouldn't they be defaulted to "Restart the Service".

Thanks,

DaveK
Post #507086
Posted Tuesday, May 27, 2008 11:15 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, January 6, 2012 2:39 PM
Points: 954, Visits: 683
Jeff Moden (5/26/2008)
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.

Express edition is can also be run on a PC. However, express is a limited version.
Post #507112
Posted Tuesday, May 27, 2008 11:23 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, January 6, 2012 2:39 PM
Points: 954, Visits: 683
Why do we keep talking about scripts. There is no need for one. Go to
Control-Panel -> Administrative tools -> Services...

Find the "SQL Server *" services. the one's with (MSSQLSERVER) or (SQLEXPRESS) or whatever your instance name is, are the ones specific to your instance.

Generally the Browser is disabled.

You can also use the SSMS and right click on your server. Using SQL Server Configuration Manager you can configure the services to start automatically.

Start -> Programs -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Configuration Manager

Something else worth looking at:
Start -> Programs -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Surface Area Configuration

I hate to state the obvious some times, but RTFM.
Post #507117
Posted Tuesday, May 27, 2008 11:47 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, March 23, 2009 3:40 PM
Points: 27, Visits: 68
I am not talking about scripts. (?) I was referring to the default parameters for the SQL services:
services>properties>recovery tab>First failure, Second failure, Subsequent failures and why they are all set to "Take No Action".

Maybe I should have started a new thread.
Post #507130
Posted Tuesday, May 27, 2008 12:18 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, January 6, 2012 2:39 PM
Points: 954, Visits: 683
Sorry, that's a monitoring issue. MOM is an option here.

Or you could just create a windows task that runs every hour... :)
net start "SQL Server (MSSQLSERVER)"

It would fail usually, but wouldn't hurt anything.

You could of course get more creative. One way I have mananged complicated scripts is to install cyqwin and with cron.

Windows powershell, vbscript, WSH are also options.

However, I prefer perl as my scripting language.
Post #507154
Posted Tuesday, May 27, 2008 12:25 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, February 4, 2009 7:34 AM
Points: 129, Visits: 130
There is only one way to start the SQL services. That is also manually. Go to Controll pannel and servies. Go to Property of SQL services and change to automatically start when windows start.

Make sure you type your svc a/c and password


Manoj

MCP, MCTS (GDBA/EDA)
Post #507167
Posted Tuesday, May 27, 2008 10:34 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, May 27, 2008 10:35 PM
Points: 2, Visits: 5
No offense taken. As far as the Server Agent not responding, I have checked and triple-checked to make sure that my account is administrator and that I have the correct password. I've looked up the cause and solution for a 1068 error and I still am unable to fix it. The only thing I can think of doing is uninstalling and reinstalling it. For the second time.
I'm just at a loss with the DAC connection. I'm using the All-in-One Database Administration book for taking the three exams for MCITP so I'm following the directions to the T. I've went through the Surface Area Configuration and established my remote connections. I'm making sure that my SQLCmd is accurate and it's still saying that my Native Client has timed out or logon expired.
Post #507408
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse