SQL Server服务没有自动启动原因案例分析

栏目: 数据库 · 发布时间: 7年前

这个案例是前两天出现的,一直没有时间总结,25号凌晨4点去处理数据库的故障问题。远程连上公司的局域网,psping检查发现服务器的1433端口不通,数据库连接不上,但是主机又能ping通,登录服务器检查发现SQL Server的SQL Server (MSSQLSERVER) Service 等服务都没有启动.从Zabix检查也发现服务停了, 真是懵了,使用systeminfo命令检查系统的情况,发现这台服务器在凌晨3:31重启了,但是对应的SQL Server服务没有自动启动,

SQL Server服务没有自动启动原因案例分析

检查错误日志,发现SQL Server等相关服务的自动启动都失败了,如下所示:

SQL Server服务没有自动启动原因案例分析

A timeout was reached (30000 milliseconds) while waiting for the SQL Server (MSSQLSERVER) service to connect.

如上截图所示,其实还有一些自动启动的服务也都出现了错误,继续往下面看,发现错误日志有下面错误信息:

The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly.

Event 41的Kernel-Power错误意味着系统在未首先正常关机的情况下重新启动。当系统停止响应、出现故障或意外断电时,会发生此错误。更多相关信息参考 https://support.microsoft.com/zh-cn/help/2028504/windows-kernel-event-id-41-error-the-system-has-rebooted-without-clean

SQL Server服务没有自动启动原因案例分析

到此,我们知道了系统异常重启了,但是为什么系统重启后,那些自动启动的服务(例如SQL Server服务都启动失败呢?)什么原因导致呢? A service does not start, and events 7000 and 7011 are logged in the Windows event log 这里简单的介绍了一下,但是感觉没有详细介绍。

The service control manager waits for the time that is specified by the ServicesPipeTimeout entry before logging event 7000 or 7011. Services that depend on the Windows Trace Session Manager service may require more than 60 seconds to start. Therefore, increase the ServicesPipeTimeout value appropriately to give all the dependent services enough time to start.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

839803 The Windows Trace Session Manager service does not start and Event ID 7000 occurs

我们可以理解为service control manager等待SQL Server的服务启动,但是这个服务由于资源问题或一些依赖选项问题,导致它在30秒内没有成功启动,所以service control manager就出错了。网上有人这样介绍:

It could be that some other dependent components (the disk, network shares, etc) take longer to start up. Could you set the service to start as Automatic (delayed)

   其实后面跟系统管理员沟通这个问题,才知道是因为数据库服务器(Virtual Machine)所在的Nutanix一台主机由于故障,VM自动切换到另一台主机,切换过程中VM会重新启动,而且当时出现问题的有3台VM服务器(SQL Server 2008/2014都有)。

解决方案:

1: 将SQLSQL Server (MSSQLSERVER)等相关服务的启动类型改为 Automatic(Delayed Start)

SQL Server服务没有自动启动原因案例分析

2:修改Serivce Timeout的值。

To change the service timeout value:

1 Click the Start button, then click Run, type regedit, and click OK.

2 In the Registry Editor, click the registry subkey HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control.

3 In the details pane, locate the ServicesPipeTimeout entry, right-click that entry and then select Modify.# 这个值改为 60 秒或 120

Note: If the ServicesPipeTimeout entry does not exist, you must create it by selecting New on the Edit menu, followed by the DWORD Value, then typing ServicesPipeTimeout, and clicking Enter.

4 Click Decimal, enter the new timeout value in milliseconds, and then click OK.

5 Restart the computer.

不过这个错误,我没法重现这个错误、从而无法测试验证上诉解决方案能否真正解决问题。不过上面大体分析是基本正确的。

参考资料:

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/dd349403(v=ws.10)

https://support.microsoft.com/en-in/help/922918/a-service-does-not-start-and-events-7000-and-7011-are-logged-in-window


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

场景革命

场景革命

吴声 / 机械工业出版社 / 2015-7-1 / 59.00元

How-old如何引爆了朋友圈的全民脑洞狂欢? Uber是打车软件,还是入口? 为什么“自拍”会成为一个产业? 美团如何成为电影票房冠军的幕后推手? 商业进入了新物种时代,超级平台之后,PC时代以降,IoT(万物互联)崛起之时,到底什么是新的入口?一系列的颠覆使我们开始正视移动互联时代的品类创造方法,一场孕育已久的场景革命正在发生。 《场景革命:重构人与商业的连接》为......一起来看看 《场景革命》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

html转js在线工具
html转js在线工具

html转js在线工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试