When it's time to failover to the secondary database, so that it becomes our primary database, we have to do the following·
- if possible, back up the transaction log on the primary database
- Apply all outstanding transaction logs to the secondary database after careful consideration. You may not want to restore all the transactions, if the reason you are failing over is because some unwanted transactions were performed on the primary database. In these cases, you would want to restore to a point-in-time just before those transactions were committed.
- run a final restore with recovery on the secondary database e.g.
RESTORE DATABASE DatabaseName WITH RECOVERY
4. point your users to the new primary database
5. set up log shipping again as part of your disaster recovery plan
You can also use the sp_change_primary_role and sp_change_secondary_role stored procedures to perform the final tasks on the primary and secondary databases respectively. If you have set up a monitor server too, you can use the sp_change_monitor_role stored procedure to update the log shipping records. See the Books Online documentation on these stored procedures for further details.