Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Professional SQL Server High Availability and Disaster Recovery

You're reading from   Professional SQL Server High Availability and Disaster Recovery Implement tried-and-true high availability and disaster recovery solutions with SQL Server

Arrow left icon
Product type Paperback
Published in Jan 2019
Publisher Packt
ISBN-13 9781789802597
Length 564 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Ahmad Osama Ahmad Osama
Author Profile Icon Ahmad Osama
Ahmad Osama
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Professional SQL Server High Availability and Disaster Recovery
Preface
1. Getting Started with SQL Server HA and DR 2. Transactional Replication FREE CHAPTER 3. Monitoring Transactional Replication 4. AlwaysOn Availability Groups 5. Managing AlwaysOn Availability Groups 6. Configuring and Managing Log Shipping Appendix

Troubleshooting AlwaysOn Availability Groups


In this section, we'll look at some of the common AlwaysOn AG problems and their solutions.

Exercise 58: Problem 1 - DDL Queries Block the Redo Thread on the Secondary Replica

This is one of the most common issues you can come across in an AlwaysOn AG environment: the DDL queries on the primary replica block the redo thread on the secondary replica.

Setup

To simulate the problem, follow these steps:

Solution

  1. Navigate to the C:\Code\Lesson05 folder and open 3_CreateTableOrders.sql in SSMS. Connect to the DPLPR instance and execute this query:

    -- To be executed at DPLPR
    -- Creates a sample Orders table and populates it with dummy data
    USE Sales
    GO
    DROP TABLE IF EXISTS Orders
    GO
    CREATE TABLE Orders
    (
      OrderID int identity, 
      OrderQty int,
      Price int,
      [Description] varchar(100)
    )
    GO
    WITH cte0 AS (SELECT 0 g UNION ALL SELECT 0)
        ,cte1 AS (SELECT 0 g FROM cte0 a CROSS JOIN cte0 b) 
        ,cte2 AS (SELECT 0 g FROM cte1 a CROSS JOIN cte1 b) 
        ,cte3...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image