Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Service Broker / September 2007

Tip: Looking for answers? Try searching our database.

Recovering A DB From A DEADLOCK Condition

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
txCamper - 28 Aug 2007 14:50 GMT
Sorry if this is a silly question; I'm new to MS SQL Server...

In trying to simply copy a database an error occured (unfortunately I didn't
record the original error as it has happened before) resulting in the
original database instance remaining in Single User mode.

I've tried all the usual querys to place the db in multi-user mode only to
get the following message:

Msg 5064, Level 16, State 1, Line 1
Changes to the state or options of database 'Revision_SANDBOX' cannot be
made at this time. The database is in single-user mode, and a user is
currently connected to it.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.

I can't even Detach or Take Offline the db now.  I have a backup ready to
restore but I can't unlock the current instance to do anything.

Can someone please point me in a direction to be able to remove the locked
db instance so I can reload it with my backup?

Thanks so much...
Jonathan Psaila-Depasquale - 05 Sep 2007 09:31 GMT
Hi,

Run sp_who.  One of the columns returned will be dbname.  Record the
spid that is connected to the database in question.  Then run the Kill
command using the spid you recorded earlier.

Jonathan

> Sorry if this is a silly question; I'm new to MS SQL Server...
>
[quoted text clipped - 19 lines]
>
> Thanks so much...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.