Solved

Locked out of my SQL Server.

Posted on 2007-04-09
3
745 Views
Last Modified: 2012-06-27
I have MSSQL Server running on a Windows Server 2003 environment.  The main DB we use to run our entire business went to single user mode for some reason.  The fix should be simple, just switch back to multi-user mode.  However...when I try to do anything (view tables, users, go to properties) I get the following message:

Error 22285: [SQL-DMO]Database 'GM001' is already open and can only have one user at a time.

This is problematic since I need to get to properties to change back to multi-user mode.
0
Comment
Question by:magicspringsadmin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 32

Accepted Solution

by:
Daniel Wilson earned 500 total points
ID: 18876561
You need to kill the process that is connected to it.

Open Query Analyzer & point to a different DB (master?).  type "Exec sp_who2" and press F5.

Scan the results to find the SPID that is using the DB in question -- GM001, I guess.

Then execute sp_kill using that SPID as a parameter.

After that, you should be able to go into the DB properties & take it out of single-user mode.
0
 
LVL 16

Expert Comment

by:rboyd56
ID: 18876586
This would indicate that there is already a open.

Here is a simple way to fix this.

Open Query Analyzer and enter these commands:

use GM001
go
sp_dboption 'single user', false
go

Do not execute it

Now in Enterprise Manager - right click on the database
Choose All Tasks
Detach database
Click the clear button to close all connections

Now run the query in Query Analuzer.

There should be no time lag between clicking the Clear button and running the query

0
 

Author Comment

by:magicspringsadmin
ID: 18876792
Well, I tried that, but I have software running on about 42 computers constantly trying to re-establish the connection.  I went around and shut down the software on all of them and now everything works just fine.  Thanks.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

717 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