SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Database in Recovery


Database in Recovery

Author
Message
SQLSACT
SQLSACT
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2112 Visits: 2931
Hi All

I had a situation where my SQL Server was stopped in the middle of a long running transaction, I knew that when SQL Server came up, there would be a substantial wait before the database became available again.

When SQL Server came up, the database was in a recovery state. I checked the logs and it showed "recovery of database.... Phase 2 of 3"

What confused me is that after phase 2 of 3, the database went into and Online State but the logs showed "recovery of database.... Phase 3 of 3"

I allowed phase 3 to complete before starting the application that uses the database

My question is, could I have started using the database during the 3rd phase already, was it unnecessary to have waited for phase 3 to complete?

Thanks
GilaMonster
GilaMonster
SSC Guru
SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)

Group: General Forum Members
Points: 89547 Visits: 45284
Yes, you could have. The DB was online and available.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


SQLSACT
SQLSACT
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2112 Visits: 2931
GilaMonster (1/11/2013)
Yes, you could have. The DB was online and available.


Thanks, would you recommend it though?

Am I right in that the 3rd phase (Undo) is where the uncommitted transactions are being rolled back?

At the start of Phase 3, I noted that the log was 99% full, at about 70% of the 3rd phase, the usage went down to about 20% and after recovery, it was 1%.

I am assuming that if I had started the application, the Log would have grown?

Thanks
GilaMonster
GilaMonster
SSC Guru
SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)

Group: General Forum Members
Points: 89547 Visits: 45284
SQLSACT (1/11/2013)
GilaMonster (1/11/2013)
Yes, you could have. The DB was online and available.


Thanks, would you recommend it though?


Yes, why not?

Am I right in that the 3rd phase (Undo) is where the uncommitted transactions are being rolled back?


Yes

I am assuming that if I had started the application, the Log would have grown?


Maybe. Maybe not. Does the log usually grow when you start the app?

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


SQLSACT
SQLSACT
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2112 Visits: 2931
At startup there a quite a few inserts that run.

I wasn't sure if that would get the log to it's tipping point and then subsequently grow. Was really trying to avoid log growth.


Thanks
DBA From The Cold
DBA From The Cold
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2199 Visits: 1746
Hi,

If you're trying to avoid log growth you could pre-size the transaction log to avoid auto-growth operations.

Andrew
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