I have come across an issue trying to restore a backup of my SQL7 to SQL2000. I migrated to SBS2003 and have restored our database to SQL 2000 many times for testing. Durning my final migration is when I started encountering this error when I execute:
restore database fisc
from disk = 'C:\JEP\fiscbackup
with recovery,
move 'fisc_Data' to 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\fisc_Data.MDF',
move 'fisc_Log' to 'C:\Program Files\Microsoft SQL Ser4ver\MSSQL\Data\fisc_Log.MDF'
The script has worked before but is now returning error:
Server: Msg 3101, Level 16, State 1, Line 1
Exclusive access could not be obtained because the database is in use.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
I have run sp_who and it shows 17 loginname entries of sa with a status of either sleeping or background. SPID 51 shows administrator with a status of runnable. I have tried using kill but it will not kill the administrator since that is the login I am
using to run the script.
Any ideas of what I can do to get the database to restore?
Thanks,
Jason Pintok
Hi,
Execute the below script from master to restore the FISC database (Execute
all the lines in a together from query analyzer)
use master
go
alter database fisc set single_user with rollback immediate
go
restore database fisc
from disk = 'C:\JEP\fiscbackup
with recovery,
move 'fisc_Data' to 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\fisc_Data.MDF',
move 'fisc_Log' to 'C:\Program Files\Microsoft SQL
Ser4ver\MSSQL\Data\fisc_Log.MDF'
Thanks
Hari
MCDBA
"Jason Pintok" <anonymous@.discussions.microsoft.com> wrote in message
news:7301F6E9-1E57-4B94-9591-6C984B05D6ED@.microsoft.com...
> I have come across an issue trying to restore a backup of my SQL7 to
SQL2000. I migrated to SBS2003 and have restored our database to SQL 2000
many times for testing. Durning my final migration is when I started
encountering this error when I execute:
> restore database fisc
> from disk = 'C:\JEP\fiscbackup
> with recovery,
> move 'fisc_Data' to 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\fisc_Data.MDF',
> move 'fisc_Log' to 'C:\Program Files\Microsoft SQL
Ser4ver\MSSQL\Data\fisc_Log.MDF'
> The script has worked before but is now returning error:
> Server: Msg 3101, Level 16, State 1, Line 1
> Exclusive access could not be obtained because the database is in use.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
> I have run sp_who and it shows 17 loginname entries of sa with a status of
either sleeping or background. SPID 51 shows administrator with a status of
runnable. I have tried using kill but it will not kill the administrator
since that is the login I am using to run the script.
> Any ideas of what I can do to get the database to restore?
> Thanks,
> Jason Pintok
|||Thanks Hari, that nailed it. I appreciate the help.
Jason Pintok
No comments:
Post a Comment