Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

'Recovering' state of database Expand / Collapse
Author
Message
Posted Friday, October 9, 2009 2:35 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, January 15, 2014 10:56 PM
Points: 35, Visits: 277
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?

Post #800577
Posted Friday, October 9, 2009 7:59 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:19 PM
Points: 10,211, Visits: 13,157
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.


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
Importance of Proper Transaction Log Size Management





Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #800758
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse