Click here to Skip to main content
6,595,444 members and growing! (17,217 online)
Email Password   helpLost your password?
Database » Database » SQL Server License: The Code Project Open License (CPOL)

An Overview of Log Shipping in SQL Server 2005

By Abhijit Jana

Overview of Log Shipping in SQL Server 2005
SQL 2005, DBA
Posted:25 Oct 2008
Views:13,895
Bookmarked:15 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
15 votes for this article.
Popularity: 5.20 Rating: 4.42 out of 5
2 votes, 13.3%
1
1 vote, 6.7%
2

3

4
12 votes, 80.0%
5

Table of Contents

  • Introduction
  • What is Log Shipping?
  • Component of Log Shipping
  • Log Shipping Prerequisites
  • SQL Server 2005 Version that Supports Log Shipping

Introduction

For distributed database application environment, it is always required to synchronize different database servers, back up, copy Transaction Logs, etc. If we are going to implement using application we have to put lots of efforts to build up the application. SQL Server 2005 provides an advanced feature called Log Shipping. Log shipping is an Automated Process for backing up, restoring, copying the transaction logs and synchronizing the database for distributed database server application which can improve the application performance and availability of database. In my recent project, I have done some short of experiment on it. I am going to explain it in this article.

What is Log Shipping?

Log Shipping is used to synchronize the Distributed Database Server. Synchronize the database by copying Transaction logs, Backing up, Restoring data. SQL Server used SQL Server Job Agents for making those processes automatic. Log Shipping does not involve automatic transfer of server if there is any failure. This means it has just synchronized the databases but if the primary server fails, it will not redirect your application to a secondary server. This has to be done manually.

The main functions of Log Shipping are as follows:

  • Backing up the transaction log of the primary database
  • Copying the transaction log backup to each secondary server
  • Restoring the transaction log backup on the secondary database

Components of Log Shipping

For implementing Log Shipping, we need the following components - Primary Database Server, Secondary Database Server, and Monitor Server.

  • Primary Database Server: Primary Sever is the Main Database Server or SQL Server Database Engine , which is being accessed by the application. Primary Server contains the Primary Database or Master Database.

  • Secondary Database Server: Secondary Database Server is a SQL Server Database Engine or a different Server that contains the backup of primary database. We can have multiple secondary severs based on business requirements.

  • Monitor Server: Monitor Server is a SQL Server Database Engine which Track the Log Shipping process.

Log_Sh2.jpg

Figure 1: Log Shipping Database Server Configuration

We can have different SQL Servers for each of these servers or we can use a single server for these three. In my example, I have used a single server for these three.

You can start Log Shipping by Right Click on Database >Properties >Transaction Log Shipping > Select Check Box, and Configure your settings.

Setting1.JPG

Figure 2: Enable Log Shipping

Use the following settings for more configurations:

Log_Sh1.jpg

Figure 3: Transaction Log Backup Settings for Primary Server

Configure Secondary Server:

setting3.JPG

Figure 4: Settings for Secondary Server

Log Shipping Prerequisites

  • Must have at least two Database Servers or two SQL Server 2005 Database Engines.
  • Configuration user should have Admin privilege on that server
  • SQL Server Agent Service Configured properly
  • Configuration mode of Primary database should be a Full or Bulk Logged recovery model.
  • Shared folder for copying the transaction logs.

SQL Server 2005 Version that Supports Log Shipping

SQL Server 2005 Version Available
SQL Server 2005 Enterprise Edition Yes
SQL Server 2005 Workgroup Edition Yes
SQL Server 2000 Standard Edition Yes
SQL Server 2005 Developer Edition Yes
SQL Server 2005 Express Edition No

Reference

History

  • Written on 25th October, 2008

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Abhijit Jana


Member
Abhijit has done Master Degree in Computer Application from Heritage Institute of Technology (HIT-K) ,Kolkata, West Bengal, India . He is an interested, committed, creative Software professional having more than 2.8 years of solid experience in web-based and windows based solutions in Microsoft Technologies using .NET 2.0, .NET 3.0 , .NET 3.5, ASP.NET 2.0, ASP.NET 3.5 C# 2.0, AJAX, Silverlight, Web Services, MS SQL Server 2005, Exchange Server, Active Directory, and Dot Net Nuke (DNN),Win Forms, WinServices, WSS (Windows Sharepoint Server 3.0 ), WPF, WWF. He is also an MCP (Microsoft Certified Professional) and MCTS (Microsoft Certified Technology Specialist) on Web Development. He has good knowledge of Object Oriented Programming, 3-Tier Architecture and Design Patterns as well as good command over IIS (IIS 5.1,IIS 6.0, IIS 7.0) and deployment of Application on Live Production Environment . His hobbies, listing to music and Developing Own small Tools Utilities and Knowledge sharing.


Awards
CodeProject MVP 2009
Prize winner "Best ASP.NET article of Sep 2009
Prize winner "Best ASP.NET article of July 2009
Prize winner "Best ASP.NET article of June 2009"
Prize winner "Best ASP.NET article of January 2009"
Prize winner "Best ASP.NET article of November 2008"

Prize winner "Best ASP.NET article of October 2008"

Abhijit's CodeProject Guru :

Occupation: Software Developer
Location: India India

Other popular Database articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 5 of 5 (Total in Forum: 5) (Refresh)FirstPrevNext
Generalmore powerful log shipping Pinmemberitayl22:56 28 May '09  
GeneralRe: more powerful log shipping PinmvpAbhijit Jana21:44 1 Jun '09  
GeneralNice article PinmemberBrij3:58 23 Dec '08  
GeneralDo not mind Pinmemberslemaryino21:41 25 Oct '08  
GeneralRe: Do not mind PinmemberAbhijit Jana19:06 26 Oct '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 25 Oct 2008
Editor: Deeksha Shenoy
Copyright 2008 by Abhijit Jana
Everything else Copyright © CodeProject, 1999-2009
Web15 | Advertise on the Code Project