Log Shipping Recovery

  • I am trying to recover a log shipping destination database with the following command:

    restore database dbname with recovery

    and got the following 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 made sure no one but me is using the database. Any idea what I should do? Thanks.

  • Please Help...

  • the answer is simple...

    It always happens during my classes...

    😉

    you cannot restore a DB while users are using it... like a normal DB...

    use sp_lock or sp_who to find the spid and kill the active processes on that db

    log shipping is a ...

    in italian i would say 'accrocchio'

    dont know in english...

    but is bad...

  • I mean...

    maybe logship itself is using it...

    or yourself...

    and is enough

    😉

  • quote:


    I made sure no one but me is using the database


    Make sure EVEN YOU are not using the database.

    Cheers,

    - Mark


    Cheers,
    - Mark

  • If you have Enterprise Manager open with the Database highlighted and have Query Analyzer open accessing this database, you will get this error. Minimally, highlight a different database in Enterprise Manager, but you may have to close Enterprise Manager completely to release the connection. Also, make sure you only have one Query Analyzer window opened to that database.

  • I did kill all connections before the restore. I have to have one query window to issue the command.

    The destination is in Warm Standby mode. How do you get the destination out of this warm standby mode? I think that is what is causing the error message. Thanks.

  • You're missing the pertinent point. Yes, you need a query window to issue the command, but you must not have a connection to your warm standby database.

    Close QA and EM. Open QA, obtaining a connection to master only. Issue the recover command.

    (I have tested this, and have no problem bringing a database out of standby mode using this procedure)

    Cheers,

    - Mark


    Cheers,
    - Mark

  • You are right, Mark. My QA window is connected to the db not master. It worked.

    Thanks again.

Viewing 9 posts - 1 through 8 (of 8 total)

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