Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot detach a DB "Because it is in use" 2

Status
Not open for further replies.

Ralph8

IS-IT--Management
Mar 15, 2003
168
US
I am trying to detach a DB using a proven SPROC that has worked fine until now. I keep getting an error message when I execute the SPROC that the DB "cannot be detached because it is in use".

I cannot see the reason for this. No Apps are running and I do not see any thing else.

Help?

TIA

Ralph D. Meredith
 
2 things, one go to EM and look at current activity and make sure there is no connection. The other is one I have done before, if you are detaching through qa make sure you are not connected to the db you want to process
 
One thing that caught me with this error one time was that I had both EM and QA open simultaneously and both were connected to that database.

It sounds stupid, but it does make a difference.



Catadmin - MCDBA, MCSA
Remember, "Work" is a four letter word. And you know what your mother told you about using four letter words!
 
Thanks guys.

The same connection in QA was it, although, conceptually, I think you were both thinking alike.

Thanks again

Ralph

TIA

Ralph D. Meredith
 
Maybe I spoke too soon!

I got the successful detach message, BUT now I cannot connect to the local server.

In both QA and EM I get messages that the local server (Named Ralph) cannot be connected to via the default and the "Master"
is being substituted. No connection can be made.

I have tried deleting the registration and doing a new registration but that did not do any thing positive. The green carrot is on but NO Databases show. In fact, nothing shows below the "No connection" message that is just below the server Icon in EM.

??????????????

TIA

Ralph D. Meredith
 
Try rebooting the non-connecting machine. Sometimes that helps after a change like this.



Catadmin - MCDBA, MCSA
Remember, "Work" is a four letter word. And you know what your mother told you about using four letter words!
 
Has the login account for the failed server changed for any reason? What about the windows account that is associated with it?



Catadmin - MCDBA, MCSA
Remember, "Work" is a four letter word. And you know what your mother told you about using four letter words!
 
Ralph8,

This technique might be useful if all else has failed.

I once had a db that was hung in 'Loading' status and I needed to delete it but always got the 'is inuse ' message.

This is what I did:

1. Changed SQL Server config settings:

Selected 'Allow modifications to system tables'

2. In master.sysdatabases, changed the category column (for the restored db name) from 1 to 0.

Refreshed EM - still shows (Loading)
3. But I was able to delete the db via right-click-->Delete

4. Reversed Step 1 to ** Uncheck ** 'Allow modifications to system tables' Best to not leave this capability in place.

Just be careful when messing with the systemtables.
Good luck.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top