Solved

Database stuck in single user mode and can't kill System SPID

Posted on 2011-09-14
5
1,113 Views
Last Modified: 2012-05-12
Hi,

I have a database on SQL server 2008 that's stuck in single user mode. I put it in that mode to do a restore. But the restore failed because it could not obtain exclusive access. When I go in to kill the SPID, I see that it's a system process spid < 20. There are multiple system spid's that are blocking each other and won't let me access the database. I tried to take the database offline, detach it, delete it. All of those failed. Is there any other way for me to gain access back into the database?

Thank you!
0
Comment
Question by:LV_DBA
5 Comments
 
LVL 13

Assisted Solution

by:LIONKING
LIONKING earned 125 total points
ID: 36539748
Have you tried stopping the sql service and then starting it again?
0
 
LVL 25

Assisted Solution

by:TempDBA
TempDBA earned 125 total points
ID: 36541074
What the system spid says? Try running checkpoint and  running the following command let see what it has to say:-

ALTER DATABASE <dbname> SET MULTI_USER
0
 
LVL 10

Assisted Solution

by:sqlservr
sqlservr earned 125 total points
ID: 36541226
      alter database <dbname> set multi_user with rollback immediate
----------------------or------------
       alter database <dbname> set multi_user with no_wait
0
 
LVL 5

Accepted Solution

by:
VENKAT KOKULLA earned 125 total points
ID: 36547572
Try this command:

1) ALTER DATABASE MyDatabaseName SET MULTI_USER WITH ROLLBACK IMMEDIATE

2) If not, try the ADMIN:ServerName and it should open an emergency admin session

Then you can go into the SQL Server to ALTER DATABASE [name] SET MULTI_USER

3) If both of above points won't workout then restart the SQL Services and then run the command mentioned in the first point will surely resolve the issue.

0
 

Author Comment

by:LV_DBA
ID: 37160314
Thanks Everyone! I am sorry for not responding earlier. I had to restart SQL services and then run the ALTER DATABASE [name] SET MULTI_USER. I had to restart and run the command a couple of times before it would take.
 
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now