MSSQL в Windows: поставщик заблокированных сеансов

Microsoft.SQLServer.Windows.MonitorType.DBEngine.BlockingSessions (UnitMonitorType)

Element properties:

RunAsMicrosoft.SQLServer.Core.RunAs.Monitoring
AccessibilityInternal
Support Monitor RecalculateFalse

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SQLServer.Windows.DataSource.BlockingSessions Default
FilterBad ConditionDetection System.ExpressionFilter Default
FilterGood ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
IntervalSecondsint$Config/IntervalSeconds$Интервал (в секундах)Повторяющийся интервал времени в секундах, в который следует запустить рабочий процесс.
SyncTimestring$Config/SyncTime$Время синхронизацииВремя синхронизации указывается в 24-часовом формате и может быть опущено.
WaitMinutesint$Config/WaitMinutes$Время ожидания (мин)Минимальная продолжительность выполнения процесса перед анализом заблокированных SPID для этого процесса.
NumberBlockedSPIDsint$Config/NumberBlockedSPIDs$Число заблокированных сеансовМаксимальное допустимое количество заблокированных сеансов.
TimeoutSecondsint$Config/TimeoutSeconds$Время ожидания (в секундах)Указывает время, в течение которого может выполняться рабочий процесс, прежде чем он будет закрыт или завершится сбоем.
SqlTimeoutSecondsint$Config/SqlTimeoutSeconds$Время ожидания для подключения к базе данных (секунды)Рабочий процесс завершится ошибкой и зарегистрирует событие, если он не сможет получить доступ к базе данных за указанный промежуток времени.

Source Code:

<UnitMonitorType ID="Microsoft.SQLServer.Windows.MonitorType.DBEngine.BlockingSessions" Accessibility="Internal" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.Monitoring">
<MonitorTypeStates>
<MonitorTypeState ID="Blocked"/>
<MonitorTypeState ID="NotBlocked"/>
</MonitorTypeStates>
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MachineName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="InstanceName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ConnectionString" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MonitoringType" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IntervalSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SyncTime" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WaitMinutes" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="NumberBlockedSPIDs" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeoutSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SqlTimeoutSeconds" type="xsd:int"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" ParameterType="int" Selector="$Config/IntervalSeconds$"/>
<OverrideableParameter ID="SyncTime" ParameterType="string" Selector="$Config/SyncTime$"/>
<OverrideableParameter ID="WaitMinutes" ParameterType="int" Selector="$Config/WaitMinutes$"/>
<OverrideableParameter ID="NumberBlockedSPIDs" ParameterType="int" Selector="$Config/NumberBlockedSPIDs$"/>
<OverrideableParameter ID="TimeoutSeconds" ParameterType="int" Selector="$Config/TimeoutSeconds$"/>
<OverrideableParameter ID="SqlTimeoutSeconds" ParameterType="int" Selector="$Config/SqlTimeoutSeconds$"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource TypeID="Microsoft.SQLServer.Windows.DataSource.BlockingSessions" ID="DS">
<MachineName>$Config/MachineName$</MachineName>
<InstanceName>$Config/InstanceName$</InstanceName>
<ConnectionString>$Config/ConnectionString$</ConnectionString>
<MonitoringType>$Config/MonitoringType$</MonitoringType>
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<SyncTime>$Config/SyncTime$</SyncTime>
<WaitMinutes>$Config/WaitMinutes$</WaitMinutes>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<SqlTimeoutSeconds>$Config/SqlTimeoutSeconds$</SqlTimeoutSeconds>
</DataSource>
<ConditionDetection ID="FilterGood" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Property[@Name='BlockedSPIDCount']</XPathQuery>
</ValueExpression>
<Operator>GreaterEqual</Operator>
<ValueExpression>
<Value Type="Integer">$Config/NumberBlockedSPIDs$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<ConditionDetection ID="FilterBad" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Property[@Name='BlockedSPIDCount']</XPathQuery>
</ValueExpression>
<Operator>Less</Operator>
<ValueExpression>
<Value Type="Integer">$Config/NumberBlockedSPIDs$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="Blocked">
<Node ID="FilterGood">
<Node ID="DS"/>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="NotBlocked">
<Node ID="FilterBad">
<Node ID="DS"/>
</Node>
</RegularDetection>
</RegularDetections>
</MonitorImplementation>
</UnitMonitorType>