Sql-Server

SQL Server 代理服務未啟動

  • June 24, 2019

在某些計劃的停機時間後重新啟動 Windows Server 2008R2 後,SQL Server 代理服務未啟動。有多個 SQL Server 命名實例和非代理服務正在啟動。SQL Server 版本:SQL Server 2008 SP3

請注意以下錯誤: 1. 從配置管理器啟動時,在事件查看器中生成以下錯誤。

由於以下錯誤,SQL Server 代理服務無法啟動:服務沒有及時響應啟動或控制請求。

等待 SQL Server 代理服務連接時達到超時(30000 毫秒)。

  1. 從 SSMS 啟動時(通過右鍵點擊代理服務 > 開始)

有關呼叫即時 (JIT) 調試而不是此對話框的詳細資訊,請參閱此消息的末尾。

************** 異常文本 ************** System.NullReferenceException:對象引用未設置為對象的實例。

伺服器堆棧跟踪:在 Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.GetObjectExplorer(Boolean activateWindow) 在 Microsoft.SqlServer.Management.UI 的 Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.FindObjectExplorerFrame() .VSIntegration.ObjectExplorer.ObjectExplorer.ShowError(Exception e) 在 Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.Service.Start() 在 System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object

$$ $$args,對象伺服器,Int32 methodPtr,布爾 fExecuteInContext,對象$$ $$& outArgs) 在 System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object$$ $$args,對象伺服器,Int32 methodPtr,布爾 fExecuteInContext,對象$$ $$& outArgs) 在 System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink) 異常被重新拋出

$$ 0 $$:在 System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData) 在 Microsoft.SqlServer.Management.UI.VSIntegration 的 System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)。 Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ServiceControlProgress.ActionCompletedHandler(IAsyncResult 結果)上的 ObjectExplorer.ServiceActionHandler.EndInvoke(IAsyncResult 結果) ************** 載入的程序集 ************** mscorlib 程序集版本:2.0.0.0 Win32 版本:2.0.50727.8762 (QFE.050727-8700)程式碼庫:file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ————————- ————— ControlService 程序集版本:10.0.0.0 Win32 版本:2007.0100.1600.022 ((SQL_PreRelease).080709-1414 ) 程式碼庫:file:///C:/Program%20Files %20(x86)/Microsoft%20SQL%20Server/100/Tools/Binn/VSShell/Common7/IDE/ControlService.exe ———————— —————– 系統程序集版本:2.0.0.0 Win32 版本:2.0.50727.8770 (QFE.050727-8700) 程式碼庫:file:///C:/Windows/assembly /GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ————————- — Microsoft.NetEnterpriseServers.ExceptionMessageBox 程序集版本:10.0.0.0 Win32 版本:10.50.1600。1 ((KJ_RTM).100402-1539 ) 程式碼庫:file:///C:/Windows/assembly/GAC_MSIL/Microsoft.NetEnterpriseServers.ExceptionMessageBox/10.0.0.0__89845dcd8080cc91/Microsoft.NetEnterpriseServers.ExceptionMessageBox.dll —— ———————————- System.Windows.Forms 程序集版本:2.0.0.0 Win32 版本:2.0。 50727.5491 (Win7SP1GDR.050727-5400) 程式碼庫:file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ——– ——————————– System.Drawing 程序集版本:2.0.0.0 Win32 版本:2.0.50727.5495 (Win7SP1GDR. 050727-5400) 程式碼庫:file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll —————- ———————— Microsoft.SqlServer.SString 程序集版本:10.0.0.0 Win32 版本:10.50.1600。1 ((KJ_RTM).100402-1539 ) 程式碼庫:file:///C:/Windows/assembly/GAC_MSIL/Microsoft.SqlServer.SString/10.0.0.0__89845dcd8080cc91/Microsoft.SqlServer.SString.dll —— ———————————- System.Xml 程序集版本:2.0.0.0 Win32 版本:2.0.50727.8773( QFE.050727-8700) 程式碼庫:file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll ————– ————————– ObjectExplorer 程序集版本:10.0.0.0 Win32 版本:10.0.5500.0 ((Katmai_PCU_Main).110921-2358 ) 程式碼庫: file:///C:/Program%20Files%20(x86)/Microsoft%20SQL%20Server/100/Tools/Binn/VSShell/Common7/IDE/ObjectExplorer.DLL ———— —————————- System.Management 程序集版本:2.0.0.0 Win32 版本:2.0.50727.8766 (QFE.050727-8700)程式碼庫:file:///C:/Windows/assembly/GAC_MSIL/System.管理/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll ————————– – System.Data 程序集版本:2.0.0.0 Win32 版本:2.0.50727.8762 (QFE.050727-8700) 程式碼庫:file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System .Data.dll —————————————- System.Web 程序集版本: 2.0.0.0 Win32 版本:2.0.50727.8762 (QFE.050727-8700) 程式碼庫:file:///C:/Windows/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll —- ——————————— System.Configuration 程序集版本:2.0.0.0 Win32 版本:2.0。 50727.5483 (Win7SP1GDR.050727-5400) 程式碼庫:file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ———— —————————- Microsoft.SqlServer.SqlTools。VSIntegration 程序集版本:10.0.0.0 Win32 版本:10.0.5500.0 ((Katmai_PCU_Main).110921-2358 ) 程式碼庫:file:///C:/Program%20Files%20(x86)/Microsoft%20SQL%20Server/100/Tools /Binn/VSShell/Common7/IDE/Microsoft.SqlServer.SqlTools.VSIntegration.DLL ——————————– ——– Microsoft.VisualStudio.Shell.Interop 程序集版本:7.1.40304.0 Win32 版本:7.10.6071 程式碼庫:file:///C:/Windows/assembly/GAC/Microsoft.VisualStudio.Shell.Interop /7.1.40304.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Shell.Interop.dll ———————————- —– Microsoft.VisualStudio.OLE.Interop 程序集版本:7.1.40304.0 Win32 版本:7.10.6070 程式碼庫:file:///C:/Windows/assembly/GAC/Microsoft.VisualStudio.OLE.Interop/7.1。 40304.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.OLE.Interop。dll —————————————- SqlWorkbench.Interfaces 程序集版本:10.0.0.0 Win32 版本:10.0.5500.0 ((Katmai_PCU_Main).110921-2358 ) 程式碼庫:file:///C:/Program%20Files%20(x86)/Microsoft%20SQL%20Server/100/Tools/Binn/VSShell/Common7/ IDE/SqlWorkbench.Interfaces.DLL —————————————- Microsoft.VisualStudio .Shell 程序集版本:2.0.0.0 Win32 版本:2.0.50727.1826 (QFE.050727-1800) 程式碼庫:file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Shell/2.0.0.0__b03f5f7f11d50a3a/Microsoft。 VisualStudio.Shell.dll —————————————- Microsoft.VisualStudio.Shell .Interop.8.0 程序集版本:8.0.0.0 Win32 版本:8.0.50727.1826 (QFE.050727-1800) 程式碼庫:file:///C:/Windows/assembly/GAC/Microsoft.VisualStudio.Shell.Interop.8.0/8.0 .0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Shell.Interop.8.0.dll ————————- — Microsoft.SqlServer.Management.SDK.SqlStudio 程序集版本:10.0.0.0 Win32 版本:10.0.1600.22 ((SQL_PreRelease).080709-1414 ) 程式碼庫:

file:///C:/Program%20Files%20(x86)/Microsoft%20SQL%20Server/100/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Management.SDK.SqlStudio.DLL

************** JIT 調試 ************** 要啟用即時 (JIT) 調試,此應用程序的 .config 文件或電腦 (machine.config) 必須在 system.windows.forms 部分中設置 jitDebugging 值。還必須在啟用調試的情況下編譯應用程序。

例如:

啟用 JIT 調試後,任何未處理的異常都將發送到電腦上註冊的 JIT 調試器,而不是由該對話框處理。

  1. 檢查 SQLAGENT.out 文件時:

SQLServer 錯誤:65535,SQL Server 網路介面:從系統資料庫獲取啟用的協議列表時出錯

$$ xFFFFFFFF $$.$$ SQLSTATE 08001 $$ $$ 165 $$ODBC 錯誤:0,登錄超時已過期$$ SQLSTATE HYT00 $$ $$ 298 $$SQLServer 錯誤:65535,在建立與 SQL Server 的連接時發生與網路相關或特定於實例的錯誤。伺服器未找到或無法訪問。檢查實例名稱是否正確以及 SQL Server 是否配置為允許遠端連接。有關詳細資訊,請參閱 SQL Server 聯機叢書。$$ SQLSTATE 08001 $$ $$ 382 $$登錄到伺服器“xxx”失敗(ConnUpdateStartExecutionDate)

已經嘗試過的解決方法: 1. 將登錄帳戶更改為其他域使用者帳戶和本地系統、網路服務等,仍然相同的錯誤。2.從微軟支持https://support.microsoft.com/en-in/help/922918/a-service-does-not-start-and-events-7000-and-7011-are-logged-嘗試了這個解決方案in-window,但仍然是同樣的錯誤。

請建議如何解決此問題。

正如 Pinal Dave 在SQL SERVER – SQL Server Agent Not Starting – Failed to Initialize SQL Agent Log (Reason: Access is Denied)中描述的那樣,我通過更改系統資料庫中的幾個步驟解決了這個問題:

字元串中似乎缺少 SQL 代理日誌文件名,我們必須對其進行編輯以解決問題。根據我的經驗,我知道這些資訊儲存在,

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.MSSQLSERVER\SQLServerAgent\ErrorLogFile

添加日誌文件名後,我們能夠成功啟動 SQL 代理。

如果此問題僅在啟動期間發生並且服務在手動啟動時正常啟動,那麼我們可以嘗試將超時時間從 30 秒增加到 60 秒。以下是更改超時值的步驟。 SQL SERVER 超時錯誤

您是否將服務設置為自動(延遲)啟動?如果不檢查一次,有時依賴組件(磁碟驅動器、網路共享等)需要更長的時間才能啟動。

如果這不起作用,則發生此問題是因為 SQL Server 失去了登錄 ID 憑據或使用了無權啟動服務的帳戶。如果您錯過登錄憑據,則需要重新啟動 Windows 伺服器。

SQL Server 需要一個有權在作業系統啟動期間啟動服務的帳戶,以便自動啟動您的服務。

要解決此問題,您需要轉到管理工具 -> 服務 -> SQL Server(MSSQLSERVER 或您的實例的名稱) -> 右鍵點擊 -> 屬性 -> 移動到登錄 -> 使用本地系統設置登錄選項帳戶

如果您選擇了此選項,請點擊瀏覽按鈕並在此處找到本地服務帳戶或網路服務帳戶>點擊應用。

重新啟動電腦,您將能夠啟動 SQL Server 服務。

引用自:https://dba.stackexchange.com/questions/211232