Thursday, 23 November 2017

SQL Database in Recovery Pending Mode

So you have done a restore of your virtual machine.
Sign in to SQL and boom! Your database is in recovery pending mode!
What the hell is that?

To fix:
- Go to the folder where the ldf and mdf is stored, grant access to 'everyone'
-Sign back in to SQL, restart the service
-Run the following script and you are good to go!
ALTER DATABASE dbnamehere SET ONLINE

And voila! Problem resolved!