Sql-server – After log shipping, I activate failover with a RESTORE. What happens when the next log shipping job runs

log-shippingsql-server-2008-r2

I'm using log shipping for the first time. I've got it working between my primary and secondary server, on the secondary server the database is Restoring... which I understand basically means it is waiting to be activated.

I will run RESTORE DATABASE MyDatabase WITH RECOVERY to activate it, but then what happens next time the job runs to do log shipping? Will it fail? Should I disable the job manually? Will it overwrite my database and set it back to Restoring... ?

Thanks

Best Answer

I will run RESTORE DATABASE MyDatabase WITH RECOVERY to activate it, but then what happens next time the job runs to do log shipping? Will it fail? Should I disable the job manually? Will it overwrite my database and set it back to Restoring... ?

Yes they will run. Logshipping is simple copy and movement of logs so when you bring secondary database online it just brings the database online it does not affects any job running. So you should disable all backup,copy,restore and alerts jobs. When next time on primary, backup job wil run it will succeed even copy job will succeed on secondary but restore job would fail on secondary as database is online and logs cannot be restored more over log chain would be broken.