可用空間 (包含媒體上已配置的空間與可用空間) 低於警告臨界值設定 (以資料大小與磁碟可用空間總和的百分比表示) 時,此監視器會回報警告。當可用空間低於重大臨界值時,此監視器會在回報重大警示。
監視器會監看檔案中以及裝載檔案的媒體上的可用空間。只有在為指定的檔案啟用了自動成長時,才會考慮媒體上的可用空間。
這個檔案的可用空間不足導致健全狀況不佳的狀態。造成可用空間不足的可能原因為:
不當的檔案組態設定 (大小、大小上限、自動成長等)
媒體上的剩餘空間不足
請使用下列連結來檢視效能資料: DB 檔案可用空間效能資料
無自動成長
若是沒有自動成長的檔案,可用空間將會是檔案初始大小與已使用空間兩者之間的差值。
啟用自動成長
啟用自動成長時,可用磁碟空間會列入可用空間。除了檔案大小與已使用空間之間的差值之外,啟用自動成長的檔案之可用空間,將會是大小上限與檔案大小之間的差值,與磁碟上剩餘的可用空間 (取兩者的最小值)。
具有自動成長的資料庫檔案可用空間不足,可能表示檔案已接近主控邏輯磁碟機的限制。對於啟用自動成長且有大小上限的檔案而言,可用空間不足也可能表示檔案已接近為檔案所指定的大小上限。
可用空間的計算也會考量到如果檔案成長幅度大於磁碟上剩餘的可用空間,或大小上限與目前檔案大小之間的差值小於成長幅度,檔案在這些情況下也會無法成長。在上述這些情況中,磁碟上剩餘的可用空間將不會納入可用空間,因為已無法再繼續成長了。
您可以使用以下任一方法來解決此問題::
加大為檔案群組中某一個檔案或所有檔案配置的大小 (如果已停用自動成長)
增加檔案的大小上限值 (如果已啟用自動成長)
至少對一個檔案啟用自動成長
將檔案移到另一個有較多可用空間的磁碟機 (如果成長空間有限)
修改此監視的臨界值來配合工作負載
或者,如果檔案群組可用空間與此資料庫無關:
針對此特定檔案群組或所有檔案群組停用這項監視
請參閱《SQL Server 線上叢書》: 檔案與檔案群組架構
名稱 | 描述 | 預設值 |
警示優先程式 | 定義警示優先順序。 | 一般 |
警示嚴重性 | 定義警示嚴重性。 | 錯誤 |
Azure 檔案大小上限 (MB) | Azure BLOB 儲存體中所儲存的資料檔案大小上限。此工作流程會考慮將此值用做為每個檔案的儲存體容量上限。 | 1048576 |
重大臨界值 | 如果值低於此臨界值,此監視器會將其狀態變更為 [重大]。在此臨界值與警告臨界值 (含) 之間的值,會讓監視器處於警告狀態。 | 10 |
已啟用 | 啟用或停用該工作流程。 | 是 |
產生警示 | 定義工作流程是否會產生警示。 | 是 |
間隔 (秒) | 執行工作流程的週期性時間間隔 (秒)。 | 900 |
同步處理時間 | 使用 24 小時制指定的同步處理時間。將會忽略。 |
|
逾時 (秒) | 指定允許工作流程在關閉且標示為失敗之前執行的時間。 | 300 |
警告臨界值 | 如果值低於此臨界值,此監視器會將其狀態變更為 [警告]。 | 20 |
Target | Microsoft.SQLServer.2016.DBFile | ||
Parent Monitor | System.Health.PerformanceState | ||
Category | PerformanceHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | Error | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SQLServer.2016.DBFileSizeMonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.SQLServer.2016.Monitoring.DBFileSpaceMonitor" Accessibility="Public" Enabled="true" Target="SQL2016Core!Microsoft.SQLServer.2016.DBFile" ParentMonitorID="SystemHealth!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2016.DBFileSizeMonitorType" ConfirmDelivery="true">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2016.Monitoring.DBFileSpaceMonitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.File"]/FileName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.FileGroup"]/GroupName$</AlertParameter2>
<AlertParameter3>$Target/Host/Host/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.Database"]/DatabaseName$</AlertParameter3>
<AlertParameter4>$Target/Host/Host/Host/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.ServerRole"]/InstanceName$</AlertParameter4>
<AlertParameter5>$Target/Host/Host/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter5>
</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>
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
<ConnectionString>$Target/Host/Host/Host/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.DBEngine"]/ConnectionString$</ConnectionString>
<ServerName>$Target/Host/Host/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ServerName>
<SqlInstanceName>$Target/Host/Host/Host/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.ServerRole"]/InstanceName$</SqlInstanceName>
<ObjectName>SQL DB File</ObjectName>
<CounterName>DB File Free Space (%)</CounterName>
<InstanceName/>
<DatabaseName>$Target/Host/Host/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.Database"]/DatabaseName$</DatabaseName>
<DBFileId>$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.File"]/FileID$</DBFileId>
<Value>$Data/Property[@Name='FreeSpacePercent']$</Value>
<Threshold1>10</Threshold1>
<Threshold2>20</Threshold2>
<TimeoutSeconds>300</TimeoutSeconds>
<AzureMaxFileSizeMB>1048576</AzureMaxFileSizeMB>
</Configuration>
</UnitMonitor>