Press "Enter" to skip to content

Category: Availability Groups

VS Code Extension for Availability Group Read-Only Routing

Denny Cherry announces an extension:


Microsoft introduced Read-Only Routing to Always On Availability Groups many versions of SQL Server ago. However, Microsoft never added any sort of UI to SQL Server Management Studio. Years ago, DCAC released a Windows application to manage your Read-Only Routing configuration. We’ve converted our Windows application into a VS Code extension called SQL Always On Read-Only Routing Configuration, which you can download from the website or via VS Code.

Click through to learn a bit more about the extension. You can also view it in the VS Code Marketplace.

Leave a Comment

Things to Watch with Contained Availability Groups

John Morehouse keeps one eye on things:

Contained availability groups solve some real operational problems, especially around logins, jobs, permissions, and supporting metadata. They can reduce drift between replicas and make failover cleaner.

That does not mean they are magic.

Like most SQL Server features, contained availability groups come with details that matter. The feature can absolutely help, but it needs to be designed, tested, and operated with the right expectations.

Click through for several things you should consider before jumping into deploying contained AGs.

Leave a Comment

Jobs and Security Objects in Contained Availability Groups

John Morehouse moves some assets between availability group replicas:

In the first post, I introduced contained availability groups and how they bring contained versions of master and msdb along with the Availability Group. That matters because many applications depend on more than just user databases.

Two of the biggest wins are SQL Agent jobs and security objects.

Click through to see how they work.

Leave a Comment

An Introduction to Contained Availability Groups

John Morehouse takes us through contained availability groups:

Availability Groups have been one of the best high availability and disaster recovery options in SQL Server for a long time. They let us move a group of user databases together, keep replicas synchronized, offload some read-only workloads, and give applications a listener instead of a single server name.

That works great until the application needs more than just the user databases.

What about the logins? SQL Agent jobs? Permissions? Objects that live in master or msdb? In a traditional Availability Group, those objects are still tied to each SQL Server instance. That means DBAs have to keep them synchronized manually across replicas. Miss one login, job, credential, or permission and the failover might technically succeed while the application still has a very bad day.

Read on to see how contained availability groups can help resolve these problems.

Comments closed

Unplanned Failover and SQL Server on Kubernetes

Anthony Nocentino performs additional testing:

In my planned failover walkthrough, I showed what happens when you deliberately move the primary role to another replica. That’s the easy case. Now I want to show what happens when the primary pod just disappears unexpectedly, like during a node failure or a container crash. No graceful shutdown, no demotion, just gone.

I ran two test scenarios, each cycling the primary role across all three pods by force-deleting the current primary three times in a row. First, a 5GB TPC-C database idle. Then, that same 5GB database under sustained HammerDB TPC-C load. Six force-deletes total, six successful automatic failovers. I’ll walk through the error log from the promoted replica, the operator’s detection and recovery behavior, and the full timing data.

Read on to see how Anthony’s SQL Server Kubernetes operator handles when things go bump in the night.

Comments closed

Planned Failover of Availability Groups on Kubernetes

Anthony Nocentino runs a test:

When building the sql-on-k8s-operator, I wanted to make sure it could handle both planned and unplanned failovers. The easy case is a planned failover, where you deliberately move the primary role to another replica. The harder case is an unplanned failover, where the primary pod just disappears. The operator needs to handle both.

I recently ran a full planned failover rotation on a three-replica SQL Server Availability Group managed by sql-on-k8s-operator, and I want to show you exactly what happens inside SQL Server and the operator during each hop. If you’ve been following my Introducing the SQL Server on Kubernetes Operator post, this is the logical next step: what does the error log actually look like during a planned failover, what does the operator do in response, and how long does the whole thing take?

I ran the same three-hop rotation twice: once with an idle 5GB database to establish a baseline, and once under a sustained TPC-C workload with HammerDB. In this post, I’ll walk through the SQL Server error log entries, the operator’s reconcile behavior, and the timing data for both runs. In the next blog post, I’ll show what happens during an unplanned failover. Let’s go.

Click through to see how it all works.

Comments closed

Fast Failover in SQL Server 2025

John Deardurff lays out some changes in SQL Server 2025:

A client requested a presentation discussing key improvements to Always On Availability Group fast failover in SQL Server 2025. I decided that a summary would be appropriate for a blog post. So, here I discuss Enhanced Telemetry, Persistent Health, and Intelligent Fast Failover 

John has a very positive take on fast failover. I haven’t tried any of this functionality, but some of this does sound promising.

Comments closed

Optimizing Planned Availability Group Failover in SQL Server

Aaron Bertrand shares some advice:

Shaving even a handful of seconds from the process can improve the application and end user experience; it can also drastically reduce alert noise or, at least, how long alerts have to stay muted. There’s a lot of material out there about performing AG failovers correctly (no data loss), but far less that focuses on shortening the disruption window. The difference is usually some combination of redo volume, checkpoint behavior, open transactions, and secondary readiness.

I wanted to share some techniques I use to make planned failovers faster and more predictable. Some of these techniques are well documented, while others come from real-world patterns I’ve observed across many SQL Server environments. I’ll talk about what I do before, during, and after the failover to minimize disruption and increase the chance that end users are oblivious that anything happened.

Aaron provides several tips to help reduce the pain of failover.

Comments closed

Migrating from a Contained Availability Group

Warren Departee undoes a problem:

A client was running a Contained Availability Group in SQL Server 2022, but wasn’t using the AG Listener for their application connections. This negated most of the benefits the Contained AG was designed to provide. They also had some security misunderstandings and missteps, as this was built for them without any real knowledge transfer – one of the reasons they reached out to us for help. After review, it became clear that there was no need for a contained AG here, so we helped them migrate to a Basic Availability Group (SQL Server Availability Group in SQL Server Standard Edition) while preserving their database configurations and minimizing downtime.

Read on for a step-by-step process and a few hints on configuration.

Comments closed

Thoughts on Creating Databases in Contained Availability Groups

Andreas Wolter digs into some updated functionality:

First of all: It’s always encouraging to see the Product team act on user feedback. SQL Server 2025 CU1 introduces an improvement that allows the creation and restoration of databases within contained availability groups (CAG). This is a step in the right direction, but as you’ll see, there are still some bumps to smooth out. Keep the feedback coming (here: Allow creation and restore of databases in contained availability group) — progress is happening, but we’re not quite there yet.

Read on for a litany of issues, as well as Andreas’s recommended solutions.

Comments closed