title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | monikerRange | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sys.dm_os_cluster_nodes (Transact-SQL) |
sys.dm_os_cluster_nodes (Transact-SQL) |
rwestMSFT |
randolphwest |
02/27/2023 |
sql |
system-objects |
reference |
|
|
|
>=sql-server-2016||>=sql-server-linux-2017||>=aps-pdw-2016||=azure-sqldw-latest |
[!INCLUDE sql-asa-pdw]
Returns one row for each node in the failover cluster instance configuration. If the current instance is a failover clustered instance, it returns a list of nodes on which this failover cluster instance (formerly "virtual server") has been defined. If the current server instance is not a failover clustered instance, it returns an empty rowset.
Note
To call this from [!INCLUDEssazuresynapse-md] or [!INCLUDEssPDW], use the name sys.dm_pdw_nodes_os_cluster_nodes. [!INCLUDEsynapse-analytics-od-unsupported-syntax]
Column name | Data type | Description |
---|---|---|
NodeName | sysname | Name of a node in the [!INCLUDEssNoVersion] failover cluster instance (virtual server) configuration. |
status | int | Status of the node in a [!INCLUDEssNoVersion] failover cluster instance: 0, 1, 2, 3, -1. For more information, see GetClusterNodeState Function. |
status_description | nvarchar(20) | Description of the status of the [!INCLUDEssNoVersion] failover cluster node. 0 = up 1 = down 2 = paused 3 = joining -1 = unknown |
is_current_owner | bit | 1 means this node is the current owner of the [!INCLUDEssNoVersion] failover cluster resource. |
pdw_node_id | int | Applies to: [!INCLUDEssazuresynapse-md], [!INCLUDEssPDW] The identifier for the node that this distribution is on. |
When failover clustering is enabled, the [!INCLUDEssNoVersion] instance can run on any of the nodes of the failover cluster that are designated as part of the [!INCLUDEssNoVersion] failover cluster instance (virtual server) configuration.
Note
This view replaces the fn_virtualservernodes function, which will be deprecated in a future release.
Requires VIEW SERVER STATE permission on the instance of [!INCLUDEssNoVersion].
Requires VIEW SERVER PERFORMANCE STATE permission on the server.
The following example uses sys. dm_os_cluster_nodes to return the nodes on a clustered server instance.
SELECT NodeName, status, status_description, is_current_owner
FROM sys.dm_os_cluster_nodes;
[!INCLUDEssResult]
NodeName | status | status_description | is_current_owner |
---|---|---|---|
node1 | 0 | up | 1 |
node2 | 0 | up | 0 |
Node3 | 1 | down | 0 |
sys.dm_os_cluster_properties (Transact-SQL)
sys.dm_io_cluster_shared_drives (Transact-SQL)
sys.fn_virtualservernodes (Transact-SQL)
Dynamic Management Views and Functions (Transact-SQL)