Solved

Determining  Availability Group active/passive nodes in SQL Server 2012

Posted on 2016-11-10
2
20 Views
Last Modified: 2016-11-10
Heyas,

If I have Availability Group setup with 2 nodes, how do I check which node is the active one and which is passive via the GUI?

Also are their SQL queries for this?

Thank you.
0
Comment
Question by:Zack
2 Comments
 
LVL 18

Accepted Solution

by:
Pawan Kumar Khowal earned 500 total points
ID: 41883284
Try

SELECT
   AGC.name [AvailabilityGroup],RCS.replica_server_name [SQL cluster node name], ARS.role_desc [Replica Role] , AGL.dns_name [Listener Name]
FROM
 sys.availability_groups_cluster agc INNER JOIN sys.dm_hadr_availability_replica_cluster_states rcs
   ON RCS.group_id = AGC.group_id INNER JOIN sys.dm_hadr_availability_replica_states ars
   ON  ARS.replica_id = RCS.replica_id
  INNER JOIN sys.availability_group_listeners AS AGL
   ON AGL.group_id = ARS.group_id
WHERE
 ARS.role_desc = 'PRIMARY'

Open in new window

0
 

Author Closing Comment

by:Zack
ID: 41883336
Thank you for your help.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now