failed restore

  • I'm doing a full backup from one server and trying to restore to a different server. Both servers have the same OS and database. I'm following step-by-step instructions, SQL Server 2000 Backup and Restore, provided by Microst TechNet. When I try to restore I keep getting the following exception (error) message:

    Microsoft SQL-DMO(ODBC SQL State: 42000)

    Wxclusive access could not be obtained because the database is in use.

    RESTORE DATABASE is terminating abnormally.

    What does this mean and how can I fix it?

    Thanks,

    cjb 

  • Looks like a stray user is blocking your way.  It could even be yourself if you have EM and Query Analyzer open.  I would kill all open connections and set the target db to single user mode and try it again.

  • EM (Enterprise Manager) is how I'm doing the restore. Not using Query Analyzer. How do I kill open connections and set the target database to single user mode. I'm very new at this.

    Thanks for you reply.

     

    cjb

  • I like to use  sp_who2 to view my open connections and kill any open spid's connected to that db.

    OR, in EM go to Current Activity and right click on an open process and choose kill. 

    Then execute alter database 'name' set single_user

    OR in EM right click the db and choose properties go to Options and select Restrict Access to single user

    Restore the db

    Then execute alter database 'name' set multi_user or uncheck restrict access

  • just thought you'd like to know that I've restored the database.

    Thanks for your help!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply