監視資料庫的自動關閉設定
此監視器會檢查此資料庫的 [自動關閉] 設定。由於此監視為整體標準需求的一部分,所以如果設定不符合指定的標準,便會產生警示。
對於桌面資料庫而言,AUTO_CLOSE 選項非常有用,因為它可讓您將資料庫檔案當做一般檔案來管理。您可以移動它們、複製它們來建立備份,甚至可以用電子郵件將它們傳給其他使用者。然而,當資料庫設為 AUTOCLOSE = ON 時,起始自動資料庫關閉的作業會清除 SQL Server 執行個體的計畫快取。清除計畫快取會導致重新編譯所有後續執行計畫,而且可能會造成查詢效能突然暫時下降。
資料庫鏡像需要 AUTO_CLOSE OFF。
只有當您確定應用程式使用模式將使資料庫保持關閉相當長一段時間時,Autoclose 才有意義。主控狀況的一些單一使用者應用程式和多重租賃資料庫,可能從 AUTO_CLOSE ON 獲益。如果是所有其他使用方式,則通常不適用,除非您真的了解應用程式和使用模式。
|
當 [自動關閉] 設定為 ON 時,資料庫會在最後一個使用者結束之後完全關閉並釋放其資源。
AUTO_CLOSE {ON | OFF}
如果 [自動關閉] 選項不符合必要的設定,將會引發警告警示。根據預設,當此設定為 "ON" 時,監視器會設定為產生警示。
請按照下列方式解決此問題:
將此資料庫的組態設定變更為符合預期的值。
針對此特定資料庫或所有資料庫覆寫這個單元監視的預期值。
或者,如果此監視與這個資料庫無關:
請對此特定資料庫或所有資料庫使用覆寫來停用監視。
請對此特定資料庫或所有資料庫使用複寫來停用最上層彙總組態監視。
Target | Microsoft.SQLServer.2008.Database | ||
Parent Monitor | Microsoft.SQLServer.2008.Database.AutomaticConfiguration | ||
Category | ConfigurationHealth | ||
Enabled | False | ||
Alert Generate | True | ||
Alert Severity | Warning | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SQLServer.2008.DBConfigurationStatus | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.SQLServer.2008.Database.Configuration.AutoClose" Accessibility="Public" Enabled="false" Target="SQL2008Core!Microsoft.SQLServer.2008.Database" ParentMonitorID="Microsoft.SQLServer.2008.Database.AutomaticConfiguration" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2008.DBConfigurationStatus" ConfirmDelivery="false">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2008.Database.Configuration.AutoClose.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</AlertParameter2>
<AlertParameter3>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ConfigurationValueOK" MonitorTypeStateID="ConfigurationValueOK" HealthState="Success"/>
<OperationalState ID="ConfigurationValueNotOK" MonitorTypeStateID="ConfigurationValueNotOK" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<ConnectionString>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</ConnectionString>
<DatabaseName>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</DatabaseName>
<IntervalSeconds>43200</IntervalSeconds>
<SyncTime/>
<ConfigValue>AutoClose</ConfigValue>
<ExpectedValue>OFF</ExpectedValue>
<ExcludeOnExpress>true</ExcludeOnExpress>
<SQLSKU>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/Edition$</SQLSKU>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>