Error 945

Troubleshooting SQL Server

Troubleshooting

Error 945

Severity Level 16
Message Text

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

Explanation

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.

Action

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:
  1. Make the files available and bring the database OFFLINE using ALTER DATABASE.

  2. 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:

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

  2. Use ALTER DATABASE to bring the database ONLINE.

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

See Also

DATABASEPROPERTY