監視記錄檔中的可用空間
監視記錄檔及裝載此記錄檔之媒體的可用空間。只有至少為其中一個檔案啟用自動成長之後,裝載此記錄檔的媒體上之可用空間,才會納入可用空間。
所有記錄檔的可用空間不足,導致狀況不佳的狀態。造成可用空間不足的可能原因為:
不當的檔案組態設定 (大小、大小上限、自動成長等)
媒體上的剩餘空間不足
缺少定期例行備份
記錄未截斷
此監視器會依據每個檔案的組態,彙總資料庫內每個記錄檔的可用空間:
無自動成長
若是沒有自動成長的檔案,可用空間將會是檔案初始大小與已使用空間兩者之間的差值。
啟用自動成長
除了檔案大小與已使用空間兩者間的差值之外,啟用自動成長的檔案,其可用空間將會是大小上限與檔案大小的差值加上磁碟上剩餘的可用空間 (取兩者的最小值)。
具有自動成長的資料庫檔案可用空間不足,可能表示檔案已接近主控邏輯磁碟機的限制。對於啟用自動成長且有大小上限的檔案而言,可用空間不足也可能表示檔案已接近為檔案所指定的大小上限。
可用空間的計算也會考量以下情況: 如果檔案成長的幅度大於磁碟上剩餘的可用空間時,以及大小上限與目前檔案大小之間的差距小於成長幅度時,檔案也可能無法成長。在上述情況下,因為已經無法再繼續成長了,所以磁碟上剩餘的可用空間將不會納入可用空間。
您可以使用以下任一方法來解決此問題:
增加為記錄檔配置的大小 (如果已停用自動成長)
增加記錄檔的大小上限值 (如果已啟用自動成長)
至少對一個檔案啟用自動成長
將記錄檔移到另一個有較多可用空間的磁碟機 (如果成長空間有限)
針對 FULL 和 BULK-LOGGED 復原模式,執行記錄檔定期備份
調查記錄為何未截斷:
長時間開啟執行中的現用交易
長時間執行備份作業
長時間開啟複寫的交易 (異動複寫)
主體伺服器背後的鏡像延遲 (資料庫鏡像)
修改此監視的臨界值來配合工作負載
或者,如果不需要為資料庫考量檔案可用空間:
針對此特定資料庫或所有資料庫停用這項監視
請參閱《SQL Server 線上叢書》: 檔案與檔案群組架構
名稱 | 描述 | 預設值 |
警示優先程式 | 定義警示優先順序。 | 一般 |
警示嚴重性 | 定義警示嚴重性。 | MatchMonitorHealth |
已啟用 | 啟用或停用該工作流程。 | 是 |
產生警示 | 定義工作流程是否會產生警示。 | 是 |
Target | Microsoft.SQLServer.2012.Database | ||
Parent Monitor | Microsoft.SQLServer.2012.Database.DBLogFileSpaceMonitor | ||
Algorithm | BestOf | ||
Source Monitor | Microsoft.SQLServer.2012.Monitoring.DBLogFileSpaceMonitor | ||
Relationship | Microsoft.SQLServer.2012.DBHostsLogFile | ||
Category | PerformanceHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
|
<DependencyMonitor ID="Microsoft.SQLServer.2012.Database.DBLogFileSpaceMonitorRollUp" Accessibility="Public" Enabled="true" Target="SQL2012Core!Microsoft.SQLServer.2012.Database" ParentMonitorID="Microsoft.SQLServer.2012.Database.DBLogFileSpaceMonitor" Remotable="true" Priority="Normal" RelationshipType="SQL2012Core!Microsoft.SQLServer.2012.DBHostsLogFile" MemberMonitor="Microsoft.SQLServer.2012.Monitoring.DBLogFileSpaceMonitor">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2012.Database.DBLogFileSpaceMonitorRollUp.AlertMessageResourceID">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</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>
<Algorithm>BestOf</Algorithm>
<MemberUnAvailable>Error</MemberUnAvailable>
</DependencyMonitor>