此監視器會檢查訂閱的複寫合併代理程式服務狀態。請注意,所有版本的 SQL Server Express 皆不支援 SQL Server Agent Windows 服務。因此,此監視器不適用於 SQL Server Express 案例。
複寫合併代理程式是可執行檔,可將資料庫資料表中保存的初始快照集套用至訂閱者。 此代理程式也會合併初始快照集建立之後,在發行者上發生的增量資料變更,並根據設定的規則或使用自訂的解析程式來調解衝突。請注意,所有版本的 SQL Server Express 皆不支援 SQL Server Agent Windows 服務。因此,此監視器不適用於 SQL Server Express 案例。
合併代理程式可能會因為下列原因而失敗:
合併代理程式無法連線到發行者資料庫 (提取訂閱)
合併代理程式無法連線到訂閱者資料庫 (發送訂閱)
因為合併代理程式未於保留期限內進行同步,所以已刪除訂閱者的合併式複寫中繼資料
訂閱已標示為逾期。
查詢逾時錯誤
網路連接錯誤
因為非互動桌面堆積的記憶體耗盡,所以合併代理程式無法啟動。
傳遞給代理程式可執行檔的參數不正確
這個問題可透過確定下列事項來解決:
合併代理程式無法同時連線到發行者以及訂閱者。請同時在發行者與訂閱者資料庫上,設定合併代理程式帳戶的 dbo 存取權
如果訂閱被標示為已逾期,請重新初始化訂閱。
解決合併代理程式執行時,伺服器之間沒有網路或連線能力的問題。
若在發行者上刪除了訂閱中繼資料,請捨棄該訂閱,然後重新建立。當合併代理程式未在保留期限兩倍的時間內進行同步,即可能發生此狀況。
確定已將正確的參數傳遞至代理程式可執行檔。
依照 http://support.microsoft.com/kb/949296 的指示,增加桌面堆積
查詢散發資料庫上的 msmerge_agents 和 msmerge_history 資料表,以取得代理程式失敗的詳細資訊。Msrepl_errors 資料表也有包含任何代理程式失敗的相關資訊。
桌面堆積問題
http://support.microsoft.com/kb/949296
複寫合併代理程式
http://msdn.microsoft.com/library/ms147839.aspx
名稱 | 描述 | 預設值 |
警示優先順序 | 定義警示優先順序。 | 標準 |
警示嚴重性 | 定義警示嚴重性。 | 錯誤 |
已啟用 | 啟用或停用該工作流程。 | 是 |
估計的作業持續時間 | 用於檢查作業排程相容性的臨界值 | 15 |
產生警示 | 定義工作流程是否要產生警示。 | 是 |
間隔 (秒) | 每次重複執行工作流程之間的時間間隔 (秒)。 | 300 |
顯示具未知狀態的作業 | 將狀態未知的作業加入監視器輸出與警示內容中。這會影響健全狀況。 | 否 |
同步處理時間 | 同步處理時間 |
|
逾時 (秒) | 指定工作流程失敗多少次後關閉並標示為失敗。 | 200 |
資料庫連線的逾時 (秒) | 若工作流程無法在指定的期限之內存取資料庫,將會失敗並登錄一則事件。 | 15 |
Target | Microsoft.SQLServer.Replication.Windows.Subscription | ||
Parent Monitor | System.Health.PerformanceState | ||
Category | PerformanceHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | Error | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SQLServer.Replication.Windows.MonitorType.ReplicationAgentState | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Microsoft.SQLServer.Core.RunAs.Monitoring |
<UnitMonitor ID="Microsoft.SQLServer.Replication.Windows.Monitor.SubscriptionMergeAgentState" Accessibility="Public" Enabled="true" Target="SQLReplWD!Microsoft.SQLServer.Replication.Windows.Subscription" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Replication.Windows.MonitorType.ReplicationAgentState" ConfirmDelivery="false" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.Monitoring">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Replication.Windows.Monitor.SubscriptionMergeAgentState.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='Message']$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Health" MonitorTypeStateID="Health" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
<OperationalState ID="Warning" MonitorTypeStateID="Warning" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<MachineName>$Target/Host/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/MachineName$</MachineName>
<NetbiosComputerName>$Target/Host/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/InstanceName$</InstanceName>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<ConnectionString>$Target/Property[Type='MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscription']/Distributor$</ConnectionString>
<MonitoringType>$Target/Host/Host/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<XPathName>Merge$Target/Property[Type='MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscription']/Distributor$$Target/Host/Property[Type='MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscriber']/ConnectionString$$Target/Property[Type='MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscription']/SubscriptionName$</XPathName>
<ShowJobsWithUnknownState>false</ShowJobsWithUnknownState>
<EstimatedJobDuration>15</EstimatedJobDuration>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>200</TimeoutSeconds>
<CheckMachineAndInstanceName>false</CheckMachineAndInstanceName>
</Configuration>
</UnitMonitor>