SQL Server Windows 服務

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

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

Knowledge Base article:

摘要

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

原因

此監視的「不在執行中」狀態表示 SQL Database Engine 服務已設定為自動啟動,但是在特定的期間處於「已停止」狀態。此期間定義在「無法使用的時間」監視屬性中,且可加以覆寫。此值預設為 900 秒 (15 分鐘)。如果 SQL Database Engine 回到「執行中」狀態的速度比這個時間更快,則表示才剛進行了重設。

如果這個監視於特定的環境中太吵雜,請提高「無法使用的時間」。反之,如果過於隱性,請減少「無法使用的時間」值。

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

解決方式

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

啟動 SQL 資料庫引擎服務

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

檢視 SQL Server 警示

可覆寫的參數

名稱

描述

預設值

警示優先程式

定義警示優先順序。

一般

警示嚴重性

定義警示嚴重性。

錯誤

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

其只可設定為 'true' 或 'false'。如果設定為 'false',則不論啟動類型設定為何,都會觸發警示。預設值為 'true'。

已啟用

啟用或停用該工作流程。

產生警示

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

間隔 (秒)

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

60

無法使用的時間 (秒)

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

900

Element properties:

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

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2008.DBEngine.ServiceMonitor" Accessibility="Public" Enabled="true" Target="SQL2008Core!Microsoft.SQLServer.2008.DBEngine" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2008.CheckWinServiceStateMonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2008.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="SQL!Microsoft.SQLServer.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="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$</ServiceName>
<CheckStartupType>true</CheckStartupType>
<UnavailableTime>900</UnavailableTime>
</Configuration>
</UnitMonitor>