Wednesday, October 1, 2014

SQL 2008 R2 - How to setup log shipping

Pre-requisites
  • User account being used to setup the log shipping have sysadmin role in sql
  • Primary SQL server
    • Primary Backup Folder that Primary and Secondary servers can access
    • Primary database set to Full or differential recovery
  • Secondary SQL Server
    • Secondary Backup Folder  that Primary and Secondary servers can access
Setup Log Shipping
  • Right click on the database you want to ship on the primary server>Tasks>Ship Transaction Logs
  • Add secondary server
  • The easiest options is to let it generate a full backup and restore it to the secondary (first option)
  • Restore Transaction Log in norecovery mode if you don't need to access it
  • Restore Transaction Log in standby mode if you need to access it
To bring a restoring database from NORECOVERY to RECOVERY

RESTORE DATABASE database_name WITH RECOVERY

If you script out the whole thing to a query window, the script has two parts, one for the primary, one for the secondary.

Run each part of the script manually on each respective server to create the jobs if it doesn't do it automatically.

Good guide here
http://www.mssqltips.com/sqlservertip/2301/step-by-step-sql-server-log-shipping/

No comments:

Post a Comment