Monday, February 20, 2012

Restore master database with SQL 2005 made an error with me

- First I made a full backup of master database

- Then I stopped SQL Server Service

- in cmd: cd C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Binn

then sqlservr.exe -m

- I entered that single user mode

> Problem here:

- I tried to connect to sql by sqlcmd -E >

HResult 0xE9, Level 16, State 1
Shared Memory Provider: No process is on the other end of the pipe.

Sqlcmd: Error: Microsoft SQL Native Client : Communication link failure.

> I tried to connect to management studio:

TITLE: Connect to Server

Cannot connect to BISHOYSERVER.


ADDITIONAL INFORMATION:

Login failed for user 'OFFICIALPROJECT\Administrator'. Reason: Server is in single user mode. Only one administrator can connect at this time. (Microsoft SQL Server, Error: 18461)

You can not utilize Management Studio when SQL Server is in single user mode. SSMS launches multiple connections which is not allowed. When you launch sqlcmd, add the -S parameter to specify an instance name.|||

The SQL server will not allow a login for anything once in single user mode. I have been trying for a week to move the System databases to two RAID 1+0 disk enclosures (one for MDF and one for the Transaction logs) with no success.

The information given in documentation is inaccurate as the solution does not work.

How does one run the query 'ALTER DATABASE mssqlsystemresource MODIFY FILE (NAME = data, FILENAME = 'E:\SQLData\mssqlsystemresource.mdf'); go' if you cannot attach to the single user mode database?

Who is not telling us what?

|||If you can't connect, then that means someone or something else is grabbing the only connection when you put it in single user mode. You need to find every connection that is normally there and make sure that every application which would connect is shut down and can not get to the SQL Server and that no one else is connecting either. Worst case scenario if you can't get everything to quit connecting and tying up your connection is that you walk into the data center, login directly to the console, walk around behind the machine, yank the network cable out of the back, and then do your work. At that point, it is completely impossible for anyone else to connect to the machine.|||I was having this same problem. This is a brand new server that's no one is even connected to, so when i saw Michael's post, I realized that there were a few other SQL related services that were running that could be connecting to the database server.

My guess is that the reporting service is what was connecting, but just to be sure, I stopped all services and then followed Microsoft's guide to moving the master and mssqlsystemresource databases. This seemed to fix the problem.

Hope this helps!|||

Stop the SQL server reporting services

and login using syntax

sqlcmd -E -S %SQLName% -Q"ALTER DATABASE mssqlsystemresource MODIFY FILE (NAME = 'log', FILENAME = 'f:\sql05data\mssqlsystemresource.ldf')"

Cheers !!!

Nithin

No comments:

Post a Comment