在订阅服务器上加载复制代理(分发和合并)。请注意,SQL Server 代理对 SQL Server Express Edition 不可用,因此,对此类版本的实例禁用此监视器。
此监视器计算阈值定义的时间段内订阅服务器上每个复制代理(分发、合并)的总运行时间。如果任何代理的总运行时间超出了定义的阈值,将触发警报,警报格式如下:
订阅服务器(名称:“{0}”,服务器:“{1}”)已检测到 {2}% 的利用率。
注意,SQL Server 代理对 SQL Server Express Edition 不可用,因此,对此类版本的实例禁用此监视器。
SQL Server 代理失败次数和复制代理作业重试次数
大量命令和大型事务。
缓慢的代理作业性能。
参与复制拓扑的服务器之间的网络缓慢。
打开重试代理作业历史记录并查看任何错误消息,然后相应地调查并解决这些错误。
当作业运行时,运行 sp_who2,并检查作业是否被其他会话阻塞。如果已被阻塞,请解决阻塞问题或等待其他会话完成。
确保分发服务器与订阅服务器(分发代理)之间的网络延迟不会过高。
确认并调查任何缓慢运行的查询。
通过对订阅数据库运行 sp_updatestats 确保统计信息是最新的。
( http://msdn.microsoft.com/library/ms173804.aspx)
确保订阅数据库上的索引未高度碎片化。
名称 | 说明 | 默认值 |
警报优先级 | 定义警报优先级。 | 正常 |
警报严重性 | 定义警报严重性。 | 错误 |
已启用 | 启用或禁用工作流。 | 是 |
错误阈值 | 错误阈值 | 4 |
生成警报 | 定义工作流是否生成警报。 | 是 |
间隔(秒) | 运行工作流的重复间隔时间(秒)。 | 300 |
度量期(小时) | 度量所用的时间(小时) | 24 |
同步时间 | 同步时间 |
|
超时(秒) | 指定允许工作流在被关闭并标记为失败之前运行的时间。 | 200 |
数据库连接超时(秒) | 如果在指定期间无法访问数据库,工作流将失败并注册一个事件。 | 15 |
警告阈值 | 警告阈值 | 3 |
Target | Microsoft.SQLServer.Replication.Windows.Subscriber | ||
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.DistributorAgentsLoad | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Microsoft.SQLServer.Core.RunAs.Monitoring |
<UnitMonitor ID="Microsoft.SQLServer.Replication.Windows.Monitor.SubscriberAgentsLoad" Accessibility="Public" Enabled="true" Target="SQLReplWD!Microsoft.SQLServer.Replication.Windows.Subscriber" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Replication.Windows.MonitorType.DistributorAgentsLoad" ConfirmDelivery="false" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.Monitoring">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Replication.Windows.Monitor.SubscriberAgentsLoad.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/InstanceName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/ConnectionString$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='LoadHours']$</AlertParameter3>
<AlertParameter4>$Data/Context/Property[@Name='Message']$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Health" MonitorTypeStateID="Health" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="Warning" HealthState="Warning"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<MachineName>$Target/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/MachineName$</MachineName>
<InstanceName>$Target/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/InstanceName$</InstanceName>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<ConnectionString>$Target/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/ConnectionString$</ConnectionString>
<MonitoringType>$Target/Host/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<WarningThreshold>3</WarningThreshold>
<ErrorThreshold>4</ErrorThreshold>
<LastHours>24</LastHours>
<CategoryList>Distribution, Merge</CategoryList>
<ExcludeCategoryList/>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>200</TimeoutSeconds>
</Configuration>
</UnitMonitor>