sys.dm_hadr_cluster_members (Transact-SQL)sys.dm_hadr_cluster_members (Transact-SQL)

適用範圍:Applies to: 是SQL ServerSQL Server (所有支援的版本) yesSQL ServerSQL Server (all supported versions) 是Azure SQL DatabaseAzure SQL DatabaseYesAzure SQL DatabaseAzure SQL Database適用範圍:Applies to: 是SQL ServerSQL Server (所有支援的版本) yesSQL ServerSQL Server (all supported versions) 是Azure SQL DatabaseAzure SQL DatabaseYesAzure SQL DatabaseAzure SQL Database

如果裝載已啟用 SQL ServerSQL ServerAlways On 可用性群組Always On availability groups 本機執行個體的 WSFC 節點有 WSFC 仲裁,則針對構成仲裁的每個成員及其狀態各傳回一個資料列。If the WSFC node that hosts a local instance of SQL ServerSQL Server that is enabled for Always On 可用性群組Always On availability groups has WSFC quorum, returns a row for each of the members that constitute the quorum and the state of each of them. 這包括叢集中的所有節點, (Clusterenum 函式所傳回的 CLUSTER_ENUM_NODE 類型) 和磁片或檔案共用見證(如果有的話)。This includes of all nodes in the cluster (returned with CLUSTER_ENUM_NODE type by the Clusterenum function) and the disk or file-share witness, if any. 針對給定成員傳回的資料列包含有關該成員之狀態的資訊。The row returned for a given member contains information about the state of that member. 例如,針對具有多數節點仲裁的五個節點叢集,其中一個節點已關閉,當 sys.dm_hadr_cluster_members 從已啟用的伺服器實例(在 Always On 可用性群組Always On availability groups 具有仲裁的節點上)進行查詢時, sys.dm_hadr_cluster_members 會將關閉節點的狀態反映為 "NODE_DOWN"。For example, for a five node cluster with majority node quorum in which one node is down, when sys.dm_hadr_cluster_members is queried from a server instance that is that is enabled for Always On 可用性群組Always On availability groups that resides on a node with quorum, sys.dm_hadr_cluster_members reflects the state of the down node as "NODE_DOWN".

如果 WSFC 節點沒有仲裁,則不傳回任何資料列。If the WSFC node has no quorum, no rows are returned.

使用這個動態管理檢視可回答下列問題:Use this dynamic management view to answer the following questions:

  • 哪些節點目前正在 WSFC 叢集上執行?What nodes are currently running on the WSFC cluster?

  • WSFC 叢集在遺失 majority-node 案例中的仲裁之前,還可容忍其他多少失敗?How many more failures can the WSFC cluster tolerate before losing quorum in a majority-node case?

提示

從開始 SQL Server 2014 (12.x)SQL Server 2014 (12.x) ,這個動態管理檢視除了 Always On 可用性群組之外,還支援 Always On 容錯移轉叢集實例。Beginning in SQL Server 2014 (12.x)SQL Server 2014 (12.x), this dynamic management view supports Always On Failover Cluster Instances in addition to Always On Availability Groups.

資料行名稱Column name 資料類型Data type 描述Description
member_namemember_name nvarchar(128)nvarchar(128) 成員名稱,這可以是電腦名稱、磁碟機代號或檔案共用路徑。Member name, which can be a computer name, a drive letter, or a file share path.
member_typemember_type tinyinttinyint 成員的類型,可為下列其中一個值:The type of member, one of:

0 = WSFC 節點0 = WSFC node

1 = 磁碟見證1 = Disk witness

2 = 檔案共用見證2 = File share witness

3 = 雲端見證3 = Cloud Witness
member_type_descmember_type_desc nvarchar(50)nvarchar(50) Member_type 的描述,下列其中一個:Description of member_type, one of:

CLUSTER_NODECLUSTER_NODE

DISK_WITNESSDISK_WITNESS

FILE_SHARE_WITNESSFILE_SHARE_WITNESS

CLOUD_WITNESSCLOUD_WITNESS
member_statemember_state tinyinttinyint 成員狀態,可為下列其中一個值:The member state, one of:

0 = 離線0 = Offline

1 = 線上1 = Online
member_state_descmember_state_desc nvarchar(60)nvarchar(60) Member_state 的描述,下列其中一個:Description of member_state, one of:

UPUP

DOWNDOWN
number_of_quorum_votesnumber_of_quorum_votes tinyinttinyint 此仲裁成員擁有的仲裁投票數。Number of quorum votes possessed by this quorum member. 如果是「無多數:僅限磁碟」的仲裁,這個值預設為 0。For No Majority: Disk Only quorums, this value defaults to 0. 如果是其他仲裁類型,這個值預設為 1。For other quorum types, this value defaults to 1.

權限Permissions

需要伺服器的 VIEW SERVER STATE 權限。Requires VIEW SERVER STATE permission on the server.

範例Examples

另請參閱See Also

Always On 可用性群組動態管理檢視和函數 (Transact-sql) Always On Availability Groups Dynamic Management Views and Functions (Transact-SQL)
AlwaysOn 可用性群組目錄檢視 (Transact-SQL) Always On Availability Groups Catalog Views (Transact-SQL)
監視可用性群組 (Transact-sql) Monitor Availability Groups (Transact-SQL)
AlwaysOn 可用性群組 (SQL Server)AlwaysOn Availability Groups (SQL Server)