Home Forums SQL Server 2005 Administering How to make log-shipped database to be available for queries RE: How to make log-shipped database to be available for queries

  • Perry Whittle (12/31/2008)


    Daksin

    as Adi pointed out you cannot query the database in the norecovery state. Bear in mind with the standy option when log file restores occur users will be kicked out without warning by the restore process. If you're needing to query the database that much then Log shipping probably isn't your best option.

    If you're asking how can you bring the database back online when in the norecovery state then simply issue

    RESTORE DATABASE MYDATA WITH RECOVERY

    Bear in mind that the log shipping config will be broken

    Acutely when you configure the log shipping with standby option, you can also select between 2 choices – kill all processes in the secondary database and perform log restore or don’t perform log restore if the database is being used. Of course if you select the second option, the restore operation might never run if someone opens a connection to the database and doesn’t close it, so it is better to use the first option.

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/