MSSQL 2016: SQL Server 記憶體不足

Microsoft.SQLServer.2016.EventCollectionRule.DBEngine.SQLServerOutOfMemory (Rule)

SQL Server 無法配置足夠的記憶體數量來執行查詢。

Knowledge Base article:

摘要

SQL Server 無法配置足夠的記憶體數量來執行查詢。

原因

這個問題可能由各種原因所造成,包括作業系統設定、實體記憶體可用性或目前工作負載的記憶體限制。在大多數的情況下,交易失敗並不是此項錯誤的原因。因為伺服器的記憶體不足,所以診斷查詢 (例如 DBCC 陳述式) 可能會失敗。

SQL Server 記憶體最佳化資料所使用的記憶體比 SQL Server 多,而且使用方法也不同。為記憶體最佳化資料所安裝及配置的記憶體數量,可能會變得無法滿足成長需求。如果發生這種情況,可能會用盡記憶體。

解決方式

如需可協助您避免多種 OOM 情況的指引,請參閱<監視和疑難排解記憶體使用量>主題。

外部資源

如需有關此問題的詳細資訊,請參閱: Resolve OOM (Out Of Memory) issues (解決 OOM (記憶體不足) 問題)

可覆寫的參數

名稱

描述

預設值

已啟用

啟用或停用該工作流程。

優先順序

定義警示優先順序。

1

嚴重性

定義警示嚴重性。

2

Element properties:

TargetMicrosoft.SQLServer.2016.DBEngine
CategoryEventCollection
EnabledTrue
Event_ID701
Event Source$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.DBEngine"]/ServiceName$
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
MSSQL 2016: SQL Server 無法配置足夠的記憶體來執行查詢
{0}
Event LogApplication
CommentMom2016ID='{2531CFA5-7EF0-4B45-AAA1-DAE73294DFF6}';MOM2016GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.EventProvider Default
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SQLServer.2016.EventCollectionRule.DBEngine.SQLServerOutOfMemory" Target="SQL2016Core!Microsoft.SQLServer.2016.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2016ID='{2531CFA5-7EF0-4B45-AAA1-DAE73294DFF6}';MOM2016GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Application</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>701</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.DBEngine"]/ServiceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.2016.EventCollectionRule.DBEngine.SQLServerOutOfMemory.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>