Origine dati ricompilazione di SQL 2014
Microsoft.SQLServer.2014.DBEngine.SQLReCompilation.DataSource (DataSourceModuleType)
Origine dati ricompilazione SQL
Element properties:
Member Modules:
Overrideable Parameters:
Source Code:
<DataSourceModuleType ID="Microsoft.SQLServer.2014.DBEngine.SQLReCompilation.DataSource" Accessibility="Internal">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeoutSeconds" type="xsd:integer"/>
<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="PerformanceCounterObject" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
<OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string"/>
</OverrideableParameters>
<ModuleImplementation>
<Composite>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval>$Config/IntervalSeconds$</Interval>
<SyncTime>$Config/SyncTime$</SyncTime>
</SimpleReccuringSchedule>
<ExcludeDates/>
</Scheduler>
</DataSource>
<ProbeAction ID="PS" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagProbe">
<ScriptName>SQLReCompilation.ps1</ScriptName>
<ScriptBody><Script>param($PerformanceCounterObject)
$SCRIPT_EVENT_ID = 4201
#Event Severity values
$INFORMATION_EVENT_TYPE = 0
$ERROR_EVENT_TYPE = 1
$ManagementGroupID = '$Target/ManagementGroup/Id$'
function main($PerformanceCounterObject)
{
#
# Prepare MOM API and property bag object
#
$api = New-Object -comObject "MOM.ScriptAPI"
$bag = $api.CreatePropertyBag()
$msg = [Environment]::NewLine
$err = [Environment]::NewLine
$compilations = (Get-Counter ("\" + $PerformanceCounterObject + ":SQL Statistics\SQL Compilations/sec")).CounterSamples[0].CookedValue
$recompilations = (Get-Counter ("\" + $PerformanceCounterObject + ":SQL Statistics\SQL Re-Compilations/sec")).CounterSamples[0].CookedValue
[double]$recompilationPercent = 0.0
if(($compilations -gt 0) -and ($recompilations -gt 0))
{
$recompilationPercent = 100.0 * $recompilations / $compilations
}
$bag.AddValue("RecompilationPercent", $recompilationPercent)
$msg += "RecompilationPercent=$recompilationPercent"
$msg += [Environment]::NewLine
#$api.LogScriptEvent("SQL Recompilation data source", $SCRIPT_EVENT_ID, $INFORMATION_EVENT_TYPE, $msg + $err)
$bag}
main $PerformanceCounterObject</Script></ScriptBody>
<SnapIns/>
<Parameters>
<Parameter>
<Name>PerformanceCounterObject</Name>
<Value>$Config/PerformanceCounterObject$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<StrictErrorHandling>true</StrictErrorHandling>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="PS">
<Node ID="Scheduler"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>