MSSQL 2014: CREATE DATABASE 失敗。無法在具名磁碟上配置足夠的磁碟空間給新資料庫

Microsoft.SQLServer.2014.CREATE_DATABASE_failed._Could_not_allocate_enough_disk_space_for_a_new_database_on_the_named_disks_1_5_Rule (Rule)

裝置上沒有足夠的空間可建立 model 資料庫時,會發生此錯誤。

Knowledge Base article:

摘要

裝置上的空間不足而無法建立 model 資料庫時,會發生此錯誤。

解決方式

處理此錯誤的程序視使用者資料庫或 tempdb 發生錯誤而定。

如果使用者資料庫發生錯誤

如果 tempdb 發生錯誤

如果已將 tempdb 從一個裝置移回任何預設裝置,且裝置上的空間不足 (2 MB),Microsoft SQL Server 會嘗試在另一個裝置上建立 tempdb。如果沒有至少具備 2 MB 可用空間的裝置,SQL Server 就不會啟動。請使用 -f 最基本組態選項,啟動 SQL Server。

您可以為裝置釋放至少 2 MB 的空間,或建立一個至少 2 MB 的新裝置。如果建立新裝置,請確定它已指定為預設裝置,如下列範例所示::

sp_diskdefault new_device_name, defaulton

如果未指定預設值,SQL Server 會傳送「記憶體不足」訊息 (您可以忽略此訊息),然後自動將 tempdb 移至 RAM

可覆寫的參數

名稱

描述

預設值

已啟用

啟用或停用該工作流程。

優先順序

定義警示優先順序。

1

嚴重性

定義警示嚴重性。

2

Element properties:

TargetMicrosoft.SQLServer.2014.DBEngine
CategoryEventCollection
EnabledTrue
Event_ID1803
Event Source$Target/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.DBEngine"]/ServiceName$
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
MSSQL 2014: CREATE DATABASE 失敗。無法在具名磁碟上配置足夠的磁碟空間給新資料庫
{0}
Event LogApplication
CommentMom2014ID='{9722C604-8246-478A-A7CC-36B31045A847}';MOM2014GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}

Member Modules:

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

Source Code:

<Rule ID="Microsoft.SQLServer.2014.CREATE_DATABASE_failed._Could_not_allocate_enough_disk_space_for_a_new_database_on_the_named_disks_1_5_Rule" Target="SQL2014Core!Microsoft.SQLServer.2014.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2014ID='{9722C604-8246-478A-A7CC-36B31045A847}';MOM2014GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="_F6DA1507_12AF_11D3_AB21_00A0C98620CE_" Comment="{F6DA1507-12AF-11D3-AB21-00A0C98620CE}" 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>PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$Target/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.DBEngine"]/ServiceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>1803</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.2014.CREATE_DATABASE_failed._Could_not_allocate_enough_disk_space_for_a_new_database_on_the_named_disks_1_5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>