SQL Server Performance

If secondary needs to be restored

Discussion in 'SQL Server Log Shipping' started by sql_machine, May 8, 2006.

  1. sql_machine New Member

    I've actually never had to do this, but just in case I need to restore the secondary, I think to speed up the restore I could just RESTORE LOG...WITH RECOVERY (meaning just the last log file copied to the standby server. <br /><br />The issue comes since on the restore location on the standby there're many logs that precede this last one, the restore will fail with the nasty error:<br /><br />"this log is too early....please apply correct LSN"<br /><br />So I have several choises. Low-tech choise is to manually delete all but last log from the share on standby. But this is not technically correct, because I'm not 100% sure the LSN on this last log is the one I need.<br /><br />I could also look at MSDB.backupset table, and see wich log was applied last...then delete all the others. But these are just my rambling thoughts<img src='/community/emoticons/emotion-1.gif' alt=':)' /><br /><br />Is there a standard way to do this? Easy and quick?<br /><br />Thanks
  2. satya Moderator

    Why not take full backup from primary and restore on secondary?
    During that stop the log shipping process. You have apply the correct LSN since the last full database restore and check the backupset table on primary to see the list of restore.

    Satya SKJ
    Microsoft SQL Server MVP
    Contributing Editor & Forums Moderator
    http://www.SQL-Server-Performance.Com
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.

Share This Page