Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


'Recovering' state of database


'Recovering' state of database

Author
Message
viduvs
viduvs
SSC Rookie
SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)

Group: General Forum Members
Points: 38 Visits: 284
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?
Jack Corbett
  Jack Corbett
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11014 Visits: 14858
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
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search