Thursday, March 22, 2012

Exclusive accessn cannot be obtained while restoring DB

Hi,
I keep getting this error while trying to restore the
database:
"Exclusive Access could not be obtained because the
database is in use. RESTORE database is terminating
abnormally."
I am sure though that noone has logged onto the system
while I doing the restore but I keep getting this error.
Any clue?
Thanks.use sp_who to see if there is any connection made to the database. Also you
can trying running command through query analyzer.
alter database <db_name> set single_user with rollback immediate.
above command will kill all the session with rolling back on going
transactions for the particular database. then run the restore command with
the same session (since your database is in single user mode).
-Vishal
"John" <kumarj@.logica.com> wrote in message
news:08ed01c33f0c$4c0c7c70$a301280a@.phx.gbl...
> Hi,
> I keep getting this error while trying to restore the
> database:
> "Exclusive Access could not be obtained because the
> database is in use. RESTORE database is terminating
> abnormally."
> I am sure though that noone has logged onto the system
> while I doing the restore but I keep getting this error.
> Any clue?
> Thanks.
>|||John,
Are you trying to restore via enterprise manager?Execute sp_who in Query
analyzer and make sure the concerned databasename is not mentioned in the
output.
If you're running SQL Server 2000, you can issue this command to remove all
connections to the database :
ALTER DATABASE <databasename> SET single_user WITH ROLLBACK IMMEDIATE
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"John" <kumarj@.logica.com> wrote in message
news:08ed01c33f0c$4c0c7c70$a301280a@.phx.gbl...
> Hi,
> I keep getting this error while trying to restore the
> database:
> "Exclusive Access could not be obtained because the
> database is in use. RESTORE database is terminating
> abnormally."
> I am sure though that noone has logged onto the system
> while I doing the restore but I keep getting this error.
> Any clue?
> Thanks.
>

No comments:

Post a Comment