SQL Server Interview Questions for SQL DBAs
What is a Listener?
A Listener (sometimes referred to as the Virtual Network Name [VNN]) functions similarly to the network name and IP addresses created when setting up a Failover Cluster Instance (FCI). Instead of directly connecting to the nodes, you connect to the Listener’s name or IP. This simplifies connectivity, allowing applications and end-users to only focus on a single entry point.
Is there one Listener per Windows Server Failover Cluster (WSFC)?
No, a Listener is dedicated to a single Availability Group (AG). Different AGs cannot share a Listener. However, a single WSFC can have multiple Listeners, each one tied to a different AG.
Do Availability Groups (AGs) require a WSFC?
Yes, AGs are dependent on a Windows Server Failover Cluster (WSFC) for their operation.
Why do I need a WSFC when Database Mirroring (DBM) didn’t?
The WSFC serves two main purposes: quorum and the Listener. With DBM, the Witness instance handled quorum manually, while AGs use the built-in, reliable quorum mechanism of the operating system. More on the Listener in the next questions.
What edition of Windows do I need for WSFC?
To deploy a WSFC, you’ll need the Enterprise Edition of Windows Server. While the cost of the Enterprise Edition might be higher than other editions (like Standard), SQL Server deployment costs tend to outweigh Windows licensing costs.
Do all my WSFC nodes need to be part of the same domain?
Yes, all nodes in a WSFC must be in the same domain. This can be a major change if you are migrating from setups like log shipping or DBM where instances may not be in the same domain.
Does a WSFC require shared storage?
No. Unlike FCIs, AGs do not require shared storage. You can deploy AGs on standalone SQL Server installations without the need for shared storage. FCIs do require shared storage, though, and combining FCIs with AGs would require shared storage as well.
Does the WSFC have to be on physical hardware?
No. You can run the entire WSFC on virtual machines (VMs), as long as the setup meets the supportability requirements outlined in official SQL Server documentation.
Do I need Active Directory (AD) for a WSFC?
Yes. AD is necessary for a WSFC, as it manages cluster objects and ensures integration with DNS. Not all organizations use AD, especially those that primarily run non-Microsoft software, but it is crucial for the functionality of a WSFC.
Do I need physical hardware to implement AGs?
No. AGs can be implemented on virtual machines as long as the WSFC setup is supported by SQL Server and meets all the requirements.
Can I upgrade from DBM or Log Shipping to an AG?
Yes, it’s possible to migrate from DBM or log shipping to an AG. You can create the WSFC after SQL Server is installed, even during an upgrade (e.g., from SQL Server 2005/2008 to 2012). Just ensure your underlying configuration is compatible with WSFC requirements.
Can I put AD on one of my cluster nodes if I don’t have AD elsewhere?
No. A cluster node cannot also be a domain controller. SQL Server flags this during setup, and it is unsupported.
What edition of SQL Server is required to deploy an AG?
You need SQL Server 2012 Enterprise Edition to implement an AG. Unlike DBM, there’s no “limited” version of AGs available in the Standard Edition.
Can I deploy an AG using Windows Server Core?
Yes, AGs are supported on Windows Server Core as well as full UI setups. However, with Windows Server 2008 R2 SP1, you must choose between Server Core and full UI; mixing them is not supported.
Is planning for and deploying an AG easy?
It depends. Some setups are straightforward, while others can be more complex. There may be challenges to consider when planning your architecture, but having a solid understanding of both SQL Server and Windows Failover Clusters will help.
How important is quorum in an AG setup?
Quorum is essential for AGs. As a DBA, it’s important to understand the concept of quorum and how it affects failover and cluster health. If quorum is lost, your entire cluster will be down, regardless of how many instances of SQL Server are running.
Can I use secondary replicas for read-only queries or backups?
Yes. You can configure your replicas for read-only queries and backups without extra configuration. Backups made from replicas must use the COPY_ONLY option.
How do readable replicas work?
Readable replicas use snapshot isolation to minimize blocking for write transactions. It’s crucial to have sufficient resources and disk I/O to handle read-only queries effectively on these replicas.
Will AGs fix performance issues related to synchronous mirroring from DBM?
If you’ve faced performance issues with DBM, especially around synchronous mirroring, AGs may not solve the problem. Proper architecture is essential to handle high I/O and network throughput in both DBM and AG setups.
Can I combine FCIs and AGs in a synchronous setup?
Yes, but automatic failover isn’t possible with this combination. You can have FCIs paired with AGs, though there are additional considerations regarding storage and quorum.
Can an AG have multiple databases?
Yes, a single AG can include multiple databases, just like a folder containing files. This allows better management and failover of related databases.
Can databases in an AG span multiple instances?
No. All databases within a single AG must reside in the same instance. You cannot place a database from Instance_1 and Instance_2 into the same AG.
Are distributed transactions supported in an AG?
No. Distributed transactions, like in DBM and log shipping, are not supported in AGs.
Are databases in an AG kept in sync?
Not exactly. While the databases in an AG will fail over together, each database's replication or mirroring process operates independently. You’ll need to monitor their replication status individually.
Can a database participate in multiple AGs?
No. A database can only belong to one AG at a time.
Do I need to worry about logins and SQL Server Agent jobs with AGs?
Yes. AGs only protect databases, so you still need to plan for logins, SQL Server Agent jobs, and other external configurations. Using contained databases in SQL Server 2012 can help address some login concerns.
How will AGs affect my SQL Server licensing?
Licensing will depend on your specific configuration. It's important to consult with your SQL Server licensing representative or Microsoft directly for guidance on how AGs will impact your costs.
Is HADRON the same as an AG?
HADRON was an early codename for Availability Groups. It may also be referred to as HADR (High Availability Disaster Recovery), especially in DMVs.
Is AlwaysOn the same as an AG?
No, AlwaysOn is a term that covers both FCIs and AGs in SQL Server 2012. It’s not exclusive to AGs, although it was initially used for that purpose during development.
Do AGs replace FCIs?
No, AGs and FCIs serve different purposes, and one does not replace the other. For more details, check out our earlier discussions on this topic.
Is Database Mirroring (DBM) going away?
Yes, DBM has been deprecated in SQL Server 2012. However, it’s not disappearing immediately—existing DBM setups will still function, but new implementations should focus on AGs.