Database cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.

Microsoft.SQLServer.2000.Database_cannot_be_opened_due_to_inaccessible_files_or_insufficient_memory_or_disk_space__See_the_SQL_Server_errorlog_for_details (Rule)

Knowledge Base article:

Causes

Error 945 is returned when the database is marked IsShutdown. This occurs when a database cannot be recovered due to missing files, or some other resource error that usually can be corrected easily.

Resolutions

First, verify that the database is marked IsShutdown using DATABASEPROPERTY.

Then, determine the cause of the error by consulting the errorlog, and take action as noted below.

If one or more data or log files are missing:

Make the files available and bring the database OFFLINE using ALTER DATABASE.

Use ALTER DATABASE to bring the database ONLINE

If insufficient log space:

Use sp_add_log_file_recover_suspect_db() to add another log file.

The database is recovered and brought online by this procedure.

If insufficient data space:

Use sp_add_data_file_recover_suspect_db() to add another log file.

The database is recovered and brought online by this procedure.

If insufficient memory:

The insufficient memory error can occur when a number of databases are recovered at the same time. Retrying the operation may fix the problem:

Retry the operation using ALTER DATABASE to bring the database OFFLINE.

Use ALTER DATABASE to bring the database ONLINE.

If retrying the operation does not work, consider freeing up memory.

Element properties:

TargetMicrosoft.SQLServer.2000.DBEngine
CategoryEventCollection
EnabledTrue
Event Source$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableTrue
Alert Message
Database cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.
{0}
Event LogApplication
CommentMom2005ID='{2E4F5D0D-B31A-4564-A359-1C477385E8BA}'

Member Modules:

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

Source Code:

<Rule ID="Microsoft.SQLServer.2000.Database_cannot_be_opened_due_to_inaccessible_files_or_insufficient_memory_or_disk_space__See_the_SQL_Server_errorlog_for_details" Target="SQL2000Core!Microsoft.SQLServer.2000.DBEngine" Enabled="true" Comment="Mom2005ID='{2E4F5D0D-B31A-4564-A359-1C477385E8BA}'" Remotable="true">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="EventDS" 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="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>MatchesMOM2005RegularExpression</Operator>
<Pattern>^(17052|17055)$</Pattern>
</RegExExpression>
</Expression>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery>EventDescription</XPathQuery>
</ValueExpression>
<Operator>MatchesMOM2005BooleanRegularExpression</Operator>
<Pattern>((^.*945 and (not ^.*\n.*945)) or (^.*945.*\n.*945)) AND (NOT ^.*[0-9]+.*945) AND (NOT ^.*945[0-9]+)</Pattern>
</RegExExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertOwner>$Data/PublisherName$</AlertOwner>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.2000.Database_cannot_be_opened_due_to_inaccessible_files_or_insufficient_memory_or_disk_space__See_the_SQL_Server_errorlog_for_details.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>