I have s SQL2016 instance with 8 out of 10 databases in recovery pending state and I need assistance.
I had just installed an instance of SQL 2017 and restarted the server. Error log says OS error 5 (Access Denied). I restarted the SQL services and it has not helped.
I have tried taking them offline and back on but it doesn't help, it goes back to Recovery Pending.
I have tried:
ALTER DATABASE DBname SET EMERGENCY;
Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file "E:\Databases\STR_Main.mdf". Operating system error 5: "5(Access is denied.)".
ALTER DATABASE DBname set single_user
ALTER DATABASE (DBname , REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS;DBCC CHECKDB (
ALTER DATABASE DB DBname set multi_user
ALTER DATABASE DBname SET ONLINE
All 10 databases are in the same folder on the E drive.
I tested creating a new database and got this error:
MSSQL$MSSQLSERVER2016 has permissions to the 2 databases that are working ok but not those that are in recovery pending.
I have tried to give permissions to this account but it doesn't recognise it.
Anybody seen this before or have any advice?