長時間実行ジョブ

Microsoft.SQLServer.2008.Agent.LongRunningJobs (UnitMonitor)

このモニターは、SQL Server の長時間実行エージェント ジョブを確認します。

Knowledge Base article:

概要

このモニターは、長時間実行 SQL エージェント ジョブがないか確認します。設定されたしきい値よりも長くジョブが実行されていると、警告またはエラー通知が出されます。

原因

異常な状態になるのは、定義されたしきい値よりも長く実行されていた SQL Server エージェント ジョブがあるためです。そのジョブに問題がある可能性があります。

SQL Server エージェントは、特定の時刻または間隔で実行されるようにスケジュールされた SQL Server タスクを実行したり、事態に対処するために管理者によって定義されたアクション (ページまたは電子メールでだれかに警告するなど) またはタスクが対象とする特定の条件を検出したりします。また、SQL Server エージェントは、管理者によって定義されたレプリケーション タスクの実行にも使用されます。

警告またはエラー状態の原因となったジョブを特定するには、状態変更または通知のコンテキスト データを調べます。

解決方法

SQL Server Management Studio を確認して、実行されているジョブを識別します。これらのジョブが必要以上に長く実行されている場合は、ジョブを調査して原因を見つけます。

sp_help_jobactivity を使用して、現在実行されているジョブに関する情報を表示します。

また、長時間実行されることが想定されるエージェント ジョブがある場合は、次の方法を取ることもできます。

Element properties:

TargetMicrosoft.SQLServer.2008.Agent
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2008.AgentLongRunningJobsProvider
RemotableTrue
AccessibilityPublic
Alert Message
長時間実行ジョブ
コンピューター {1} 上の SQL インスタンス {0} に長時間実行されているエージェント ジョブがあります。これは、1 つ以上のジョブに問題があることを示している可能性があります。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2008.Agent.LongRunningJobs" Accessibility="Public" Enabled="false" Target="SQL2008Core!Microsoft.SQLServer.2008.Agent" ParentMonitorID="SystemHealth!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2008.AgentLongRunningJobsProvider" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2008.Agent.LongRunningJobs.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="UnderThreshold1" MonitorTypeStateID="UnderThreshold1" HealthState="Success"/>
<OperationalState ID="OverThreshold1UnderThreshold2" MonitorTypeStateID="OverThreshold1UnderThreshold2" HealthState="Warning"/>
<OperationalState ID="OverThreshold2" MonitorTypeStateID="OverThreshold2" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>600</IntervalSeconds>
<SyncTime/>
<ConnectionString>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</ConnectionString>
<Threshold1>60</Threshold1>
<Threshold2>120</Threshold2>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>