Solved

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

Posted on 2011-09-14
5
1,134 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

912 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

24 Experts available now in Live!

Get 1:1 Help Now