question

chitrarekha.saha avatar image
chitrarekha.saha asked

Restore database from Logshipping

When I need to use the secondary database after log shipping do I restore from the last log and recover it? or use the command RESTORE DATABASE database_name WITH RECOVERY
sql-server-2008log-shipping
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

anthony.green avatar image
anthony.green answered
If you need it to be up to the second then you will need to restore the next log with recovery, if you can skip the tail of the log or are not bothered about the next log being shipped over, you can just restore the database with recovery as you have previously stated.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Blackhawk-17 avatar image Blackhawk-17 commented ·
Plain and simple... what is your Recovery Point Objective? Can you afford to lose the data that would have been in the extra log or is what is already shipped enough?
0 Likes 0 ·
Tim avatar image
Tim answered
Typically you have log shipping setup with a load delay. You would want to roll the database forward to as soon as possible before the problem that occurred that caused you to fail over. If you are simply failing over to do maintenance on the primary then you want all transactions, so apply those logs and do a final WITH RECOVERY restore. If you had a data related event that you want to stop at a specific time, then restore the logs to that point in time then restore WITH RECOVERY.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.