Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Locked out of my SQL Server.

Posted on 2007-04-09
3
Medium Priority
?
749 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 2000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

610 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