'Recovering' state of database

  • I am using SQL Server 2005.

    It has multiple databases (more than 1500) created.

    We have set auto_close option of these databases set to 'true' and recovery model to 'simple'.

    I could see many databases come in this 'recovering' mode for a fraction of second and then go out of this state. Some different set of databases come again in this 'recovering' set for fraction of second and then come to normal state.

    This is happening with multiple databases continously, different set of databases each time.

    No database is remaining in 'recovering' state for more than a second.

    (I could see 'recovering' against database in sql server management studio.)

    When I checked the output of sys.databases multiple times, i could see value 0 for column 'is_cleanly_shutdown' for different set of databases each time.

    I could see in the logs follwing entries continously for nearly all databases:

    CHECKDB for database <database_name> finished without errors on <date time>. This is an informational message only; no use action is required.

    <date time> here shown is much older (nearly 1 month old) compared to when we are getting the log entries.

    Can anybody please tell me why this is happening?

    Also I would like to know what happens when database gets shut down.

    How can any database get into recovering mode automatically?

    Can "backup log <db_name> with truncate_only" option could compel db to go in recovering mode automatically for few seconds?

  • I'm going to venture a guess here. You are seeing recovering as a the status every time a database is re-opened. When SQL Server starts up a database it has to make sure it is in a transactionally consistent state, so when you restart a SQL Server you see entries like this in the WIndows Event Log:

    Event Type:Information

    Event Source:MSSQLSERVER

    Event Category:(2)

    Event ID:17137

    Date:10/8/2009

    Time:5:28:58 PM

    User:N/A

    Computer:computer name

    Description:

    Starting up database 'database name'.

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.%5B/quote%5D

    So my guess is that the same thing is happening when a database is re-opened. The difference being that you can't see that the DB's are in recovering status when you restart a SQL Server because you can't connect to master and query it.

    FYI - autoclose really should be turned off. It seriously slows down access the database. Also you should NEVER truncate transaction logs you should manage them. Here a couple of links about why:

    Managing Transaction Logs[/url]

    Importance of Proper Transaction Log Size Management

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply