Scipt to start SQL server service | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Scipt to start SQL server service

hi guys,
i am looking for a script to start the sql server services once the server is fully started. thanks AKTHAR
net start MSSQLSERVER will do it in a command file, but why not just set your service to autostart?
My SQL server service does not start in Auto mode as i am using a domain account. When i restart the server, the network interface starts after the sql server service and it cant find the user name. <br />Is there anyway out.???[<img src=’/community/emoticons/emotion-6.gif’ alt=’:(‘ />]<br /><br />AKTHAR
You can use NET START MSSQLSERVER to careate the batch file and execute it once the network service is running…
But why don’t you ask your server engineer to correct the issue? One more option is leasve the sql service with autostart and
In COMPUTER MANAGEMENT/right click SQL SERVICE/click on RECOVERY TAB/ You see the option called "Computer’s response if the service fails" there you change for the FIRST FAILURE to RESTART THE SERVICE after 1/2/3 minutes and the same for second failure….
This should correct the problem….
MohammedU.
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

You can restart the server, but you don’t have sufficient privilages to change the service startup type? Forget running a batch script – solve the user privilages issues, by the sound of it you are going to have many more problems up the road with the database and users…
i have tried the service recovery, but it seems that windows doest not retry to start the service. AKTHAR
in fact i do have the permissions to start the service, it is just that the NIC starts after the sql service AKTHAR
If you are authenticating with Windows authentication to a server from a remote pc, the server will accept authentication requests when the net service starts, the SQL service will start at some point in the startup routine but it will be ready to take connections (via Windows authentication). The nic is controlled by the O/S on the remote pc (Win NT), the O/S dictates the start of the net service – as soon as the remote O/S is ready to start the net service you can authenticate (provided you have sufficient permissions) to the server. If you are logging on directly to a server the local authentication service is in place and the SQL service starts – no nic issues. If you can authenticate and you have sufficient permissions you can administer the settings, and initiate a connection to SQL. The NIC issue you are identifying is a non-starter. You have user authentication issues, and maybe systems issues, resolve them and your problems will be resolved.
Thanks for the help. in fact…
I have 1 domain controller + 1 SQL Server. The sql server authenticates on the Domain Controller. When i restart the SQL Server, it cant authenticate on the Domain Controller as it seems that the NIC is not yet ready. Once the Server is started i can manually starts the Sql Server Service. thanks AKTHAR
Akthar; You might want to look in the Event Log to look for associated errors with the NIC and the net service. I don’t know if you are running Active Directory – but I have seen DNS problems with some Active Directory implementations (especially W2K AD) where there are authentication errors between servers. This can cause delayed authentication, problems or delays with starting various services, or servers disappearing suddenly, etc. Once the AD DNS configuration issues are resolved everything is able to communicate more reliably. Just a suggestion, don’t know if it is applicable to your enviroment…
hi,
many thanks for these infos. I have check for DNS issue, none. I had also a look in my eventviewr, where i can see that the domain controller is not available when the server starts.
i have to find a way to delay the sql server service to start!!!!!!! AKTHAR
You can take help of WAIT command in MSDOS (I think) to pause for a moment until the domain services are available, provided if you are wrapping up the process in a batch file. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
services are set to start Automatically. I am not using any batch file to insert a wait command. AKTHAR
Then those domain controller starting issues will be generated unless you sort those issues first, it is good to proceed in this way if you haven’t got a chance to resolve the network related issues. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
Yes, but is there a way that i can delay the sql service to start after few minutes. AKTHAR
Not unless you control in a manner of pausing using a batch file on Windows operating system, otherwise by default it will go ahead in starting up the services. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
]]>