Windows 上的 MSSQL: 資料庫引擎服務重新啟動偵測提供者

Microsoft.SQLServer.Windows.DataSource.DBEngineServiceRestart (DataSourceModuleType)

Windows 上的 SQL 資料庫引擎服務重新啟動偵測提供者

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityInternal
RunAsMicrosoft.SQLServer.Core.RunAs.Monitoring
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SQLServer.Windows.DataSource.MSSQLLogReader2EventChange Default
FilterMsg ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
CorrelatorIntervalint$Config/CorrelatorInterval$無法使用的時間 (秒)此工作流程會在事件服務停止之後,嘗試在此時間範圍擷取服務啟動事件。
TimeoutSecondsint$Config/TimeoutSeconds$逾時 (秒)指定工作流程失敗多少次後關閉並標示為失敗。
SqlExecTimeoutSecondsint$Config/SqlExecTimeoutSeconds$
SqlTimeoutSecondsint$Config/SqlTimeoutSeconds$資料庫連線的逾時 (秒)若工作流程無法在指定的期限之內存取資料庫,將會失敗並登錄一則事件。

Source Code:

<DataSourceModuleType ID="Microsoft.SQLServer.Windows.DataSource.DBEngineServiceRestart" Accessibility="Internal" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.Monitoring">
<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="NetbiosComputerName" 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="InstanceVersion" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="InstanceEdition" 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="TimeoutSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SqlExecTimeoutSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SqlTimeoutSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CorrelatorInterval" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="CorrelatorInterval" ParameterType="int" Selector="$Config/CorrelatorInterval$"/>
<OverrideableParameter ID="TimeoutSeconds" ParameterType="int" Selector="$Config/TimeoutSeconds$"/>
<OverrideableParameter ID="SqlExecTimeoutSeconds" ParameterType="int" Selector="$Config/SqlExecTimeoutSeconds$"/>
<OverrideableParameter ID="SqlTimeoutSeconds" ParameterType="int" Selector="$Config/SqlTimeoutSeconds$"/>
</OverrideableParameters>
<ModuleImplementation>
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="Microsoft.SQLServer.Windows.DataSource.MSSQLLogReader2EventChange">
<MachineName>$Config/MachineName$</MachineName>
<NetbiosComputerName>$Config/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Config/InstanceName$</InstanceName>
<ConnectionString>$Config/ConnectionString$</ConnectionString>
<InstanceVersion>$Config/InstanceVersion$</InstanceVersion>
<InstanceEdition>$Config/InstanceEdition$</InstanceEdition>
<MonitoringType>$Config/MonitoringType$</MonitoringType>
<Login>$RunAs[Name="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.SqlCredentials"]/UserName$</Login>
<Password>$RunAs[Name="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.SqlCredentials"]/Password$</Password>
<SqlExecTimeoutSeconds>$Config/SqlExecTimeoutSeconds$</SqlExecTimeoutSeconds>
<SqlTimeoutSeconds>$Config/SqlTimeoutSeconds$</SqlTimeoutSeconds>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<Publisher>SQLMonitoringWindows</Publisher>
<ManagementGroupName>$Target/ManagementGroup/Name$</ManagementGroupName>
<ReadFromStartOfLog>false</ReadFromStartOfLog>
<FilterMsg>(.*)</FilterMsg>
<Matches>
<Value>
<Key>ShutDown</Key>
<IsUniq>false</IsUniq>
<Match>(SQL Trace was stopped due to server shutdown\..*\.)</Match>
</Value>
<Value>
<Key>Startup</Key>
<IsUniq>false</IsUniq>
<Match>(SQL Server is starting at normal priority base \(=7\)\. This is an informational message only\. No user action is required\.)</Match>
</Value>
</Matches>
<UseRegExSearch>true</UseRegExSearch>
<UsePrevLineSearch>false</UsePrevLineSearch>
<NameOfHandler>DBEngine_Service_Restart_Detection</NameOfHandler>
<LogReaderInterval>10</LogReaderInterval>
<CorrelatorInterval>$Config/CorrelatorInterval$</CorrelatorInterval>
</DataSource>
<ConditionDetection ID="FilterMsg" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<Exists>
<ValueExpression>
<Value Type="String">Property[@Name='EventInterval']</Value>
</ValueExpression>
</Exists>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<Value Type="String">Property[@Name='EventInterval']</Value>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="String"/>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="FilterMsg">
<Node ID="DS"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>