Step By Step SQL Server Log Shipping
Problem
Setting up Log Shipping for SQL Server is not that difficult, but having a step by step process is helpful if this is the first time you have setup Log Shipping. In this tip we walk through the steps to setup Log Shipping.Solution
Log Shipping is a basic level SQL Server high-availability technology that is part of SQL Server. It is an automated backup/restore process that allows you to create another copy of your database for failover.Log shipping involves copying a database backup and subsequent transaction log backups from the primary (source) server and restoring the database and transaction log backups on one or more secondary (Stand By / Destination) servers. The Target Database is in a standby or no-recovery mode on the secondary server(s) which allows subsequent transaction logs to be backed up on the primary and shipped (or copied) to the secondary servers and then applied (restored) there.
Permissions
To setup a log-shipping you must have sysadmin rights on the server.Minimum Requirements
- SQL Server 2005 or later
- Standard, Workgroup or Enterprise editions must be installed on all server instances involved in log shipping.
- The servers involved in log shipping should have the same case sensitivity settings.
- The database must use the full recovery or bulk-logged recovery model
- A shared folder for copying T-Log backup files
- SQL Server Agent Service must be configured properly
Steps to Configure Log-Shipping:
1. Make sure your database is in full or bulk-logged recovery model. You can change the database recovery model using the below query. You can check the database recovery model by querying sys.databases
SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'jugal'
USE [master]
GO
ALTER DATABASE [jugal] SET RECOVERY FULL WITH NO_WAIT
GO
2. On the primary server, right click on the database in SSMS and select Properties. Then select the Transaction Log Shipping Page. Check the "Enable this as primary database in a log shipping configuration" check box.USE [master]
GO
ALTER DATABASE [jugal] SET RECOVERY FULL WITH NO_WAIT
GO
Initialize Secondary Database tab
In this step you can specify how to create the data on the secondary server. You have three options: create a backup and restore it, use an existing backup and restore or do nothing because you have manually restored the database and have put it into the correct state to receive additional backups.Copy Files Tab
In this tab you have to specify the path of the Destination Shared Folder where the Log Shipping Copy job will copy the T-Log backup files. This step will create the Copy job on the secondary server.Restore Transaction Log Tab
Here you have to specify the database restoring state information and restore schedule. This will create the restore job on the secondary server.Next Steps
- As Log Shipping does not support automatic failover, plan for some down time and a manual failover
- Once you failover,
- For VLDBs it is recommended that you manually restore the database instead of using the wizard to create the full backup.
No comments:
Post a Comment