可用空間 (包含媒體上已配置的空間與可用空間) 低於警告臨界值設定 (以資料大小與磁碟可用空間總和的百分比表示) 時,此監視器會回報警告。當可用空間低於重大臨界值時,此監視器會在回報重大警示。
此監視器會監視記錄檔與記錄檔裝載媒體上的可用空間。必須為至少一個檔案啟用自動成長,才會將媒體上的可用空間視為可用空間的一部分。
所有記錄檔的可用空間皆不足而導致健全狀況不佳的狀態。造成可用空間不足的可能原因為:
不當的檔案組態設定 (大小、大小上限、自動成長等)
媒體上的剩餘空間不足
缺少定期例行備份
記錄未截斷
請使用下列連結檢視效能資料: DB 檔案記錄檔可用空間效能資料
此監視器會依據每個檔案的組態彙總資料庫內每個記錄檔的可用空間:
不自動成長
若是沒有自動成長的檔案,可用空間將會是檔案初始大小與已使用空間之間的差值。
自動成長已啟用
除了檔案大小與已用空間兩者間的差異之外,啟用自動成長之檔案的可用空間大小,將會在大小上限與檔案大小之間的差異,以及磁碟上剩餘的可用空間這兩者中取較小者。
有自動成長功能的資料庫檔案之可用空間不足,可能表示該檔案已接近裝載邏輯磁碟機的限制。對於已啟用自動成長且設有大小上限的檔案而言,可用空間不足也可能表示檔案已接近為檔案所指定的大小上限。
可用空間的計算也會考量到如果檔案成長幅度大於磁碟上剩餘的可用空間,或大小上限與目前檔案大小之間的差值小於成長幅度,檔案在這些情況下也會無法成長。在上述這些情況中,磁碟上剩餘的可用空間將不會納入可用空間,因為已無法再繼續成長了。
您可以使用以下任一方法來解決此問題:
若停用了自動成長,請增加為記錄檔配置的大小
如有啟用自動成長,請提高記錄檔大小的上限值
為至少一個檔案啟用自動成長
將記錄檔移到另一個有較多可用空間的磁碟機 (如果成長空間有限)
以「完整」與「大量記錄」復原模式執行記錄檔的定期備份
調查記錄為何不會截斷:
長時間未結束而處於執行中狀態的使用中交易
長時間處於執行中狀態的備份作業
複寫的交易長時間未完成 (異動複寫)
鏡像遲延落後主體伺服器 (資料庫鏡像)
修改此監視器的執行緒數目以配合工作負載
或者,如果記錄檔可用空間與此資料庫無關:
針對此特定資料庫或所有資料庫停用這項監視
請參閱《SQL Server 線上叢書》: 檔案與檔案群組架構
名稱 | 描述 | 預設值 |
警示優先順序 | 定義警示優先順序。 | 標準 |
警示嚴重性 | 定義警示嚴重性。 | 錯誤 |
Azure 檔案大小上限 (MB) | Azure BLOB 儲存體中所儲存的資料檔案大小上限。此工作流程會考慮將此值用作每個檔案的儲存體容量上限。 | 1048576 |
重大臨界值 | 如果值低於此臨界值,此監視器會將其狀態變更為 [重大]。在此臨界值與警告臨界值 (含) 之間的值,會讓監視器處於警告狀態。 | 10 |
已啟用 | 啟用或停用該工作流程。 | 是 |
產生警示 | 定義工作流程是否要產生警示。 | 否 |
間隔 (秒) | 每次重複執行工作流程之間的時間間隔 (秒)。 | 900 |
同步處理時間 | 同步處理時間使用 24 小時制。可予省略。 |
|
逾時 (秒) | 指定流程被關閉及標示為失敗之前,允許執行的時間。 | 300 |
資料庫連線的逾時 (秒) | 若工作流程無法在指定的期限之內存取資料庫,將會失敗並登錄一則事件。 | 15 |
警告閾值 | 如果值低於此臨界值,此監視器會將其狀態變更為 [警告]。 | 20 |
Target | Microsoft.SQLServer.Linux.DBLogFile | ||
Parent Monitor | System.Health.PerformanceState | ||
Category | PerformanceHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SQLServer.Linux.MonitorType.DBLogFile.DBLogFileSpace | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.SQLServer.Linux.Monitor.DBLogFile.DBLogFileSpace" Accessibility="Public" Enabled="true" Target="SqlDiscL!Microsoft.SQLServer.Linux.DBLogFile" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Linux.MonitorType.DBLogFile.DBLogFileSpace" ConfirmDelivery="true">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Linux.Monitor.DBLogFile.DBLogFileSpace.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.File"]/FileName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</AlertParameter2>
<AlertParameter3>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter3>
<AlertParameter4>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter4>
<AlertParameter5>$Data/Context/Property[@Name='FreeSpaceMB']$</AlertParameter5>
<AlertParameter6>$Data/Context/Property[@Name='FreeSpacePercent']$</AlertParameter6>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="UnderThreshold1" MonitorTypeStateID="UnderThreshold1" HealthState="Error"/>
<OperationalState ID="OverThreshold1UnderThreshold2" MonitorTypeStateID="OverThreshold1UnderThreshold2" HealthState="Warning"/>
<OperationalState ID="OverThreshold2" MonitorTypeStateID="OverThreshold2" HealthState="Success"/>
</OperationalStates>
<Configuration>
<MachineName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<NetbiosComputerName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<DatabaseName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</DatabaseName>
<FileName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.File"]/FileName$</FileName>
<AzureMaxFileSizeMB>1048576</AzureMaxFileSizeMB>
<ValuePropertyName>FreeSpacePercent</ValuePropertyName>
<Threshold1>10</Threshold1>
<Threshold2>20</Threshold2>
<ConnectionString>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<InstanceVersion>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Version$</InstanceVersion>
<InstanceEdition>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Edition$</InstanceEdition>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
</Configuration>
</UnitMonitor>