Alwayson -- SYS. dm_hadr_instance_node_map returns NULL.

Source: Internet
Author: User
Tags failover

 

 

 

The following is msdn's explanation of SYS. dm_hadr_instance_node_map.

For every instance of SQL Server that hosts an availability replica that is joined to its alwayson availability group, returns the name of the Windows Server failover clustering (wsfc) node that hosts the server instance. this dynamic management view has the following uses:

• This dynamic management view is useful for detecting an availability group with multiple availability replicas that are hosted on the same wsfc node, which is an unsupported configuration that cocould occur after an FCI failover if the availability group is incorrectly configured. for more information, see failover clustering and alwayson availability groups (SQL Server ).

 

• When multiple SQL Server instances are hosted on the same wsfc node, the resource DLL uses this dynamic management view to determine the instance of SQL Server to connect.

 

 

For example

Env

===

Nodes:

Sql1_w2k8r21

Sql1_w2k8r22

Sql1_w2k8r23

 

Default instance

SQL Server 2012 SP1 RTM

 

Availability group: agtest1 and agtest2

 

Agtest1:

Sql1_w2k8r21

Sql1_w2k8r22

 

Sql1_w2k8r23

 

Agtest2:

Sql1_w2k8r21

Sql1_w2k8r22

 

The returned value of SYS. dm_hadr_instance_node_map is as follows:

The corresponding ag_resource_id can be found in SYS. dm_hadr_name_id_map.

 

 

Dmv sys. dm_hadr_instance_node_map will be taken from the registry below

 

 

If your DMV returns NULL, check the registry HKEY_LOCAL_MACHINE \ cluster \ hadragnametoidmap. If the legacy/orphan key value exists, delete it. Back up data in case of any problems.

 

Then run dmv again.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.