Udostępnij za pośrednictwem


sys.dm_os_cluster_nodes

This view returns a 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.

Column name Data type Description

NodeName

sysname

Name of a node in the SQL Server failover cluster instance (virtual server) configuration.

Remarks

When failover clustering is enabled, the SQL Server instance can run on any of the nodes of the failover cluster that are designated as part of the SQL Server failover cluster instance (virtual server) configuration.

Note

This view will eventually replace the fn_virtualservernodes function which will be deprecated in a future release.

For information on adding or removing nodes from a failover cluster (virtual server) configuration, see How to: Add or Remove Nodes in a SQL Server 2005 Failover Cluster (Setup).

Permissions

The user must have VIEW SERVER STATE permission for the SQL Server instance.

Examples

The following example uses sys. dm_os_cluster_nodes to determine the nodes on a clustered server instance:

SELECT * FROM sys.dm_os_cluster_nodes

This is the result set:

NodeName

--------

SS3-CLUSN1

SS3-CLUSN2

See Also

Reference

sys.dm_io_cluster_shared_drives
fn_virtualservernodes (Transact-SQL)
Dynamic Management Views and Functions

Other Resources

Maintaining a Failover Cluster

Help and Information

Getting SQL Server 2005 Assistance

Change History

Release History

17 July 2006

New content:
  • Added an example.
Changed content:
  • Updated Description, Remarks, and See Also sections.
  • Changed permissions requirement from server level to instance level.