今日在電腦上重裝SQL Server 2012數據庫,重新安裝完后SQL Server Agent卻一直無法啟動成功……
查看SQL Server Agent的啟動日志,日志內容如下:
2019-04-20 12:07:21 - ? [100] Microsoft SQLServerAgent version 11.0.6020.0 (X64 unicode retail build) : Process ID 6684 2019-04-20 12:07:21 - ? [495] The SQL Server Agent startup service account is WORKGROUP\XXXXXXXXXX$. 2019-04-20 12:07:21 - ! [150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start. 2019-04-20 12:07:21 - ! [000] Unable to connect to server '(local)'; SQLServerAgent cannot start 2019-04-20 12:07:21 - ! [298] SQLServer Error: 27, Registry information is corrupt or missing. Make sure the provider is installed and registered correctly. [SQLSTATE 08001] 2019-04-20 12:07:21 - ! [298] SQLServer Error: 27, Client unable to establish connection [SQLSTATE 08001] 2019-04-20 12:07:21 - ! [165] ODBC Error: 0, A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [SQLSTATE 08001] 2019-04-20 12:07:21 - ! [382] Logon to server '(local)' failed (DisableAgentXPs) 2019-04-20 12:07:21 - ? [098] SQLServerAgent terminated (normally)
先在網上查找了一番資料,遇到此問題的人也確實不少,常用的一些處理方式:
① 在SQL Server配置管理器中,修改SQL Server Agent的登錄身份為Local System……(此方式並不解決我的問題,我的登錄身份已經是Local System)
② 檢查SQL Server配置的角色權限,登錄身份需要擁有系統數據庫msdb的db_owner權限……(也沒有解決我的問題,修改登陸身份以及各種權限后問題依舊)
③ …………還有其他很多,不再贅述…………
最后的解決方案是偶然發現的,SQL Server重裝后竟然還有一個程序的安裝日期與眾不同(見下圖)……
然后,我把這個SQL Server 2012 Native Client修復了一下,問題就解決了……
最后備注下我的SQL Server卸載步驟:
① 使用SQL Server 安裝包卸載程序;
② 刪除C盤SQL Server 的各個安裝目錄;
③ 刪除注冊表中的SQL Server 項目。
但現在看來這還是不夠徹底的……