環(huán)境:
2臺(tái)SQL Server 2012 Always ON服務(wù)
現(xiàn)象:
Always ON服務(wù)正常,同步正常,應(yīng)用正常。
Second Server Server Agent 啟動(dòng)數(shù)秒后就自動(dòng)停止。
處理過(guò)程:
1、查看Windows 系統(tǒng)日志,顯示如下信息:
2、在SQL Studio 中查看當(dāng)前Error Log
Date,Source,Severity,Message
09/25/2018 13:54:07,,Information,[098] SQLServerAgent terminated (normally)
09/25/2018 13:54:07,,Error,[382] Logon to server 'domain\SQLInstance' failed (DisableAgentXPs)
09/25/2018 13:54:07,,Error,[165] ODBC Error: 0
09/25/2018 13:54:07,,Error,[165] ODBC Error: 0
09/25/2018 13:54:07,,Error,[165] ODBC Error: 0
09/25/2018 13:54:07,,Error,[165] ODBC Error: 0
09/25/2018 13:54:07,,Error,[165] ODBC Error: 0
09/25/2018 13:54:07,,Error,[000] Unable to connect to server 'domain\SQLInstance'; SQLServerAgent cannot start
09/25/2018 13:54:07,,Error,[150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.
09/25/2018 13:53:37,,Error,[150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.
09/25/2018 13:53:07,,Error,[150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.
09/25/2018 13:52:37,,Error,[150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.
09/25/2018 13:52:07,,Error,[150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.
09/25/2018 13:52:07,,Information,[495] The SQL Server Agent startup service account is domain\dbadmin.
09/25/2018 13:52:07,,Information,[100] Microsoft SQLServerAgent version 11.0.3000.0 (X64 unicode retail build) : Process ID 1008
3、結(jié)合以上錯(cuò)誤,似乎都指向ODBC,打開(kāi)ODBC,發(fā)現(xiàn)ODBC 64bit 中Driver為空
正常是應(yīng)該有SQL Server和 SQL Native Client 11這兩個(gè)驅(qū)動(dòng)的。
4、在SQL Server 2012 安裝包中找到sqlncli.msi 重新安裝SQL Native Client 11(注意選擇重裝,而不是修復(fù))。
5、再次在ODBC中查看,SQL Native Client 11已經(jīng)有了。
6、重啟SQL Agent ,觀察幾分鐘后沒(méi)有再出現(xiàn)自動(dòng)停止的現(xiàn)象,問(wèn)題解決。
后面有看到一篇介紹ODBC驅(qū)動(dòng)丟失的文章:http://www.cnblogs.com/chinalantian/archive/2016/06/13/5581644.html
了解到可能是卸載某些軟件的時(shí)候會(huì)把ODBC中的部分驅(qū)動(dòng)也刪除,咨詢客戶表示近期有刪除一些軟件。
特此記錄!
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。