交易記錄可用空間 (百分比)

Microsoft.SQLServer.Windows.Monitor.Database.TransactionLogSpaceFreePercent (UnitMonitor)

Windows 上 SQL 資料庫的交易記錄可用空間 (百分比) 監視器。注意: 根據預設會停用此監視器。必要時請使用覆寫加以啟用。

Knowledge Base article:

摘要

SQL 資料庫的交易記錄可用空間 (百分比) 監視器

原因

所有記錄檔的可用空間皆不足而導致健全狀況不佳的狀態。造成可用空間不足的可能原因為:

請使用下列連結來檢視效能資料:

資料庫效能資料

此監視器會依據每個檔案的組態彙總資料庫內每個記錄檔的可用空間:

無自動成長

若是沒有自動成長的檔案,可用空間將會是檔案初始大小與已使用空間之間的差值。

自動成長已啟用

除了檔案大小與已用空間兩者間的差異之外,啟用自動成長之檔案的可用空間大小,將會在大小上限與檔案大小之間的差異,以及磁碟上剩餘的可用空間這兩者中取較小者。

有自動成長功能的資料庫記錄檔案之可用空間不足,可能表示該檔案已接近裝載邏輯磁碟機的限制。對於已啟用自動成長且設有大小上限的檔案而言,可用空間不足也可能表示檔案已接近為檔案所指定的大小上限。

可用空間的計算也會考量到如果檔案成長幅度大於磁碟上剩餘的可用空間,或大小上限與目前檔案大小之間的差值小於成長幅度,檔案在這些情況下也會無法成長。在上述這些情況中,磁碟上剩餘的可用空間將不會納入可用空間,因為已無法再繼續成長了。

解決方式

您可以使用以下任一方法來解決此問題:

請參閱《SQL Server 線上叢書》: 檔案與檔案群組架構

可覆寫的參數

名稱

描述

預設值

警示優先順序

定義警示優先順序。

標準

警示嚴重性

定義警示嚴重性。

錯誤

Azure 檔案大小上限 (MB)

Azure BLOB 儲存體中所儲存的資料檔案大小上限。此工作流程會考慮將此值用作每個檔案的儲存體容量上限。

1048576

已啟用

啟用或停用該工作流程。

產生警示

定義工作流程是否要產生警示。

間隔 (秒)

每次重複執行工作流程之間的時間間隔 (秒)。

300

範例數

指出測出的值要違反多少次臨界值,狀態才會變更。

6

閾值

收集的值會與此參數相比。

10

逾時 (秒)

指定流程被關閉及標示為失敗之前,允許執行的時間。

200

Element properties:

TargetMicrosoft.SQLServer.Windows.Database
Parent MonitorMicrosoft.SQLServer.Windows.Rollup.Database.DBSpace
CategoryPerformanceHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.Windows.MonitorType.Database.TransactionLogSpaceFreePercent
RemotableTrue
AccessibilityPublic
Alert Message
Windows 上的 MSSQL: 交易記錄可用空間 (百分比) 太低
電腦 "{2}" 上 SQL 執行個體 "{1}" 中資料庫 "{0}" 的 Transaction Log Free Space (\%) 太低。請參閱 [警示內容] 索引標籤,以取得詳細資料。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.Windows.Monitor.Database.TransactionLogSpaceFreePercent" Accessibility="Public" Enabled="false" Target="SqlDiscW!Microsoft.SQLServer.Windows.Database" ParentMonitorID="Microsoft.SQLServer.Windows.Rollup.Database.DBSpace" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Windows.MonitorType.Database.TransactionLogSpaceFreePercent" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Windows.Monitor.Database.TransactionLogSpaceFreePercent.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter2>
<AlertParameter3>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Normal" MonitorTypeStateID="Normal" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<MachineName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<InstanceName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<DatabaseName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</DatabaseName>
<AzureMaxFileSizeMB>1048576</AzureMaxFileSizeMB>
<ObjectName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/PerformanceCounterObject$:TransactionLog</ObjectName>
<CounterName>Log Free Space (%)</CounterName>
<PerfInstanceName/>
<ValuePropertyName>DBLogFreeSpacePercent</ValuePropertyName>
<Threshold>10</Threshold>
<NumSamples>6</NumSamples>
<ConnectionString>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<MonitoringType>$Target/Host/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>200</TimeoutSeconds>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
</Configuration>
</UnitMonitor>