Book Image

Professional SQL Server High Availability and Disaster Recovery

By : Ahmad Osama
Book Image

Professional SQL Server High Availability and Disaster Recovery

By: Ahmad Osama

Overview of this book

Professional SQL Server High Availability and Disaster Recovery explains the high availability and disaster recovery technologies available in SQL Server: Replication, AlwaysOn, and Log Shipping. You’ll learn what they are, how to monitor them, and how to troubleshoot any related problems. You will be introduced to the availability groups of AlwaysOn and learn how to configure them to extend your database mirroring. Through this book, you will be able to explore the technical implementations of high availability and disaster recovery technologies that you can use when you create a highly available infrastructure, including hybrid topologies. Note that this course does not cover SQL Server Failover Cluster Installation with shared storage. By the end of the book, you’ll be equipped with all that you need to know to develop robust and high performance infrastructure.
Table of Contents (9 chapters)
Professional SQL Server High Availability and Disaster Recovery
Preface

Troubleshooting Common Log Shipping Issues


In this section, we'll look at few of the common problems that can occur in a log shipping environment and their solutions.

Exercise 70: Problem 1 – Middle of a Restore Error

Consider the following error:

Msg 927, Level 14, State 6, Line 9
Database 'Sales' cannot be opened. It is in the middle of a restore.

This issue occurs when the log shipping is configured in Standby mode with the Disconnect users at restore operation option enabled.

When a user transaction tries to read from the Standby secondary database, and at that time the restore job is restoring the transaction log, the user transaction terminates with this error.

Setup

To simulate the error, follow these steps:

  1. Execute the following query to change the database state of the Sales database at the secondary DPLHA, from NoRecovery to Standby mode. The query is the same as mentioned in the Changing the Database State at the Secondary section:

    -- To be run at the secondary - DPLHA
    -- Get the restore...