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

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

Knowledge Base article:

摘要

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

解決方式

處理此錯誤的程序取決於錯誤發生在使用者資料庫或發生在 tempdb 而定

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

如果 tempdb 發生錯誤

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

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

sp_diskdefault new_device_name, defaulton

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

可覆寫的參數

名稱

描述

預設值

已啟用

啟用或停用該工作流程。

優先順序

定義警示優先順序。

1

嚴重性

定義警示嚴重性。

2

Element properties:

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

Member Modules:

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

Source Code:

<Rule ID="Microsoft.SQLServer.2008.CREATE_DATABASE_failed._Could_not_allocate_enough_disk_space_for_a_new_database_on_the_named_disks_1_5_Rule" Target="SQL2008Core!Microsoft.SQLServer.2008.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2008ID='{9722C604-8246-478A-A7CC-36B31045A847}';MOM2008GroupID={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" RunAs="SQL!Microsoft.SQLServer.SQLDefaultAccount">
<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="SQL!Microsoft.SQLServer.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.2008.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>