監視資料庫的自動壓縮設定
此監視器會檢查此資料庫的 [自動壓縮] 設定。由於此監視為整體標準需求的一部分,所以如果設定不符合指定的標準,便會產生警示。
當 [自動壓縮統計資料] 設定為 ON 時,資料庫檔案將是定期壓縮的候選項。資料檔和記錄檔都可以自動壓縮。只有在資料庫設為 SIMPLE 復原模式或備份記錄時,[自動壓縮] 才會縮減交易記錄的大小。當設為 OFF 時,便不會在定期檢查未用空間時,自動壓縮資料庫檔案。當超出 25% 的檔案包含未用空間時,AUTO_SHRINK 選項便會壓縮檔案。檔案會壓縮成 25% 的檔案是未用空間的大小,或建立檔案時的檔案大小,兩者取其較大者。您不能壓縮唯讀資料庫。
自動壓縮可能會造成過多索引片段、交易記錄大小和 I/O。請只在資料庫不太可能再次成長,並且您可以在壓縮作業後執行 ALTER INDEX … REORGANIZE 時,才使用自動壓縮。
AUTO_SHRINK {ON | OFF}
如果選項不符合必要的設定,便會引發警告警示。根據預設,當此設定為 "ON" 時,監視器會設定為產生警示。
請按照下列方式解決此問題:
將此資料庫的組態設定變更為符合預期的值。
針對此特定資料庫或所有資料庫覆寫這個單元監視的預期值。
或者,如果此監視與這個資料庫無關:
請對此特定資料庫或所有資料庫使用覆寫來停用監視。
請對此特定資料庫或所有資料庫使用複寫來停用最上層彙總組態監視。
如需有關這項設定的詳細資訊,請參閱:< ALTER DATABASE SET 選項 (Transact-SQL)>
Target | Microsoft.SQLServer.2012.Database | ||
Parent Monitor | Microsoft.SQLServer.2012.Database.AutomaticConfiguration | ||
Category | ConfigurationHealth | ||
Enabled | False | ||
Alert Generate | True | ||
Alert Severity | Warning | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SQLServer.2012.DBConfigurationStatus | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.SQLServer.2012.Database.Configuration.AutoShrink" Accessibility="Public" Enabled="false" Target="SQL2012Core!Microsoft.SQLServer.2012.Database" ParentMonitorID="Microsoft.SQLServer.2012.Database.AutomaticConfiguration" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2012.DBConfigurationStatus" ConfirmDelivery="false">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2012.Database.Configuration.AutoShrink.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>AutoShrink</ConfigValue>
<ExpectedValue>OFF</ExpectedValue>
<ExcludeOnExpress>false</ExcludeOnExpress>
<SQLSKU>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/Edition$</SQLSKU>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>