Sometimes I do get some quick questions from my existing clients. I try to help them as much as possible. Most of the time, I provide them link to my blog or someone else’s blog. If there is no relevant information based on my search, then I provide them relevant information and write a blog for future reference. This blog is an outcome of one such email communication. Here is the short question about auto start SQL.
We are seeing our SQL Server getting crashed randomly and goes down. Is there any way we can configure it to start automatically?”
Here was my long answer.
There are two possible crashes which can happen on SQL Server running on windows operating system.
- Operating system crash causing the machine to restart.
- SQL Server crash.
Here are the solutions for both the situations.
SOLUTION # 1
If we want to get SQL Server automatically started after restarting the operating system, then you can use SQL Server Configuration manager.
- In SQL Server Configuration Manager, click on SQL Server Services.
- In the details pane, right-click the name of the instance and then click Properties.
- Go to “Service” tab and set Start Mode to Automatic.
SOLUTION # 2
There could be situations where SQL Server is shutting down automatically due to a crash or an unexpected behavior with SQL Server. In some situation, we see errors like below in application event log.
- Event Viewer (Application Error)
Faulting application name: sqlservr.exe, version: 2011.110.2100.60, time stamp: 0x4f36496e
Faulting module name: ntdll.dll, version: 6.1.7601.18247, time stamp: 0x521eaf24
Exception code: 0xc0000374
Fault offset: 0x00000000000c4102
Faulting process id: 0x155c
Faulting application start time: 0x01d08bfa7cdf5078
Faulting application path: C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\sqlservr.exe
Faulting module path: C:\Windows\SYSTEM32tdll.dll
- Event Viewer (Windows Error Reporting)
Fault bucket , type 0
Event Name: APPCRASH
Response: Not available
Cab Id: 0
Here are the settings, which can help in forcing SQL to restart in such unforeseen event.
- Setting of SQL Server Agent via SQL Server Management Studio.
- Another possible setting is part of the operating system. Here are the steps
- Go to “Start > Run > Services.msc”
- Locate SQL Server service which we want to configure to handle a crash situation.
- Go to Properties of that service and go to “Recovery” tab and choose options shown below.
Have you implemented any of above?
Reference: Pinal Dave (https://blog.sqlauthority.com)