交易記錄可用空間 (\%)

Microsoft.SQLServer.2012.Database.TransactionLogSpaceFreePercentMonitor (UnitMonitor)

2012 資料庫的交易記錄可用空間 (\%) 監視器

Knowledge Base article:

摘要

SQL 2012 資料庫的 Transaction Log Free Space (%) 監視器

原因

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

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

資料庫效能資料

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

無自動成長

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

啟用自動成長

除了檔案大小與已使用空間兩者間的差值之外,啟用自動成長的檔案,其可用空間將會是大小上限與檔案大小的差值加上磁碟上剩餘的可用空間 (取兩者的最小值)。

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

可用空間的計算也會考量以下情況: 如果檔案成長的幅度大於磁碟上剩餘的可用空間時,以及大小上限與目前檔案大小之間的差距小於成長幅度時,檔案也可能無法成長。在上述情況下,因為已經無法再繼續成長了,所以磁碟上剩餘的可用空間將不會納入可用空間。

解決方式

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

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

可覆寫的參數

名稱

描述

預設值

警示優先程式

定義警示優先順序。

一般

警示嚴重性

定義警示嚴重性。

錯誤

已啟用

啟用或停用該工作流程。

產生警示

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

間隔 (秒)

執行工作流程的週期性時間間隔 (秒)。

900

臨界值

警示臨界值

10

逾時 (秒)

指定工作流程在關閉並標記為失敗前所能執行的時間。

300

Element properties:

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

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2012.Database.TransactionLogSpaceFreePercentMonitor" Accessibility="Public" Enabled="false" Target="SQL2012Core!Microsoft.SQLServer.2012.Database" ParentMonitorID="Microsoft.SQLServer.2012.Database.DBSpaceMonitor" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2012.Database.TransactionLogSpaceFreePercent.MonitorType" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2012.Database.TransactionLogSpaceFreePercentMonitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</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="Normal" MonitorTypeStateID="Normal" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>900</IntervalSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<Threshold>10</Threshold>
<ConnectionString>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</ConnectionString>
<ServerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ServerName>
<SqlInstanceName>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</SqlInstanceName>
<ObjectName>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/PerformanceCounterObject$:TransactionLog</ObjectName>
<CounterName>Log Free Space (%)</CounterName>
<InstanceName/>
<DatabaseName>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</DatabaseName>
<Value>$Data/Property[@Name='DBLogFreeSpacePercent']$</Value>
</Configuration>
</UnitMonitor>