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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Restore issues

Status
Not open for further replies.
Jul 20, 2007
14
US
My initial message was this:

System.Data.SqlClient.sqlError: REStORE cannot process database because it is in use by this session. Use master

I checked and nobody is logged into the database. I removed the session from the DB by choosing to run in master but to no avail.. (same error message)

So I decided to run in single user mode via this command:
----set single_User with ROLLBACK IMMEDIATE----

after I ran this command the DB was set to single user mode but now I cannot restore because it tells me:

Failed to connect to server 'SERVER'
Cannot open user default database. Login Failed for user 'Administrator'

Now im totally lost... any help is appreciated
 
You don't need to put the database in single user mode. If there is some type of services program running that keeps connecting it is a good idea to shut it down.
But all user connections must be closed before you can restore the db.

Run sp_who2 If there are any open connections just kill them with the kill <spid> command.
Then restore your db.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
I ran sp_who2 and I could not find anything that was connected to the database I am trying to restore to. And i mean not a singe process, I switched my default db to master and still no sucess

Im stumped...

But on a different note.. I cant get out of single user mode lol... Bonkers
 
ok out of single user mode but same errors...

I tried sp_who2 but to no avail, there are currently no connections to the db that I would like to restore ????

Says the problem connection is the current session that im using but im not connected through that db either ....

WTF??? .... fustration sets in
 
do you have a session open with Query Analyzer?
The problem sounds like you are in the database your trying to restore. How are you trying to restore the db? Are you using Query Analyzer or Enterprise Manager?

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Remember, if you have Enterprise Manager open and open Query Analyzer (even from within EM), that is two instances open.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top