dbTalk Databases Forums  

DB Busy in Detach

microsoft.public.sqlserver.clients microsoft.public.sqlserver.clients


Discuss DB Busy in Detach in the microsoft.public.sqlserver.clients forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
=?Utf-8?B?QWxleCBNYWdoZW4=?=
 
Posts: n/a

Default DB Busy in Detach - 06-11-2007 , 12:16 AM






I want to detach a SQL Server database in SQL Studio. Each time I try, I'm
told that the database cannot be detached because it is "busy." It is busy
because I must have something going on in one of my IIS applications which is
keeping ti busy. If I restart IIS, SQL Server always then lets me detach the
database.

My question is, is there no way to *force* SQL Server to allow me to Detach
the database without actually stopping SQL Server altogether? There are other
databases running on SQL Server that I don't want to stop, but I need to
forcibly detach this database. I really don't care if this messes up
currently running IIS applications.

Alex

Reply With Quote
  #2  
Old   
Jens
 
Posts: n/a

Default Re: DB Busy in Detach - 06-11-2007 , 03:36 AM






There is a checkbox in SSMS reading "Drop Connections". Using this
should enable you to drop the database with the GUI, although the
database is currently in use. Uf you want to do it programmatically
you should use the ALTER DATABASE Name SET SINGLE_USER WITH ROLLBACK
IMMEDIATE

Jens K. Suessmeyer.

---
http://www.sqlserver2008.de
---


Reply With Quote
  #3  
Old   
Peter YangMSFT]
 
Posts: n/a

Default RE: DB Busy in Detach - 06-11-2007 , 03:49 AM



Hello Alex,

I understand that you cannot detach a SQL Server database because it's
connected by a Web application. If I'm off-base, please let me know.

You may want to try the following method to see if it helps:

use Management studio to connect to the server, and go to
Management->Activity Monitor, and right click all connections to the
database->Kill Process

Also, please try to pause/continue sql server instance to test:

net pause mssql$instancename
net continue mssql$instancename

Since if there are existing connecctions to the database, if above method
doesn't help. You may have to stop/Pause the Web appllciation or Web site
hosting the application.

If you have any update on the issue, please feel free to let's know. Thank
you.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.