Author |
Topic |
shan
Yak Posting Veteran
84 Posts |
Posted - 2012-07-31 : 15:29:02
|
I am trying to restore a huge database in the lower environment from prod backup, When I execute the below query It indicates the restore is completeSELECT percent_complete,* FROM sys.dm_exec_requests WHERE session_id = 57percent_complete =100But the Database is still in "Restoring" - State, When started the restore command I did execute the restore command "with recovery" and when i run the belowsp_who2 activeI can see one active restore spid, I belive the database is in undo \ redo phase.My first question isHow do i confirm if its in undo \ redo phase.My second question is , Can i Recover the database manually by issuing RESTORE DATABASE dbname WITH RECOVERYAs I am not concerned about open \ uncommited transactions, If I do that will the database will result in any corruption or in unusuable state.Any advice is appreciated.-Shan |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2012-07-31 : 15:50:02
|
You can't stop the undo/redo phase. While it wouldn't cause physical corruption, it could possibly cause metadata or transactional inconsistencies that prevent data from being accessed.If you only need to read from the database you can try RESTORE WITH STANDBY. This is similar to WITH NORECOVERY but permits read-only access. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
shan
Yak Posting Veteran
84 Posts |
Posted - 2012-07-31 : 16:04:43
|
Ok thanks you both. Standby wont help and will lead to more confusion among many users who are using.Tara - This is in norecovery, How will i issue DBCC against this db?Pls advise.-Shan |
|
|
shan
Yak Posting Veteran
84 Posts |
Posted - 2012-07-31 : 16:07:43
|
Also is there a way to determine the how far it needs to apply undo \ redo from logs? By the way this is restore of full backup only but this db have huge \big transactions in ldf.-Shan |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
shan
Yak Posting Veteran
84 Posts |
Posted - 2012-07-31 : 16:18:29
|
Yes DBCC LOGINFO returns in prod with 18421.But the full backup is 5 days old not todays...Can you pls help me understand what does it mean and how do we know where are we at since DBCC LOGINFO returned > 1000.Thanks for your quick reply.-Shan |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
shan
Yak Posting Veteran
84 Posts |
Posted - 2012-07-31 : 16:28:26
|
Thank you Tara for your expert advise.-Shan |
|
|
|