資料庫引擎的 SQL 重新編譯。注意: 根據預設會停用此監視器。必要時請使用覆寫加以啟用。
SQL 資料庫引擎的 SQL 重新編譯監視器
資料庫中的特定變更可能會導致執行計劃沒有效率或無效,端視資料庫的新狀態而定。SQL Server 會偵測讓執行計劃失效的變更,並將該計劃標記為無效。然後必須根據執行查詢的下一個連線,重新編譯新的計劃。
重新編譯比編譯的次數高。
啟動 SQL Profiler 並檢查 SQL:StmtRecompile 追蹤以識別問題的根本原因。
名稱 | 描述 | 預設值 |
警示優先順序 | 定義警示優先順序。 | 標準 |
警示嚴重性 | 定義警示嚴重性。 | 警告 |
已啟用 | 啟用或停用該工作流程。 | 是 |
產生警示 | 定義工作流程是否要產生警示。 | 是 |
間隔 (秒) | 每次重複執行工作流程之間的時間間隔 (秒)。 | 300 |
範例數 | 指出測出的值要違反多少次臨界值,狀態才會變更。 | 6 |
同步處理時間 | 同步處理時間使用 24 小時制。可予省略。 |
|
閾值 | 若 SQL 重新編譯與 SQL 編譯之間的比率大於此閾值,便會產生警示。 | 25 |
逾時 (秒) | 指定流程被關閉及標示為失敗之前,允許執行的時間。 | 200 |
資料庫連線的逾時 (秒) | 若工作流程無法在指定的期限之內存取資料庫,將會失敗並登錄一則事件。 | 15 |
Target | Microsoft.SQLServer.Linux.DBEngine | ||
Parent Monitor | System.Health.PerformanceState | ||
Category | PerformanceHealth | ||
Enabled | False | ||
Alert Generate | True | ||
Alert Severity | Warning | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SQLServer.Linux.MonitorType.DBEngine.SQLRecompilation | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.SQLServer.Linux.Monitor.DBEngine.SQLRecompilation" Accessibility="Public" Enabled="false" Target="SqlDiscL!Microsoft.SQLServer.Linux.DBEngine" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Linux.MonitorType.DBEngine.SQLRecompilation" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Linux.Monitor.DBEngine.SQLRecompilation.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter1>
<AlertParameter2>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Normal" MonitorTypeStateID="Normal" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<MachineName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<NetbiosComputerName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<InstanceVersion>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Version$</InstanceVersion>
<InstanceEdition>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Edition$</InstanceEdition>
<PerformanceCounterObject>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/PerformanceCounterObject$</PerformanceCounterObject>
<Threshold>25</Threshold>
<NumSamples>6</NumSamples>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>200</TimeoutSeconds>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
</Configuration>
</UnitMonitor>