Log-shipping: "Restoring" instead of "Standby/Readonly"

DanMoranDanMoran Posts: 14
edited May 25, 2011 5:16AM in SQL Backup Previous Versions
This works -- when done calling it, I get my database restored as "Standby/Readonly" and I can access the tables within it.

EXEC master..sqlbackup
'-sql "RESTORE DATABASE CALL FROM DISK = [h:\db\restore\call\*FULL*.sqb]
LATEST_FULL WITH STANDBY = [h:\db\restore\call\call_undo.dat]"'

This DOESN'T work ... after executing it my database is marked "Restoring" and I can't access my tables:

EXEC master..sqlbackup
'-sql "RESTORE LOG call FROM DISK = ''h:\db\restore\call\log_to_restore\*.sqb''
WITH NORECOVERY, MOVETO = ''h:\db\restore\call\log_restored''"'

Any suggestions would be much appreciated. I have to have the databases in standby mode after applying the interim logs.

Comments

  • peteypetey Posts: 2,358 New member
    You need to use the STANDBY option with the RESTORE LOG process too e.g.
    EXEC master..sqlbackup '-sql "RESTORE LOG call FROM DISK = ''h:\db\restore\call\log_to_restore\*.sqb'' 
    WITH STANDBY = ''h:\db\restore\call\call_undo.dat'', MOVETO = ''h:\db\restore\call\log_restored''"'
    
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
Sign In or Register to comment.