Database [Database_Name] cannot be upgraded because it is read-only or has read-only files

Database [Database_Name] cannot be upgraded because it is read-only or has read-only files

Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0Share on Reddit0
A few days ago I was trying to attach some databases on a SQL Server 2005 instance. The database files were copied over the network and located on a drive on the DBMS server.

Though, while I was trying to attach the databases I was getting an error message of the following type:

Msg 3415, Level 16, State 3, Line 1
Database [database_name] cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.
Msg 1813, Level 16, State 2, Line 1
Could not open new database [database_name]. CREATE DATABASE is aborted.

As the error message was saying, I checked the permissions of the database files and ensured that they were not read-only. Also, the service user account running the SQL Server instance had full access on the files.

As I did not have much time for fully troubleshooting the issue, I provided full access to “Everyone” on all the database files I wanted to attach, and tried again.

Guess what? It worked 🙂

After the databases were successfully attached, I removed the full access from the “Everyone” entity and so everything was back to normal!


My Latest Projects:



Recommended eBooks on SQL Server:

Tuning SQL Server: eBook by SQL Server MVP Artemakis Artemiou
Tuning SQL Server: eBook by SQL Server MVP Artemakis Artemiou
Administering SQL Server: eBook by SQL Server MVP Artemakis Artemiou
Administering SQL Server: eBook by SQL Server MVP Artemakis Artemiou
Artemakis Artemiou
Artemakis Artemiou is a Senior SQL Server Architect, Author, Software Developer and a Microsoft Data Platform MVP. He has over 15 years of experience in the IT industry in various roles. Among other, via his initiative SQLEBooks.com, Artemakis authors and publishes eBooks on different topics on SQL Server. Artemakis currently serves as the President of the Cyprus .NET User Group (CDNUG) and the International .NET Association Country Leader for Cyprus (INETA). Additionally he is the founder of the SQLArtBits initiative that aims to provide the technical community with simple, yet powerful and high-quality SQL Server tools. Currently, the highlights of these tools are DBA Security Advisor and In-Memory OLTP Simulator. Artemakis's official website can be found at aartemiou.com. Artemakis's blogs can be found at: SQLNetHub.com and TechHowTos.com.

3 thoughts on “Database [Database_Name] cannot be upgraded because it is read-only or has read-only files

  1. Michael "BickiBoy" Rybicki

    I had the same issue on SQL Server 2008 R2 today – turns out you don't need to mess with permissions on the files. It's caused by the wonderful UAC crap in Server 2008 R2 – I launched the SSMS as administrator (right-click – warning etc) and it worked perfectly. Thanks Microsoft for misleading us with this article that comes up first in Google search: http://support.microsoft.com/kb/931640