Giving the sql service account 'NT SERVICE\MSSQLSERVER' "Full Control" of the database files
If you have access to the server files/folders you can try this solution that worked for me:
SQL Server 2012 on Windows Server 2008 R2
- Right click the database (mdf/ldf) file or folder and select "Properties".
- Select "Security" tab and click the "Edit" button.
- Click the "Add" button.
- Enter the object name to select as 'NT SERVICE\MSSQLSERVER' and click "Check Names" button.
- Select the MSSQLSERVER (RDN) and click the "OK" button twice.
- Give this service account "Full control" to the file or folder.
- Back in SSMS, right click the database and select "Properties".
- Under "Options", scroll down to the "State" section and change "Database Read-Only" from "True" to "False".