Press "Enter" to skip to content

A Primer on Contained Availability Groups

Dualcore DBA tries out contained Availability Groups:

Contained Availability Groups look to solve a long-standing issue in SQL Server HA/DR solutions, which is that most of them (Mirroring / Log Shipping / Availability Groups) work at the database level but there can be and often are server-level objects on which that database depends. Classic examples of such server-level dependencies are (but not limited to) logins and agent jobs. These server-level objects need to exist on all the HA/DR nodes as well as requiring careful management (matching SIDs and passwords for logins) and careful configuration (agent jobs that only run when the node is primary etc).

In the case of SQL Server logins, these exist in the master database, which is responsible for all server-level configuration and metadata. In the case of agent jobs, these are stored in the msdb system database, which is responsible for everything SQL Server Agent related (as well as storing backup history, database mail configuration etc). As both of these system databases do not get replicated in HADR scenarios, there is the need for manual synchronisation of objects.

Both instances we will work with in this demo are on SQL Server 2022 Developer Edition and so benefit from Enterprise Edition features. Contained Availability Groups are an Enterprise Edition feature.

Click through for the demo on how to set one up and where you might run into trouble.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.