SQL Server High Availability

Ensuring business continuity with robust solutions

SQL Server Log Shipping

Log shipping is a disaster recovery solution that allows you to automatically send transaction log backups from one or more primary databases to a set of secondary databases. This mechanism enables you to keep secondary databases in a warm standby or cold standby state, ready to be brought online if the primary database becomes unavailable.

It's a cost-effective and relatively simple method for ensuring data redundancy and a quick recovery point objective (RPO) without requiring complex infrastructure.

Key Benefits of Log Shipping

Implementing Log Shipping

Setting up log shipping involves several key components and steps:

1. Primary Database Configuration

Ensure your primary database is in the FULL recovery model and has regular transaction log backups scheduled.

2. Backup Share and Permissions

Create a network share where transaction log backups will be copied. Ensure the SQL Server service accounts have appropriate read/write permissions.

3. Copy Jobs

Configure a SQL Server Agent job on the primary server to copy the transaction log backups from the primary server's backup directory to the network share.

4. Restore Jobs

On each secondary server, configure SQL Server Agent jobs to restore the copied transaction log backups to the secondary databases.

5. Monitoring

Implement a robust monitoring strategy to ensure backups are taken, copied, and restored successfully. SQL Server Management Studio (SSMS) provides built-in log shipping monitoring tools.

Core Components:

Example Configuration Steps (using SSMS):

  1. Right-click the primary database, select Tasks > Ship Transaction Log.
  2. In the Log Shipping dialog, click Add to configure a secondary.
  3. Specify the Secondary server instance and Secondary database name.
  4. Configure the Backup settings (backup share path, schedule).
  5. Configure the Copy settings (destination folder on secondary, schedule).
  6. Configure the Restore settings (restore in NORECOVERY or STANDBY mode, schedule).
  7. Repeat for additional secondaries.
  8. Enable log shipping.

Important Considerations

While log shipping is excellent for disaster recovery, for higher availability scenarios with automatic failover, consider exploring Always On Availability Groups.