Error:

ALTER DATABASE MyDB01 SET SINGLE_USER WITH ROLLBACK IMMEDIATE
RESTORE DATABASE MyDB01 WITH RECOVERY;
ALTER DATABASE MyDB01 SET ONLINE

Getting the following error when trying to bring the database back online.

User does not have permission to alter database 'xxxxxx', the database does not exist, or the database is not in a state that allows access checks.
select user_access_desc, is_read_only, state_desc, is_in_standby
from sys.databases where database_id = DB_ID('TCSStaging')
-- Database is "RECOVERING"
user_access_desc is_read_only state_desc is_in_standby
MULTI_USER 0 RECOVERING 0

Resolution:

Wait for database to recovery on its own. Check SQL Server log for progress.

Sources:

Last modified: April 3, 2023

Author

Comments

Write a Reply or Comment