發行者的 SQL Server Agent 狀態

Microsoft.SQLServer.2014.Replication.Monitor.PublisherAvailabilityMonitor (UnitMonitor)

此監視器會檢查 SQL Server Agent 是否正在發行者上執行。

Knowledge Base article:

摘要

此監視器會連接至複寫發行者,並確認 SQL Server Agent 服務是否正在執行中。SQL Server Agent 服務會在 SQL Server 安裝期間自動安裝。複寫會使用此 Windows 服務來啟動和停止負責資料移動的複寫 SQL Server Agent 作業。

原因

SQL Server Agent 服務可能已被手動停止,或是因為代理程式失敗而停止。檢查 Windows 應用程式事件記錄檔,以找出代理程式服務非預期停止的可能原因。

如果代理程式「啟動模式」屬性設為「手動」,而不是「自動」,SQL Server Agent 服務將不會在伺服器重新開機時自動重新啟動。

解決方式

請在 Windows 服務、SQL Server 組態管理員之下,或是透過 SQL Server Management Studio 來啟動 SQL Server Agent 服務。如果代理程式「啟動模式」設為「手動」,請考慮變更為「自動」。

啟動、停止或暫停 SQL Server Agent 服務 http://technet.microsoft.com/library/ms190695.aspx

其他

在發行者上,除了記錄讀取器快照代理程式、快照集代理程式和發送散發代理程式之外,SQL Server Agent 服務也負責執行其他代理程式,例如「代理程式記錄清除: 散發」、「散發清除: 散發」和「逾期的訂閱清除」代理程式。

外部

使用下列連結來檢視 SQL Server Agent 錯誤記錄檔: http://msdn.microsoft.com/library/ms175488.aspx

此主題描述如何在 SQL Server 2014 中將 Microsoft SQL Server Agent 設定為在非預期地停止時自動重新啟動。 https://msdn.microsoft.com/library/ms178130.aspx

可覆寫的參數

名稱

描述

預設值

已啟用

啟用或停用工作流程

產生警示

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

Element properties:

TargetMicrosoft.SQLServer.2014.Replication.Publisher
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2014.Replication.MonitorType.CheckReplicationServiceState
RemotableTrue
AccessibilityPublic
Alert Message
MSSQL2014 複寫: 發行者: SQL Server Agent Windows 服務已停止。
伺服器 {0} 上 SQL Server 執行個體 {1} 的 SQL Server Agent Windows 服務已停止。
RunAsMicrosoft.SQLServer.Replication.Monitoring.RunAs.Monitor

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2014.Replication.Monitor.PublisherAvailabilityMonitor" Accessibility="Public" Enabled="true" Target="MS2RD!Microsoft.SQLServer.2014.Replication.Publisher" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2014.Replication.MonitorType.CheckReplicationServiceState" ConfirmDelivery="false" RunAs="MSRL!Microsoft.SQLServer.Replication.Monitoring.RunAs.Monitor">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2014.Replication.Monitor.PublisherAvailabilityMonitor.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="MSRL!Microsoft.SQLServer.Replication.Library.GenericPublisher"]/ConnectionString$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Running" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="RunningManual" HealthState="Warning"/>
<OperationalState ID="Error" MonitorTypeStateID="NotRunning" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<ServiceName>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Library.GenericPublisher"]/ServiceName$</ServiceName>
</Configuration>
</UnitMonitor>