How to get a database out of recovery mode

Hi,

I have detached a database, moved the files to another drive and attached 
the DB again. It appeared in read-only mode, so I tried to change the mode to 
read-write... but unfortunately it failed
When I look in the error log there is a stack dump where some of the info are

Location:	 "logmgr.cpp":5527
Expression: !(minLSN.m_fSeqNo < lfcb->lfcb_fSeqNo)
Input Buffer 172 bytes -
ALTER DATABASE [PXPX_PLEngine_Frys] SET  READ_WRITE WITH ROLLBACK IMMEDIATE

After this the database became inaccessable and gave the following reply on 
various DBCC calls "Database *** is being recovered. Waiting until recovery 
is finished."

When I looked in the activity monitor I didnt see any processes working on 
that database, and there was no I/O on the disk. So I decided to restart the 
service. 
Now the database is in recovery mode, but still nothing is happening in the 
activity monitor.

I have no clue what to do..... but this is what I am going to try. I will 
shut down the service, delete the database files and start the service again. 
Hopefully the instance will just mark the database as suspect, and then I can 
drop it.

I dont mind loosing data, I have backup of the files as well as a full 
database backup.

Do anyone have better ideas of how to enforce it out of recovery mode?
0
Utf
2/16/2010 11:26:01 AM
sqlserver.server 1327 articles. 0 followers. Follow

3 Replies
26121 Views

Similar Articles

[PageSpeed] 11

Niels

When you attach/restore the database SQL Server engine checks for consistent 
data and if you had non commited transactions then it will be rollbacked and 
commited transactions but not flushed to the disk then it will  forwared. It 
takes some time especially if the batch is large

So shut down the service in that case won't help  you. Wait till it will be 
recovered or restore  the database from last good backup






"Niels" <Niels@discussions.microsoft.com> wrote in message 
news:C1A9D00E-71B9-4331-9A78-C855712126A2@microsoft.com...
> Hi,
>
> I have detached a database, moved the files to another drive and attached
> the DB again. It appeared in read-only mode, so I tried to change the mode 
> to
> read-write... but unfortunately it failed
> When I look in the error log there is a stack dump where some of the info 
> are
>
> Location: "logmgr.cpp":5527
> Expression: !(minLSN.m_fSeqNo < lfcb->lfcb_fSeqNo)
> Input Buffer 172 bytes -
> ALTER DATABASE [PXPX_PLEngine_Frys] SET  READ_WRITE WITH ROLLBACK 
> IMMEDIATE
>
> After this the database became inaccessable and gave the following reply 
> on
> various DBCC calls "Database *** is being recovered. Waiting until 
> recovery
> is finished."
>
> When I looked in the activity monitor I didnt see any processes working on
> that database, and there was no I/O on the disk. So I decided to restart 
> the
> service.
> Now the database is in recovery mode, but still nothing is happening in 
> the
> activity monitor.
>
> I have no clue what to do..... but this is what I am going to try. I will
> shut down the service, delete the database files and start the service 
> again.
> Hopefully the instance will just mark the database as suspect, and then I 
> can
> drop it.
>
> I dont mind loosing data, I have backup of the files as well as a full
> database backup.
>
> Do anyone have better ideas of how to enforce it out of recovery mode? 


1
Uri
2/16/2010 11:41:37 AM
Hi,

The thing is that no threads is performing any recovery on that database, so 
it will never change out of recovery state. It is simply stuck on the 
recovery state.

Anyway... I stopped the service, deleted the files and started the service 
again. Now the database was readonly and I could simply drop it. I began all 
over by copying the original files and attached them again... no error..... 
strange but it works.

Ty for the time anyway :O)

"Uri Dimant" wrote:

> Niels
> 
> When you attach/restore the database SQL Server engine checks for consistent 
> data and if you had non commited transactions then it will be rollbacked and 
> commited transactions but not flushed to the disk then it will  forwared. It 
> takes some time especially if the batch is large
> 
> So shut down the service in that case won't help  you. Wait till it will be 
> recovered or restore  the database from last good backup
> 
> 
> 
> 
> 
> 
> "Niels" <Niels@discussions.microsoft.com> wrote in message 
> news:C1A9D00E-71B9-4331-9A78-C855712126A2@microsoft.com...
> > Hi,
> >
> > I have detached a database, moved the files to another drive and attached
> > the DB again. It appeared in read-only mode, so I tried to change the mode 
> > to
> > read-write... but unfortunately it failed
> > When I look in the error log there is a stack dump where some of the info 
> > are
> >
> > Location: "logmgr.cpp":5527
> > Expression: !(minLSN.m_fSeqNo < lfcb->lfcb_fSeqNo)
> > Input Buffer 172 bytes -
> > ALTER DATABASE [PXPX_PLEngine_Frys] SET  READ_WRITE WITH ROLLBACK 
> > IMMEDIATE
> >
> > After this the database became inaccessable and gave the following reply 
> > on
> > various DBCC calls "Database *** is being recovered. Waiting until 
> > recovery
> > is finished."
> >
> > When I looked in the activity monitor I didnt see any processes working on
> > that database, and there was no I/O on the disk. So I decided to restart 
> > the
> > service.
> > Now the database is in recovery mode, but still nothing is happening in 
> > the
> > activity monitor.
> >
> > I have no clue what to do..... but this is what I am going to try. I will
> > shut down the service, delete the database files and start the service 
> > again.
> > Hopefully the instance will just mark the database as suspect, and then I 
> > can
> > drop it.
> >
> > I dont mind loosing data, I have backup of the files as well as a full
> > database backup.
> >
> > Do anyone have better ideas of how to enforce it out of recovery mode? 
> 
> 
> .
> 
0
Utf
2/16/2010 2:03:02 PM
Niels (Niels@discussions.microsoft.com) writes:
> I have detached a database, moved the files to another drive and
> attached the DB again. It appeared in read-only mode, so I tried to
> change the mode to read-write... but unfortunately it failed When I look
> in the error log there is a stack dump where some of the info are 
> 
> Location:      "logmgr.cpp":5527
> Expression: !(minLSN.m_fSeqNo < lfcb->lfcb_fSeqNo)
> Input Buffer 172 bytes -
> ALTER DATABASE [PXPX_PLEngine_Frys] SET  READ_WRITE WITH ROLLBACK 
> IMMEDIATE
> 
> After this the database became inaccessable and gave the following reply
> on various DBCC calls "Database *** is being recovered. Waiting until
> recovery is finished." 


The error message indicates that there was a serious problem with the
database. Most likely some form of unforseen corruption. I see that you
already gave up on the database and started over. Since hardware errors
usually reoccurs, I would advice you run DBCC CHECKDB on your database
frequently, and if corruption reappears, move to a new disk.


-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

1
Erland
2/16/2010 4:58:48 PM
Reply:

Similar Artilces:

Mailbox recovery #2
Hello there! I made a backup last night of all the private database and today I need to recover just one mailbox of that database. The backup is not made mailbox by mailbox but as a whole. As more info the software I use to backup is Veritas Backup exec 8.6. Does anyone have an Idea of how can I make this? Thanks in advance. David "David Zambrano" <dzambranot@nospam.aol.com> wrote: >Hello there! >I made a backup last night of all the private database and today I need to >recover just one mailbox of that database. The backup is not made mailbox by >mailbox but a...

Remove BP tables from Dynamics database
I have a client who is currently running GP 8. I will be upgrading them to GP 10. Back when GP 8 was installed they installed but never used BP. So now the Dynamics database has BP tables in it. I want to completely remove all the BP 2.5 tables so that when I come along to install BP for GP 10 it does not run into any of those old useless BP tables. What is the best way to remove all of the old BP tables? The article 862544 in CustomerSource below includes scripts that should remove the BP SQL objects How to remove Business Portal 2.x https://mbs.microsoft.com/knowledgebase/KbDisplay....

Monitor a staging database
Data is being recieved as XML packages, and the data parsed into staging tables in DatabaseA. We are working on DatabaseB. Once the data is in DatabaseA, we need to somehow grab that data and populate our tables. A way to do this would be to maybe store a 'LastTransactionId' in our database, and every now and again, check DatabaseA for new rows. If there are... maybe store the 'LastTransactionId' into a 'FromId' field, and then the lastest Id in DatabaseA into a 'ToId'... then suck the data with transactions within (and including) FromId to ToId, into ou...

i get error 404 not found when trying to download
I'm trying to download nokia pc suite to windows xp to upload gallery onto the computer but get error message404 not found - how can i download this pc suite please -- Krysy Albutt Krysy Albutt wrote: > I'm trying to download nokia pc suite to windows xp to upload gallery > onto the computer but get error message404 not found - how can i > download this pc suite please Care to enlighten us how this pertains to: - 1) Microsoft 2) Publisher 3) Windows If you're having problems downloading from the *NOKIA* site where do you think you should be directing your ...

compact database at run time
hi How can i compact my access database programmatically .. In MSDN they gave a code like #import "C:\PROGRAM FILES\COMMON FILES\System\ado\Msado15.DLL" #import "C:\PROGRAM FILES\COMMON FILES\System\ado\MSJRO.DLL" no_namespace try { IJetEnginePtr jet(__uuidof(JetEngine)); jet->CompactDatabase( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\nwind2.mdb", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\abbc.mdb;" \ "Jet OLEDB:Engine Type=4"); } catch(_com_error &e) { ::MessageBox(NULL, (LPCTSTR)e.De...

How to get Calendar to send me reminders
I have changed my e-mail address but for some reason I cannot get Calendar to send reminders to my new address - I think I have carried out all that is necessary to effect the changover but I am not getting reminders sent. Can anyone help please? Is the Calendar Live ID based and accessible at Calendar.live.com ? -- ....winston ms-mvp mail "Dabardevon" wrote in message = news:FDC2B3B2-EDE4-41B1-BFC4-C0F9ED59CFB9@microsoft.com... I have changed my e-mail address but for some reason I cannot get = Calendar to send reminders to my new address - I think I have...

Some recipients get the attachment, some get winmail.dat
This one has me baffled. We are using Exchange 2000 and Outlook 2000 and have been for 8 months. No previous problems with attachments (.doc, .xls, .jpg). About 2 weeks ago, we started hearing from certain recipients that the attachment wasn't arriving; instead they were getting an unreadable file called winmail.dat. MS says that this is because the sender is using Rich Text to format the email. We have changed the senders to use Plain Text and still have the same problem. If the email is sent to several recipients, some will get the attachment fine, some will not. This didn'...

Dexterity
When clicking on a lookup icon under debug mode, I receive the following message: "Cannot access this form because the dictionary containing it is not loaded." If anyone knows how to fix this issue, please let me know. Thanks, Pat When use lookup buttons in GPlains, GPlain open smart list window. in test mode you wouldn't have access to smart list. in Great Plains, take off those alternative windows under security, depends on which module you are working on, only take off smart list alternative window on that module will be ok. hlv is correct. The Lookups you see whe...

How to get the CScrollBar's Handle in CTreeCtrl?
Hey,All: I thought I have a problem when I trid to get the CScrollBar's handle from my CTreeCtrl extended handle. Can anybody tell me whether I can get the handle of the CScrollBar from the CTreeCtrl? Thanks in advance! Carl :-| Carl wrote: > Hey,All: > > I thought I have a problem when I trid to get the CScrollBar's handle from > my CTreeCtrl extended handle. > Can anybody tell me whether I can get the handle of the CScrollBar from the > CTreeCtrl? > > Thanks in advance! > Carl > :-| > > Sorry, it is not that simple. The scroll bars that...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

Can't display CListView in Report mode
I have a View derived from CListView. In it's OnInitialUpdate method, I do 4 InsertColumns that seem to work - when I trace thru them, each call returns the number of the column I indicated. In another method, I fill in the rows of the listview with calls to InsertItem followed by calls to SetItem. Again, tracing indicates these all succeed. But when the view displays, it looks like the text for each item is squeezed into a cell along the top of the view: AB.. AC.. AD.. BG.. HG.. PO.. and if I click on one of these, I get a thin vertical "cell" with all the text in i...

Cannot get fast forward or fast reverse to work with WMP 11
I am running Vista Home Premium on a HP G 217-EM Notebook which comes pre-installed with Windows Media Player 11. When I play cds and try to fast forward or fast reverse by keeping the fast forward or fast reverse buttons constantly depressed nothing happens. Why is this, and can anyone come up with a solution? Many thanks This doesn't work on my system either, so it's probably just a limitation of WMP. Fast forward and fast reverse should work fine when you rip the CD's to MP3 or WMA files, and play these files instead. Regards -- Tim De Baets http://www....

Autorecover in Compatibility Mode is a Disaster
There are recurring reports/posts of problems with the new Excel 2007 autorecovery process when it gets applied to "compatibility mode" (e.g., Excel 2003) models. Excel 2007 is effectively unusable when autorecover is turned on (the default). I'd like to know when Microsoft plans on fixing this problem, and what workarounds exist for it in the meantime. - Mark ...

Disaster recovery from an offline Sales for Outlook version
I am hoping someone can help me. We recently had a fatal error in the server hosting our CRM SQL database. We have back-ups of the server, but much to my shock, for some reason our back-ups have not been backing up those databases, so it appears all is lost. The question I am hoping for help with is the we have local copies of the database on several of our mobile users laptops. Is there a way that we could some how recover from those versions? BTW, I cannot log into any of the 'Deployment Manager', I just get a fatal error. Is there a possibility we could re-install and sync wit...

vlookup and Access Database Table
Can vlookup be used to get a result from an Access Database Table? Thanks. The vlookup function itself is an Excel function and as such can only retrieve data from an excel sheet. However you may be able to use the import external data menu option in the Data menu to retrieve your data from the access database, pull it into your excel workbook and then use the vlookup function. I never tried this myself, but maybe the idea can be applied. -- Jeroen van Nieuwkerk "finster26" wrote: > Can vlookup be used to get a result from an Access Database Table? > > Thanks....

Get paid while you get online!!
I found a great Internet company - Cashfiesta.com - that has created a product everyone can benefit from. They pay you while you work or play on your computer. All you need to do is keep their software - the FiestaBar=99 - active while you are online. They even pay you when your friends are using their computers. Unlike other companies, Cashfiesta gives you control over how much money you earn. They have an individual payrate based on the number of Special Offers you sign up for. As some of these offers are free, you can increase your payrate up to 33 times without spending a penny. It's...

Spreadsheet getting corrupted
Hello All: I have a relatively large spreadsheet. I am getting errors (see after my signature line). What could be causing these errors? Is it that the spreadsheet is too large? Thanks Deguza -------------------------------------------------------- Microsoft Office Excel File Repair Log Errors were detected in file 'C:\Documents and Settings\deguza\My Documents\sales\Sales_2006_2007.xls' The following is a list of repairs: Global PivotTable report information was repaired due to integrity problems. Global PivotTable report information was repaired due to integrity problems. Glo...

Can't get auto-update (update) to install
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC I've been trying to manually check for updates to Word 2008, and I get a &quot;critical update&quot; notice, asking me to install auto-update. When I try to install it, I cannot. It just keeps repeating the attempt, in an &quot;endless loop.&quot; What to do? <br> Thank you. ...

Reg getting the next IV Document Number field !
Hi, I am creating a window in dexterity similar to the item transaction entry window (Transactions>Inventory> Transaction Entry). In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field. I wanted to know if there is any function , or table that i can access to get the next document number in the new window that i am creating. Thanks, swetha -- swetha >In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field.< T...

How do I get??
Sorry if this seems a fairly easy question to you guys. I have a spreadsheet and I need to get the current system time into a cell. The format of the time is hh:mm am/pm. Any assistance would be most helpful. Hi try =INT(NOW()) in this cell and format is to your needs -- Regards Frank Kabel Frankfurt, Germany PM wrote: > Sorry if this seems a fairly easy question to you guys. > > I have a spreadsheet and I need to get the current system time into a > cell. The format of the time is hh:mm am/pm. > > Any assistance would be most helpful. PM, in the cell you want pu...

Get notified when Out of Office is on
I am using Outlook 2007. With 2003, when returning from leave, I used to get a notification that the Outlook out of office was still on and asking me if I wanted to switch it off. This reminder no longer appears with 2007. How can I switch this setting on so that I get the notification? "Mary Ann" <MaryAnn@discussions.microsoft.com> wrote in message news:ED5533A7-D0EA-41B8-B1A0-A9D15FB6FD98@microsoft.com... >I am using Outlook 2007. With 2003, when returning from leave, I used to get > a notification that the Outlook out of office was still on and asking me ...

Getting Control ID in Active X control
GetWindowLong return 0. You need to call GetDlgCtrlID from outside the activex control as the function available within the control returns an arbitrary value of zero. Take a look at this article http://xendra.ens.uabc.mx/~sinfante/loo/libro/ch17_4.htm particularly the paragraph preceeding the title "MFC and Ambient Properties". This really begs the question why you want the ID in the first place as activex controls have to be fully self containing to operate - with a few exceptions where sibling controls need to be able to locate each other. - Tim "ytv" <...

over VPN, it gets stuck when sending outgoing email
When I use VPN to connect to work from home, the outlook can not finish sending outgoing emails. The progress bar moves to the end but then stops there forever. It can never finish. The receiving of new incoming emails work fine. All other network functionality works, e.g. internet browsing, telnet, ftp, etc, all work fine. My system is win2k. I use linksys wireless DSL router. I'd appreciate any hint! Are you using Exchange server? I'd set up your mail profile to prompt you to work offline or online - when using VPN, work offline with scheduled syncs. If not using exchange, pos...

Cached Exchange mode is killing me
I had to remove cached exchange mode in Outlook 2003, it will keep users from getting email. Fine, but when I do so they can no longer customize the Outlook Today page. They change the look and then open an email and the page reverts back to the default. It also has gifs it cannot find as is evidenced by the red "x" where the pic should be. If I turn caching back on, all is fine. How do I get this to behave? ...

Get photos from a camera
I have an asp.net intranet application that I need to upload 1 or all photos from a digital camera at a PC workstation. We are using DataGrids and GridViews to display them on the web once they are uploaded but need something at the client. I assume I need some sort of ActiveX process or something. Has anyone run into a solution for this need? Thanks. -- David "DavidC" <dlchase@lifetimeinc.com> wrote in message news:2B061F4F-B548-4AA4-96FA-2F87383192D2@microsoft.com... > I have an asp.net intranet application that I need to upload 1 or all > photos ...