none
How can I get a database out of Standby/Read-only mode?

    Question

  • How can I get a SQL Server 2005 database out of Standby/Read-only mode?  I just restored this DB sent from a customer and it is in Standby/Read-only mode.  I need to add a user so that I can authenticate from my app for testing purpose. 

     

    Thx

    Wednesday, January 16, 2008 5:43 PM

Answers

  • You can use this as well to bring the database online from standby\read-only mode

    Code Block

    Restore database dbname with recovery

     

     

    - Deepak

    Wednesday, January 16, 2008 6:42 PM

All replies

  • Hi jdub3!

     

    To get the database out of STANDBY mode after the restore, you must restore the database WITH RECOVERY. 

     

    Code Block
    RESTORE DATABASE <database_name> FROM <full_backup>
        WITH RECOVERY;

     

    This will make the database available for use - it is in read-only mode while in standby mode.

     

    Brian

    • Proposed as answer by ianrobertbell Monday, April 14, 2014 2:55 PM
    Wednesday, January 16, 2008 6:12 PM
  • Doah!  I had tried this earlier but it wasn't working. It turns out that I created my DB with the wrong name (missed a letter my eyes weren't catching even though I looked).  My SQL statement used the name it was supposed to be, but wasn't, hence it kept failing. 

     

    I win the idiot for the day award.  Thanks for the help as I wouldn't have tried this again otherwise.

    Wednesday, January 16, 2008 6:33 PM
  • You can use this as well to bring the database online from standby\read-only mode

    Code Block

    Restore database dbname with recovery

     

     

    - Deepak

    Wednesday, January 16, 2008 6:42 PM
  • Hi,

     

    Try the below command also

    ALTER DATABASE database_name ONLINE

    Thursday, January 17, 2008 7:16 PM
  • Hi,

     

    You can try this, it worked for me-

    RESTORE DATABASE <db_name> WITH RECOVERY

    Wednesday, November 12, 2008 5:35 AM
  • HI There I used restore database <DBNAME> with recovery

    works for me.
    Saturday, January 02, 2010 5:19 PM
  • Hi,

    RESTORE DATABASE <db_name> WITH RECOVERY

    This works just fine.. Thanks..

    Wednesday, December 19, 2012 10:33 AM
  • It work! thank you

    Monday, September 30, 2013 2:43 AM