using query analyzer to restore get error

  • trying to do a restore from query analyzer (ent. mgr wont work -error says use WITH MOVE....)

    anyway so far have tried

         alter database dbname set single_user with rollback immediate

    checked in ent. mgr - does confirm in single user mode

    followed by

         restore database dbname from disk='c:\backups\dbname.bak' with replace, move 'dbnamedata' to 'c:\program files\microsoft sql server\mssql\data\dbnamedata.mdf', move 'dbnamelog' to 'c:\program files\microsoft sql server\mssql\data\dbnamelog.mdf' go

    receive error

    msg 3101 exclusive access could not be obtained because the database is in use

    everywhere i've checked says this should work, what am i doing wrong?

    HELP

     

  • Do you have the database open in EM?  Try closing EM and ensure that no one else is attempting to access the same DB

    When attempting the restore via QA make sure that the DB is not the same as the one you are trying to restore...



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

  • ent. mgr was not open

    it is a standalone machine that is not plugged into the network while i have been doing this.

    if the db chosen (in the drop down at top of QA) is not the one trying to be restored i get error 3234

          logical file is not part of the database use restore filelistonly.....

     

    any other suggestions?

Viewing 3 posts - 1 through 3 (of 3 total)

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