Log Shipping
Log Shipping
Log Shipping
Log-Shipping
Sal Cincotta
Senior Technology Specialist - MCSD
Microsoft
Agenda
What is Log-Shipping?
Log-Shipping is one of several pieces
to an underlying high availability
solution.
Enables corporations to protect
against natural disasters, regional
power failures, terrorism, etc.
Uses the transaction log to track
changes.
When to use.
Designed as an inexpensive
alternative to clustering.
Use to protect against site level
disasters.
Use to offload query processing to
another server. (Some dos and don'ts here)
Prerequisites
VERY IMPORTANT!!!
This is one piece of the puzzle. Do not
underestimate the importance of a sound plan
around availability and fault tolerance.
Its about preventing downtime what does that
downtime cost?
Database Backups. (recover from application or user errors)
SLAs: How long will it take to recover? Backup
to disk or tape? How often? Are you using a run
book?
Continued
Prerequisites
Redundant Components
Power supplies
Fans
Controller Cards
STORAGE SUBSYSTEM
Architecture
EE contains built in support for LogShipping, whereas SE requires a
more complex and custom
implementation.
The architecture consists of:
Primary Server
Standby Servers
Monitoring Server
Architecture
(cont.)
Primary Server:
contains your primary database.
SS makes periodic transaction log
backups to capture changes.
Architecture
(cont.)
Standby Server:
Are servers running a licensed copy of
SQL Server.
Contain an unrecovered copy of the
production database.
The standby server can be recovered and
replace the primary server if it fails or
must be taken offline for maintenance.
One standby server can contain standby
databases from multiple primary servers.
Architecture
(cont.)
Monitoring Server:
Is a server running a licensed copy of SQL
Server.
Monitors the status of the log-shipping jobs on
the primary and each standby server.
Should use a server other than the primary or
the standby to detect problems on either server.
One monitoring server can monitor multiple
primary-standby server pairs.
Architecture
(cont.)
Architecture
(cont.)
Jobs include:
Architecture
(cont.)
Architecture
(cont.)
Architecture
(cont.)
Architecture
(cont.)
Architecture
(cont.)
Backup Alert:
Runs on the monitoring server and
monitors the success or failure of the
backup jobs on the primary.
Set the threshold for alerting an
administrator to allow for large backups.
Architecture
(cont.)
Architecture
(cont.)
Architecture
(cont.)
Objects to copy:
Server Logins
Use dts and the transfer login task
Backup the sysxlogins table using the BCP
utility to capture server-level logins.
Store the backup file on each of the
standby servers.
Be sure to update these whenever a change
has been made.
Continued
Architecture
(cont.)
Other DB Objects:
Use t-sql to recreate all jobs, alerts, and
user-defined error messages. Run these
scripts on each of the standby servers.
Update these as objects change.
DTS Packages:
Store a copy of each dts package on
each of the standby servers.
Update the copy of each package as
changes are made.
Architecture
(cont.)
Architecture
(cont.)
Ports:
The following ports must remain open if
going through a firewall:
Port 1433 must remain open for SQL to
communicate back and forth.
Port 135 required for SQL Agent to copy
backup files to the shared folder on the
standby server.
Ports 137, 138, and 139 or 445 required
to use UNC shares.
Architecture
(cont.)
Architecture
(cont.)
Architecture
(cont.)
Advantages
Hardware requirement does not
require certified hardware like MSCS.
Software requirement can use
Standard Edition for manual setup.
Less network traffic than replication.
Site Protection protect against
catastrophic site disaster.
Offload query processing.
Disadvantages / Limitations
Manual detection and role change.
Required objects and files must be
kept in sync.
Dual purposes vs. minimal latency.
Potential transaction loss.
Lack of transparency to clients.
Log-Shipping
Demo:
Setting Up and Monitoring
Log-Shipping
Final Steps
Create and execute a sync login job
Must sync syslogins table when initial log
ship is complete and when changes are
made
More Information
Support Web Site:
support.microsoft.com
search on log-shipping
Books:
Patterns and Practices: SQL Server 2000
High Availability Volume 1 and 2