SQL 다시 컴파일

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

2014 DB 엔진의 SQL 다시 컴파일입니다. 참고: 이 모니터는 기본적으로 사용하지 않도록 설정되어 있습니다. 필요한 경우 사용하도록 설정하려면 재정의를 사용하십시오.

Knowledge Base article:

요약

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

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

원인

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

해결 방법

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

재정의 가능한 매개 변수

이름

설명

기본값

알림 우선 순위

알림 우선 순위를 정의합니다.

보통

알림 심각도

알림 심각도를 정의합니다.

경고

사용

워크플로를 사용하거나 사용하지 않도록 설정합니다.

아니요

알림 생성

워크플로가 알림을 생성하는지를 정의합니다.

간격(초)

워크플로를 실행하는 반복 시간 간격(초)입니다.

300

샘플 수

상태가 변경되기 전 측정된 값이 임계값을 위반한 횟수를 나타냅니다.

6

동기화 시간

24시간 형식으로 지정된 동기화 시간입니다. 생략될 수 있습니다.

00:20

임계값

SQL 다시 컴파일 및 SQL 컴파일 사이의 비율이 이 임계값보다 크면 경고가 생성됩니다.

25

제한 시간(초)

워크플로를 닫고 실패로 표시하기 전에 워크플로를 실행할 수 있는 시간을 지정합니다.

200

Element properties:

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

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2014.DBEngine.SQLReCompilationMonitor" Accessibility="Public" Enabled="false" Target="SQL2014Core!Microsoft.SQLServer.2014.DBEngine" ParentMonitorID="SystemHealth!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2014.DBEngine.SQLReCompilation.MonitorType" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2014.DBEngine.SQLReCompilationMonitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.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>