有台數據庫服務器(開發服務器),開發人員郵件告訴我,SSMS連接不了這台服務器,遠程登錄后,發現SQL SERVER的服務停止了,啟動服務時報錯,服務啟動不了。檢查錯誤日志發現下面一些信息
2015-10-14 13:47:09.98 spid17s The Service Broker endpoint is in disabled or stopped state.
2015-10-14 13:47:10.03 spid17s The Database Mirroring endpoint is in disabled or stopped state.
2015-10-14 13:47:10.13 spid17s Service Broker manager has started.
2015-10-14 13:47:11.98 spid7s Database 'master' is upgrading script 'SSIS_hotfix_install.sql' from level 201328592 to level 201330692.
2015-10-14 13:47:13.99 spid7s Error: 942, Severity: 14, State: 4.
2015-10-14 13:47:13.99 spid7s Database 'SSISDB' cannot be opened because it is offline.
2015-10-14 13:47:14.11 spid7s Error: 912, Severity: 21, State: 2.
2015-10-14 13:47:14.11 spid7s Script level upgrade for database 'master' failed because upgrade step 'SSIS_hotfix_install.sql' encountered error 942, state 4, severity 25. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.
2015-10-14 13:47:14.14 spid7s Error: 3417, Severity: 21, State: 3.
2015-10-14 13:47:14.14 spid7s Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.
2015-10-14 13:47:14.14 spid7s SQL Server shutdown has been initiated
2015-10-14 13:47:14.14 spid7s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
2015-10-14 13:47:15.15 spid7s Error: 25725, Severity: 16, State: 1.
2015-10-14 13:47:15.15 spid7s An error occurred while trying to flush all running Extended Event sessions. Some events may be lost.
2015-10-14 13:47:15.17 spid13s The SQL Server Network Interface library could not deregister the Service Principal Name (SPN) [ MSSQLSvc/GETNTXX.XXX.XXXX.com:1433 ] for the SQL Server service. Error: 0x2af9, state: 61. Administrator should deregister this SPN manually to avoid client authentication errors.
2015-10-14 13:47:15.17 spid13s The SQL Server Network Interface library could not deregister the Service Principal Name (SPN) [ MSSQLSvc/GETNTXX.XXX.XXXX.com:1433 ] for the SQL Server service. Error: 0x2af9, state: 61. Administrator should deregister this SPN manually to avoid client authentication errors.
真是一頭霧水,不知道是否同事做了什么操作(補丁升級之類)導致出現了數據庫服務啟動不了的錯誤。於是按照下面步驟進行了緊急修復處理:
1:啟動 SQL Server 服務啟跟蹤標志902
一般使用命令: Net Start MSSQL$InstanceName /T902 如果是默認實例 Net Start MSSQLSERVER /T902
C:\Windows\system32>net start MSSQLSERVER /T902
The SQL Server (MSSQLSERVER) service is starting.
The SQL Server (MSSQLSERVER) service was started successfully.
2:啟動SQL SERVER后,在本機使用SSMS連接數據庫
如下所示,你會看到SSISDB處於脫機模式(Offline),先將數據庫SSISDB分離。
3:找到 SSIS_hotfix_install.sql腳本並執行。
SSIS_hotfix_install.sql腳本一般位於安裝目錄 \Program Files\Microsoft SQL Server\MSSQL11.MSSQL$InstanceName \MSSQL\Install下,例如這台服務器位於C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Install目錄下
4:執行命令net stop MSSQLSERVER關閉SQL服務。
5:從SQL Server Configuration Manager里面啟動SQL SERVER服務。
6:附加剛才被分離的數據庫SSISDB
附加時出現下面錯誤,這個是因為Windows SERVER 2012的權限問題所導致,關掉SSMS后,要以管理員運行SSMS,附加成功。問題解決。
參考資料:
http://ayadshammout.com/2014/02/04/sql-2012-sp1-cu6-issue-with-ssis-db-in-availability-group/