The Result Data Newsletter   
Volume 806 - June 2008   
© Copyright 2008 Result Data Consulting, Ltd.  614-505-0770  www.resultdata.com   

    Result Data Home Page  |  Newsletter Archive  |  Upcoming Events  |  Classes & Workshops  |  Request Information
Upcoming Events:  Mid Ohio BusinessObjects User Group: 8/6

Return to Newsletter Contents...

 

SQL Server Log Shipping: A Great Database Alternative

by: Troy Gottfried, Sr. Consultant, CRCP, BECP

Many organizations have a great need for reporting on data stored in their transactional systems, but cannot risk harming their production database environment by building reports directly against it.  While an Operational Data Store is doubtless the better alternative, many opt to create a backup/restore schedule of their transactional system for their reporting needs.  In this example, the production database is backed up on a predetermined schedule, and that database is then restored to a separate server where reports will run against it.

In SQL Server 2005 (or any other platform, for that matter) this solution has several drawbacks.  First, if the backup/restore job does not first gain exclusive access to the destination, the restore may very well fail.  For example, if the restore is scheduled for 11:30pm, but someone is already running reports against yesterday’s version of that database, the new backup cannot restore over top of it.  It would first have to gain exclusive access by killing all existing connections.

The second major drawback is one of ‘stale data.’  In those scenarios where someone needs a report run against today’s data, someone will either need to manually backup and restore the database again, or may elect to point the report at the production system for a quick ‘one-off’ against live data.

SQL Server 2005 offers a much more versatile alternative:  log shipping.  Log shipping didn’t first appear in SQL Server 2005, but it is now offered in more editions than it was with SQL Server 2000.  At a high level, log shipping requires a source and a destination, just like a backup/restore scenario.  However, in the case of log shipping, a time interval is determined by which the source system will copy and ‘ship’ its transaction logs to the destination database.  The job is then configured for a lag:  That is, if the destination system should wait a number of minutes before applying the transaction log.  Once the file appears in the specified directory, and the lag-time is over, the destination database will apply the transaction logs from the source database.  The destination database is required to be in a read-only state for the logs to be applied.

The log-shipping methodology offers several advantages.  First, the data is much more current as transaction logs can be applied at any specified interval, rather than once or twice per day.  Secondly, the issue of exclusive access can be accommodated in one of two ways:  (1) Configure the job to kill existing connections before applying logs, or (2) Allow transaction logs to collect until exclusive access can be gained, in which case it will apply all transaction logs from the last one it missed to the latest.  This keeps the database functional for reporting throughout the day, while still allowing for transaction logs to be shipped and applied.  These transaction logs can be stored for an indefinite period of time, or they can be systematically deleted once they reach a certain age.

The final major advantage of log shipping is that of having a ‘warm-standby’ version of the production database.  In the event of a failure on the production database, a couple of SQL statements can convert the read-only secondary database into the primary database, and vice versa.  In other words, you can quickly reverse the log shipping and point your application to the standby database to keep working while the production system is fixed.

Go to Top  |  Return to Newsletter Contents

The Result Data Newsletter is published approximately once a month to share the latest information on business intelligence, data management and CRM. There should be a link below to allow you to change or remove yourself from our list. We take your requests very seriously. If you have any difficulty please contact us at 614-505-0770 and we will make sure that your request is handled properly. This is not intended to be an unsolicited message and you can reach us in person if needed.

© Copyright 2007 Result Data Consulting, Ltd. - All Rights Reserved
All trademarks and copyrights are the property of their respective owners. This information is provided without warranty.
Announcements
Save Big $$ On Gas This Summer!
Schedule and attend any one of our qualifying public training classes from July through September 30th to receive up to $385 in gas cards OR  receive 10% off the normal class price.  Please contact our office for further details on promotion amounts and qualifying classes.   Restrictions apply and you must mention the promotional code Gas08 at the time of registration to receive the promotion.  Call 614-505-0770 for further details and restrictions.
Coming Soon...Microsoft SharePoint Workshop
This two day hands-on workshop covers the most important concepts and topics surrounding how to use Microsoft SharePoint. It is appropriate for both users of Windows SharePoint Services 3.0 (WSS) and Microsoft Office SharePoint Services 2007 (MOSS). Call 614-505-0770 or click here for more information and to reserve your seat.
Mid Ohio BusinessObjects User Group
Join us for the Spring MOBOUG User Group meeting on August 6th. Call 614-505-0770 or click here for more information and to reserve your seat.
Looking for a Few Good Men and Women
Join our award winning team of Business Intelligence consultants and .Net Software developers.
Send your resume and salary requirements to:
jobs@resultdata.com