SQL Server shows database in recovery

I am not sure if this would help solve the issue, but you can give it a shot.

Run:

RESTORE DATABASE YourDatabase WITH RECOVERY

See if the above brings the database out of recovering mode. If it doesn't then the problem may be something else.

Can you try the below command and see if the database is corrupt?

DBCC CHECKDB ('YourDBname') WITH NO_INFOMSGS, ALL_ERRORMSGS

If it detects corruption, then you might want to repair the database using DBCC CHECKDB


Whenever you bring a database online, it goes through a recovery process. I'm a bit confused by your phrasing of the problem though. Are you seeing the database go into recovery any time other than when the database is being brought offline (either from your original power failure or by your having brought it offline and then online again)? If so, the database is going offline for some other reason. Best to check the SQL server logs to see what's going on.

You should also check the Windows event log for something like a disk failure. The database should not be starting up and going into recovery during normal operations.


Community wiki answer originally left as an edit to the question by its author:

The problem was that the database property AutoClose was set on.

The solution was to set AutoClose to false.