March 20, 2007 at 6:24 am
Hi
I have set a Db in single user mode to effect a Db restore, and, as far as I can see, have closed all connections to the Db.
sp_who and sp_who2 both show no connections to the database.
However, when I attempt the restore, it fails with the error "Exclusive access could not be obtained because the database is in use"
I am unable to see any active processes
Any ideas gratefully received
Many thanks
March 20, 2007 at 7:40 am
How are you doing the restore? Through EM or isql/osql or QA? EM opens multiple connections. The QA Object Browser opens a separate connection.
March 20, 2007 at 7:50 am
Run the following and see howmany connections u get
select spid from master..sysprocesses where db_name(dbid) = 'Ur database name'
Just kill the pocesses shown in this and then do the restore.
March 20, 2007 at 8:43 am
You can just take the database offline before starting the restore, and that will prevent connections.
alter database MyDatabase set offline with rollback immediate
March 20, 2007 at 9:56 am
Thanks All
March 20, 2007 at 9:27 pm
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply