If secondary needs to be restored | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

If secondary needs to be restored

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
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.
]]>