SQL Server Windows 服務

Microsoft.SQLServer.2016.DBEngine.ServiceMonitor (UnitMonitor)

此監視器會查看 SQL Server 資料庫引擎服務的狀態。

Knowledge Base article:

摘要

此監視器會檢查 SQL Database Engine Windows 服務的狀態。

原因

此監視器的「未執行」狀態指出 SQL DB Engine 服務設定為自動啟動,但處於「已停止」狀態且未在特定的時間間隔內啟動。間隔的持續期間由「無法使用的時間」監視器屬性所定義,且可加以覆寫。此值預設為 900 秒 (15 分鐘)。如果 SQL 資料庫引擎比該時間更快回到「執行中」狀態,表示只是在重新啟動。

如果這個監視器在特定環境中太多訊息,請加大「無法使用的時間」。相反地,如果它訊息太少,請降低「無法使用的時間」設定。

一般來說,Windows 服務可能會因為許多原因而停止,其中包括::

解決方式

您可以使用下列連結嘗試重新啟動服務::

啟動 SQL 資料庫引擎服務

可以使用下列連結,檢視此 SQL Server 執行個體可能與此問題相關的其他警示:

檢視 SQL Server 警示

可覆寫的參數

名稱

描述

預設值

警示優先程式

定義警示優先順序。

一般

警示嚴重性

定義警示嚴重性。

錯誤

只在服務啟動類型為自動時警示

這只能設為 'true' 或 'false'。如果此參數設為 'false',則此工作流程不會考慮服務目前的啟動類型設定。

已啟用

啟用或停用該工作流程。

產生警示

定義工作流程是否會產生警示。

間隔 (秒)

執行工作流程的週期性時間間隔 (秒)。

60

無法使用的時間 (秒)

將服務視為狀況不良之前,不提供服務的時間下限。

900

Element properties:

TargetMicrosoft.SQLServer.2016.DBEngine
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2016.CheckWinServiceStateMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
MSSQL 2016: SQL Server 服務已停止
電腦 {0} 上的資料庫引擎執行個體 {1} 的 Windows 服務已停止
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2016.DBEngine.ServiceMonitor" Accessibility="Public" Enabled="true" Target="SQL2016Core!Microsoft.SQLServer.2016.DBEngine" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2016.CheckWinServiceStateMonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2016.DBEngine.ServiceMonitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
<AlertParameter2>$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.ServerRole"]/InstanceName$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Running" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="NotRunning" HealthState="Error"/>
</OperationalStates>
<Configuration>
<Frequency>60</Frequency>
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<ServiceName>$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.DBEngine"]/ServiceName$</ServiceName>
<CheckStartupType>true</CheckStartupType>
<UnavailableTime>900</UnavailableTime>
</Configuration>
</UnitMonitor>