Thursday 17 April 2014

Enabling Log Shipping in SQL Server 2008 R2

Introduction

SQL Server Log Shipping allow to transfer data from one database to a lot of databases. So in Log Shipping we have 3 servers
  1. Primary
  2. Secondary
  3. Monitor (Optional)
*The secondary database can be more than one database.

Log Shipping involves copying a database backup and subsequent transaction log backups from the primary server and restoring the database and transaction log backups on one or more secondary servers

Steps

Create a folder in primary server (LogShipping_Primary) and also in secondary server (LogShipping_Secondary).This two folders must be sharing.

Take full and transaction log backup from the database in the primary Server

Restore this database on secondary server with stand by option.logShippingDB after Restore

On primary server right click >> properties >> Transaction Log Shipping >> Enable Log Shipping
Enable Log Shipping

Configure the backup setting for the transactional log backups
PrimaryServer backup path

  • Network backup path folder: the folder name LogShipping_Primary in primary server put the network path for this folder \\Servername\Foldername
  • Local path: the local path for the folder in primary server like C:\users\DBA\Desktop\LogShipping_Primary
Configure Scheduled job to backup database

4

Add Secondary Server

Add Secondry Server

Connect to select your secondary server

6

Select Secondry Server


Initialize Secondary Database
  • If you want to take full backup and restore it to the secondary server.
  • If you want to restore the existing backup from primary server to secondary server.
  • if you have manually restored the database on secondary server.
Copy Files
In this table you will put the path if the folder in the secondary server \\Servername\\Foldername

Copy Files

Configure the schedule to take the backup files copy from the primary server  to secondary server

10- Configure the Sehedule to take the backup

Restore transactional log : we will select Standby option and Disconnect all user in restore option

Restore transaction log

Configure the schedule to restore the backup taken from the primary server

12
Click OK

Optional (Check on monitor sever instance to monitor the backup status and the job status for the jobs in primary server and secondary server)

Configure the Sehedule to restore the backup

14

Last step in Log Shipping Configuration

Finish

After you finish from the Log Shipping go to the Primary Server to Check the new jobs

16

Return to the secondary server to check the new jobs

17

Note: Check the functionality of Log Shipping by executing all the SQL Jobs which have been scheduled during log shipping. All the jobs should execute successfully.

SQL Server Query Execution Plans for beginners – Clustered Index Operators

In this article we will continue discussing the various execution plan operators related to clustered indexes and what they do, when do the...