Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Other SQL Server 2012 Topics
 Putting Server in Single-User Mode

Author  Topic 

Dhudson29
Starting Member

23 Posts

Posted - 2014-12-04 : 13:13:09
I have tried everything to put the server in Single User Mode so I can restore the master database.

1. Tried the -m Option in Configuration Manager and restarted service.
2. Tried command line using sqlsevr.exe
3. Tried sqlcmd -s <servername>. - It connects
4. Used Net Start MSSQL$<Servername> - It starts service.

Each time I issue the RESTORE DATABASE master command, it tells me the server is not in Single-User Mode.

Please help??

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-12-04 : 13:40:52
Are you issuing the command through sqlcmd? Or via SSMS? SSMS opens multiple sessions if you have the left pane and a query window open.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Dhudson29
Starting Member

23 Posts

Posted - 2014-12-04 : 14:05:07
I am issuing the command through sqlcmd.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-12-04 : 14:09:22
Is the SQL Agent service stopped? It'll use up the single connection.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-12-04 : 14:11:45
Not sure if this is needed, but you might want to try the -f option and then connect via the DAC (-A option in sqlcmd).

My recollection is that I used -m and -c last time I needed to start in single-user mode. I don't remember what the -c option is though (I'm in a meeting otherwise I'd google it).

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Dhudson29
Starting Member

23 Posts

Posted - 2014-12-04 : 14:23:07
Yes the SQL Server Agent is Stopped. When I try sqlservr.exe -m -s <servername> I get the following message:

Error: 17050, Severity: 16, State: 1. initerrlog: Could not open error log file, because it is being used by another process. That's crazy because this is a new instance, and the SQL Agent service is stopped.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-12-04 : 14:26:04
You can use Process Explorer to see what is using it. I suspect your anti-virus software or similar is the culprit.

Make sure the SQL Server service is stopped when running sqlservr.exe.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Dhudson29
Starting Member

23 Posts

Posted - 2014-12-04 : 14:26:16
By the way, there are 2 Instances on this server, but I have pathed to the named instance I want to put in single user mode.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-12-04 : 14:34:28
Please see my last reply as we were posting at the same time.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Dhudson29
Starting Member

23 Posts

Posted - 2014-12-04 : 15:53:14
OK. I did not stop the SQL Server Service, only the SQL Agent Service. Stopping the SQL Server Service resolved the problem.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-12-04 : 15:55:35


Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -