I've used powershell to run a sql script on several databases on a test server. Disk space was low, so the script failed on 34 out of 75 databases. All fair enough.
In any case, afterwards 10 of my 75 databases ended in a modus where SSMS appends to the database name "(Recovery Pending)". I've solved the disk space issue and waited for a bit, but the databases remain in this state.
The MSDN carefully explains this state (emphasis mine):
SQL Server has encountered a resource-related error during recovery. The database is not damaged, but files may be missing or system resource limitations may be preventing it from starting. The database is unavailable. Additional action by the user is required to resolve the error and let the recovery process be completed.
Great! But what are these "additional actions", and how can I find out which one's for me?
- detach then attach again
- take offline then take online again
- restore a backup
- setting emergency/single_user and back to multi_user
- restart the sql server instance
Some of these worked for me, heck: all of them may work. However, these are all "just try this!" suggestions from questionable sources with (side) effects I may not know about or even want.
So, again: what is the appropriate "additional action" msdn speaks of, and above all: why??