I posted about setting a Microsoft SQL Database into ‘read only’ mode as part of an upgrade. Today I need to go back and make some changes on the now legacy system.
To handle this request I needed to change back to its normal state, this is when I encountered the error 5120.
In the additional information of this error it tells me that an exception occurred while executing a Transact-SQL statement or batch.
Later indicating that it was unable to open the physical file to the database in question due to an “Operating system error 5”
Have fun searching for that *hint* you will not find any of the top 3 links taking you to any Microsoft Site; that’s for sure. {{annoyed}}
Other errors indicated where insufficient memory or disk space; thanks again {{annoyed}} for sending me down the wrong path. I have plenty of memory, and disk space.
The last one was that I did not have permissions to the files. Seriously, I do have permissions. In most cases someone who’s doing this work does in the first place
So I found out what the issue was in my case. Here is a screenshot:
Yup! The files were set to read-only. Once this attribute was removed I was able to change my database status from read-only to read-write.
I hope this post helps you if in similar situation.
– Jermal
2 replies on “Remove database from read only mode, error 5120”
Did it leave anything in the windows logs at all ?
I don’t recall doing so; If there was a message I overlooked it. I was more focused on the SQL logs at the time.