Windows 上的 MSSQL: 无法为公共语言运行时(CLR)分配内存

Microsoft.SQLServer.Windows.EventRule.DBEngine.Failed_to_allocate_memory_for_Common_Language_Runtime__CLR__5_Rule (Rule)

当 SQL Server 无法为 CLR 分配内存时,规则将触发警报。

Knowledge Base article:

摘要

当 SQL Server 启动时,可能会发生此错误。SQL Server 启动期间需要几 KB 内存以运行公共语言运行时。如果此内存不可用,则 SQL Server 可能无法启动。

原因

如果没有足够的内存来运行 CLR,则会出现此错误。

解决方法

首先尝试重新启动服务器。如果 SQL Server 无法启动,请检查 Windows 系统和应用程序日志以确认与系统重载或内存压力有关的错误。确认没有硬件问题。增加可用内存量。重新启动计算机并尝试再次启动 SQL Server。如果问题仍然存在,请与产品供应商联系。

可替代参数

名称

说明

默认值

已启用

启用或禁用工作流。

间隔(秒)

运行工作流的重复间隔时间(秒)。

300

优先级

定义警报优先级。

1

严重性

定义警报严重性。

2

同步时间

同步时间

 

超时(秒)

指定工作流在关闭之前允许运行的时间,并标记为失败。

200

数据库连接超时(秒)

如果在指定期间无法访问数据库,工作流将失败并注册一个事件。

15

Element properties:

TargetMicrosoft.SQLServer.Windows.DBEngine
CategoryEventCollection
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
Windows 上的 MSSQL: 无法为公共语言运行时(CLR)分配内存
{0}
CommentMom2017ID='{60AA6DE5-6CAA-4E24-B038-972C9ED6AC6A}';MOM2017GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}

Member Modules:

ID Module Type TypeId RunAs 
_F6DA1507_12AF_11D3_AB21_00A0C98620CE_ DataSource Microsoft.SQLServer.Windows.DataSource.EventCollectionFiltered Default
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SQLServer.Windows.EventRule.DBEngine.Failed_to_allocate_memory_for_Common_Language_Runtime__CLR__5_Rule" Target="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2017ID='{60AA6DE5-6CAA-4E24-B038-972C9ED6AC6A}';MOM2017GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="_F6DA1507_12AF_11D3_AB21_00A0C98620CE_" Comment="{F6DA1507-12AF-11D3-AB21-00A0C98620CE}" TypeID="Microsoft.SQLServer.Windows.DataSource.EventCollectionFiltered">
<MachineName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<NetbiosComputerName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<InstanceVersion>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Version$</InstanceVersion>
<InstanceEdition>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Edition$</InstanceEdition>
<MonitoringType>$Target/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<SqlExecTimeoutSeconds>60</SqlExecTimeoutSeconds>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>200</TimeoutSeconds>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
<EventDisplayNumber>6289</EventDisplayNumber>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.Windows.EventRule.DBEngine.Failed_to_allocate_memory_for_Common_Language_Runtime__CLR__5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter1>
<AlertParameter2>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter2>
<AlertParameter3>Event ID: $Data/Property[@Name='EventID']$. $Data/Property[@Name='Message']$</AlertParameter3>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>