Microsoft Developer Network > 포럼 홈 > Getting started with SQL Server > How can I get a database out of Standby/Read-only mode?
질문하기질문하기
 

답변됨How can I get a database out of Standby/Read-only mode?

  • 2008년 1월 16일 수요일 오후 5:43jdub3 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    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

답변

모든 응답

  • 2008년 1월 16일 수요일 오후 6:12Brian D. Knight 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    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

  • 2008년 1월 16일 수요일 오후 6:33jdub3 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    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.

  • 2008년 1월 16일 수요일 오후 6:42Deepak RangarajanMVP, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

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

    Code Block

    Restore database dbname with recovery

     

     

    - Deepak

  • 2008년 1월 17일 목요일 오후 7:16VidhyaSagarMVP, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Hi,

     

    Try the below command also

    ALTER DATABASE database_name ONLINE

  • 2008년 11월 12일 수요일 오전 5:35contactng 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Hi,

     

    You can try this, it worked for me-

    RESTORE DATABASE <db_name> WITH RECOVERY