March 22, 2006 at 10:41 am
Full error:
' RESTORE cannot process database 'SmecIntranet' because it is in use by this session. It is recommended that the master database be used when performing this operation. (Microsoft.SqlServer.Smo) '
I know it seems obvious enough, session in use, but I ran sp_who2 and there are no processes running against the db I want to restore. I have tried clicking on Master db and restoring from there, but still get same error.
I also checked the processes in the Activity Monitor part and there is nothing
I have restored this db once before when I created it and it was OK.
The backup comes from a SQL2000 server.
I am a bit green with 2005, am I missing something completely obvious?
March 27, 2006 at 8:00 am
This was removed by the editor as SPAM
March 27, 2006 at 12:54 pm
Hello,
I have had the same problem and don't understand why...
As bypass, I have deleted the database, recreated it and after that the restore has worked. It is not glorious... but it works...
Pierre
March 28, 2006 at 2:54 am
Many Thanks
I eventually tucked into the SQL query analyser side of it, and started to write a restore script, took a bit of fiddling, but this went thru eventually OK:-
RESTORE DATABASE SmegIntranet
FROM DISK = 'C:\SmegIntranet_db_200603220900.BAK'
WITH NORECOVERY,
MOVE 'SmegIntranet_Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\SmegIntranet_Data.MDF',
MOVE 'SmegIntranet_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SmegIntranet_Log.LDF',
replace
GO
Blimey SQL 2005, takes so much care of itself, almost makes it more difficult to do what you could do easily before.
Thanks
August 3, 2006 at 10:04 am
HI,
I faced the same error message while trying to restore by rewriting an existing database. I solved this by selecting the databse insql server studio and then clicking on make offline which takes the database offline. Select the correct mdf and ldf files and bingo it works !!!
Regards,
Sriram
August 28, 2007 at 2:39 pm
If you do not see any active sessions for the database you are trying to restore, it means that this is the default db of the user you logged in as. The db gets locked and you won't be able to restore it.
To avoid this effect, log in as some other user or change default db to master.
November 13, 2009 at 5:04 am
I know this is adding to a really old post but that's exactly the message I'm getting, trying to restore a test version of a database from last night's backup of the live version. Both in sqlserver 2005. My default database when I log into the server is tempdb, so any advice gratefully received.
Cheers, Jules.
November 13, 2009 at 5:13 am
Please start a new thread for a new question in future.
There's some connection to the DB that you're trying to restore. Not necessarily yours, but there is one. If you're using management studio, it could be the connection from object explorer.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply