Solved

Determining  Availability Group active/passive nodes in SQL Server 2012

Posted on 2016-11-10
2
55 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
Pawan Kumar 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

690 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