Today, after a power failure, one database (with Recovery: full) shows "In Recovery" in SSMS. So:
myDatabase (In recovery) (database status: recovery, Shutdown)
After finish, the "recovery process" the database shows the name myDatabase without "(In recovery)". I thought that the problem was solved, but it was not.
When I started the application that uses that database, the extra text "(In recovery)" appears again next to the name of my database.
I waited until the "recovery process" finished and then I took the database offline and brought it back online.
I restarted the server, restarted the computer and when my application was running the extra text appears again. In the SQL Server logs the message "Starting up database 'myDatabase'" appears few times. It seems that the database is working because I can insert data, but the state is showing that something it happens.
To add some more details, when I run this query:
SELECT databasepropertyex('nyDatabase', 'STATUS')
It shows Recovering, online, suspect and the back to online and then Recovering and so on.
After some time, I found the problem and the property AutoClose was "True" (
AutoClose = True). The solution was to set it to
AutoClose = False.
Is this the only thing that can cause this problem / was this in fact my problem? Was setting
AutoClose to false an appropriate action?