AlwaysON DashBoard says the database is primary role, but dm_hadr_availability_replica_state s

Hello,

I am confused now, DashBoard says the database on instance A is primary role, but the dm_hadr_availability_replica_states doesn't agree this.

Is it a bug or something else? I didn't find error in log.

SQL Server version is:

Microsoft SQL Server 2014 - 12.0.2456.0 (X64) 
Dec 11 2014 17:32:03 
Copyright (c) Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: )

March 29th, 2015 9:22pm

did you refresh your dashboard? please refresh the dashboard. 

check this http://www.sqlskills.com/blogs/joe/answering-questions-with-the-alwayson-dashboard/

run this code on each instance and see if which is primary

IF SERVERPROPERTY ('IsHadrEnabled') = 1
BEGIN
SELECT
   AGC.name -- Availability Group
 , RCS.replica_server_name -- SQL cluster node name
 , ARS.role_desc  -- Replica Role
 , AGL.dns_name  -- Listener Name
FROM
 sys.availability_groups_cluster AS AGC
  INNER JOIN sys.dm_hadr_availability_replica_cluster_states AS RCS
   ON
    RCS.group_id = AGC.group_id
  INNER JOIN sys.dm_hadr_availability_replica_states AS 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'
END

code from here http://www.mssqltips.com/sqlservertip/3206/finding-primary-replicas-for-sql-server-2012-alwayson-availability-groups-with-powershell/

Free Windows Admin Tool Kit Click here and download it now
March 29th, 2015 9:46pm

my bad, the replica id should be different.
March 29th, 2015 9:58pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics