MSSQL 2008: Collect SQL Re-Сompilations Per Second

Microsoft.SQLServer.2008.SQLRecompilesPerSecond (Rule)

Collects the Windows "SQL Recompiles Per Second" performance counter for each instance of SQL 2008 DB Engine.

Knowledge Base article:

Summary

Number of statement recompiles per second. Counts the number of times statement recompiles are triggered. Generally, you want the recompiles to be low.

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

Yes

Frequency (seconds)

The recurring interval of time in seconds in which to run the workflow.

900

Element properties:

TargetMicrosoft.SQLServer.2008.DBEngine
CategoryPerformanceCollection
EnabledTrue
Instance Name$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/PerformanceCounterObject$:SQL Statistics
Counter NameSQL Re-Compilations/sec
Frequency900
Alert GenerateFalse
RemotableTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource System.Performance.DataProvider Microsoft.SQLServer.SQLDefaultAccount
PerfMapper ConditionDetection System.Performance.DataGenericMapper Default
WriteToDB WriteAction Microsoft.SystemCenter.CollectPerformanceData Default
WriteToDW WriteAction Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData Default

Source Code:

<Rule ID="Microsoft.SQLServer.2008.SQLRecompilesPerSecond" Enabled="true" Target="SQL2008Core!Microsoft.SQLServer.2008.DBEngine">
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="SystemPerf!System.Performance.DataProvider" RunAs="SQL!Microsoft.SQLServer.SQLDefaultAccount">
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<CounterName>SQL Re-Compilations/sec</CounterName>
<ObjectName>$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/PerformanceCounterObject$:SQL Statistics</ObjectName>
<InstanceName/>
<AllInstances>false</AllInstances>
<Frequency>900</Frequency>
</DataSource>
</DataSources>
<ConditionDetection ID="PerfMapper" TypeID="SystemPerf!System.Performance.DataGenericMapper">
<ObjectName>SQL DB Engine:SQL Statistics</ObjectName>
<CounterName>$Data/CounterName$</CounterName>
<InstanceName/>
<Value>$Data/Value$</Value>
</ConditionDetection>
<WriteActions>
<WriteAction ID="WriteToDB" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData"/>
<WriteAction ID="WriteToDW" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData"/>
</WriteActions>
</Rule>