December 22, 2011 at 1:06 pm
I am gettting restoring errors(restore job failing) :-
Exclusive access could not be obtained beacuse the database is in use.
I ran :-
alter database dbname
set single_user
with rollback immediate
alter database dbname set multi_user
Then again tried restoring manually and then again the same error.
Regards,
Skybvi
Regards
Sushant Kumar
MCTS,MCP
December 22, 2011 at 1:54 pm
Make sure that you are not using the database (as in, your connection that you ran the ALTER DATABASE in)
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
December 22, 2011 at 1:55 pm
Do you see any sessions running against that database ? May be look at activity Monitor and filter by the database and see if there is any session connected...
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
December 28, 2011 at 12:10 am
Try this:
Step 1:
alter database dbname
set single_user
with rollback immediate
Step 2: (Immediately after Step 1)
Restore database dbname from device = '<filepath>'
Your databae will be in multi_user mode after the restore. If not you can execute following:
alter database dbname set multi_user
HTH
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply