Log shipping Error

  • I am gettting restoring errors(restore job failing) :-

    Exclusive access could not be obtained beacuse the database is in use.

    I ran :-

    alter database dbname

    set single_user

    with rollback immediate

    alter database dbname set multi_user

    Then again tried restoring manually and then again the same error.

    Regards,

    Skybvi

    Regards
    Sushant Kumar
    MCTS,MCP

  • Make sure that you are not using the database (as in, your connection that you ran the ALTER DATABASE in)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Do you see any sessions running against that database ? May be look at activity Monitor and filter by the database and see if there is any session connected...


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • Try this:

    Step 1:

    alter database dbname

    set single_user

    with rollback immediate

    Step 2: (Immediately after Step 1)

    Restore database dbname from device = '<filepath>'

    Your databae will be in multi_user mode after the restore. If not you can execute following:

    alter database dbname set multi_user

    HTH

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

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

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