Error: Exclusive access could not be obtained because the database is in use when restoring msdb
Via the Restore Database Wizard GUI:The following message is not a LiteSpeed 2005 message. Please refer to SQL Server books online or Microsoft technical support for a solution:RESTORE DATABASE is terminating abnormally.Exclusive access could not be obtained because the database is in use.
Via Query Analyzer:
Server: Msg 62309, Level 19, State 1, Line 0
SQL Server has returned a failure message to LiteSpeed 2005 which has prevented the operation from succeeding.
The following message is not a LiteSpeed 2005 message. Please refer to SQL Server books online or Microsoft technical support for a solution:
Resulting error message:
RESTORE DATABASE is terminating abnormally.
Exclusive access could not be obtained because the database is in use.
Exclusive access required for restore.
1.Run in Query Analyzer:
exec master.dbo.xp_restore_database @database = Nmsdb_new, @filename = ND:Backupmsdb_LiteSpeed_Full.BKP, @filenumber = 1, @with = NRECOVERY, @with = NNOUNLOAD, @with = NMOVE NMSDBData TO NC:Program FilesMicrosoft SQL ServerMSSQLdatamsdb_new_Data.mdf, @with = NMOVE NMSDBLog TO NC:Program FilesMicrosoft SQL ServerMSSQLdatamsdb_new_Log.ldf
2.Drop the existing msdb and rename msdb_new to msdb
This function is the result of Microsofts design of SQL Server
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center