SQL 다시 컴파일

Microsoft.SQLServer.2012.DBEngine.SQLReCompilationMonitor (UnitMonitor)

2012 DB 엔진의 SQL 다시 컴파일

Knowledge Base article:

요약

SQL 2012 DB 엔진의 SQL 다시 컴파일 모니터

데이터베이스에서 특정 항목을 변경하면 데이터베이스의 새로운 상태에 따라 실행 계획이 비효율적으로 또는 유효하지 않게 될 수 있습니다. SQL Server는 이렇게 실행 계획을 무효화하고 계획을 유효하지 않도록 만드는 변경 사항을 감지합니다. 이러한 경우에는 쿼리를 실행하는 다음 연결을 위해 새 계획을 다시 컴파일해야 합니다.

원인

컴파일에 비교해서 다시 컴파일 수가 더 높습니다.

해결 방법

SQL 프로파일러를 시작하고 SQL:StmtRecompile 추적에서 문제의 근본 원인을 식별합니다.

Element properties:

TargetMicrosoft.SQLServer.2012.DBEngine
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2012.DBEngine.SQLReCompilation.MonitorType
RemotableTrue
AccessibilityPublic
Alert Message
SQL DB 2012 SQL 다시 컴파일이 너무 높음
"{1}" 컴퓨터에서 SQL 인스턴스 "{0}"의 SQL 다시 컴파일이 너무 높습니다. 자세한 내용은 "경고 컨텍스트" 탭을 참조하십시오.
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2012.DBEngine.SQLReCompilationMonitor" Accessibility="Public" Enabled="false" Target="SQL2012Core!Microsoft.SQLServer.2012.DBEngine" ParentMonitorID="SystemHealth!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2012.DBEngine.SQLReCompilation.MonitorType" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2012.DBEngine.SQLReCompilationMonitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Normal" MonitorTypeStateID="Normal" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>300</IntervalSeconds>
<TimeoutSeconds>200</TimeoutSeconds>
<Threshold>25</Threshold>
<NumSamples>6</NumSamples>
<SyncTime/>
</Configuration>
</UnitMonitor>