Solved

Determining  Availability Group active/passive nodes in SQL Server 2012

Posted on 2016-11-10
2
31 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 28

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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.

815 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

11 Experts available now in Live!

Get 1:1 Help Now