Trabajos de larga ejecución

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

Este monitor comprueba los trabajos del Agente SQL de larga duración.

Knowledge Base article:

Resumen

Este monitor comprueba los trabajos del Agente SQL de larga duración. Si un trabajo se ha estado ejecutando durante más tiempo del umbral configurado, se generará una alerta de advertencia o error.

Causas

Si un trabajo del Agente SQL Server se ha ejecutado durante más tiempo del umbral definido, se genera un estado incorrecto. Esto podría indicar un problema con el trabajo.

El Agente SQL Server es responsable de ejecutar las tareas de SQL Server programadas para que tengan lugar a determinadas horas e intervalos, así como de detectar ciertas situaciones para las que los administradores han definido una acción, por ejemplo, alertar a alguien a través de localizadores o mensajes de correo electrónico, o bien una tarea que solucionará las situaciones. El Agente SQL Server también se utiliza para ejecutar tareas de replicación definidas por los administradores.

Para identificar el trabajo que ha causado la advertencia o el estado de error, examine los datos de contexto sobre el cambio de estado o la alerta.

Soluciones

Compruebe SQL Server Management Studio para identificar los trabajos que se están ejecutando. Si estos trabajos se ejecutan durante más tiempo del necesario, investíguelos para averiguar el motivo.

Use sp_help_jobactivity para ver información acerca de los trabajos que se están ejecutando en este momento.

Por otro lado, si se espera que los trabajos del agente se ejecuten durante un largo período de tiempo:

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
Trabajos de larga ejecución
Hay trabajos de larga ejecución del agente en la instancia de SQL {0} del equipo {1}. Esto puede indicar un problema con uno o más trabajos.
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>