sys.availability_group_listeners (Transact-SQL)sys.availability_group_listeners (Transact-SQL)

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

針對每一個 Always On 可用性群組,傳回零個資料列,表示沒有網路名稱與可用性群組相關聯,或針對 Windows Server 容錯移轉叢集服務 (WSFC) 叢集中的每個可用性群組接聽程式設定傳回一個資料列。For each Always On availability group, returns either zero rows indicating that no network name is associated with the availability group, or returns a row for each availability-group listener configuration in the Windows Server Failover Clustering (WSFC) cluster. 此檢視會顯示從叢集蒐集的即時組態。This view displays the real-time configuration gathered from cluster.


此目錄檢視不會描述 WSFC 叢集中所定義之 IP 組態的詳細資料。This catalog view does not describe details of an IP configuration, that was defined in the WSFC cluster.

資料行名稱Column name 資料類型Data type 描述Description
group_idgroup_id uniqueidentifieruniqueidentifier 可用性群組識別碼 (從 sys.availability_groups group_id) 。Availability group ID (group_id) from sys.availability_groups.
listener_idlistener_id Nvarchar (36)nvarchar(36) 叢集資源識別碼中的 GUID。GUID from the cluster resource ID.
dns_namedns_name Nvarchar (63)nvarchar(63) 可用性群組接聽程式的已設定網路名稱 (主機名稱)。Configured network name (hostname) of the availability group listener.
portport intint 為可用性群組接聽程式設定的 TCP 通訊埠編號。The TCP port number configured for the availability group listener.

NULL = 接聽程式已在 SQL ServerSQL Server 外面設定,而且其通訊埠編號尚未加入至可用性群組。NULL = Listener was configured outside SQL ServerSQL Server and its port number has not been added to the availability group. 若要加入埠,請 pleaseuse ALTER AVAILABILITY GROUP語句的 [修改接聽程式] 選項 Transact-SQLTransact-SQLTo add the port, pleaseuse the MODIFY LISTENER option of the ALTER AVAILABILITY GROUPTransact-SQLTransact-SQL statement.
is_conformantis_conformant bitbit 此 IP 組態是否符合標準,可為下列其中一個值:Whether this IP configuration is conformant, one of:

1 = 接聽程式符合標準。1 = Listener is conformant. (IP) 位址的網際網路通訊協定中,只會存在「或」關聯。Only "OR" relations exist among its Internet Protocol (IP) addresses. 符合標準:會包含 CREATE AVAILABILITY GROUP語句所建立的每個 IP 設定 Transact-SQLTransact-SQLConformant encompasses every an IP configuration that was created by the CREATE AVAILABILITY GROUPTransact-SQLTransact-SQL statement. 此外,如果已在 SQL ServerSQL Server 外面建立 IP 組態 (例如,藉由使用 WSFC 容錯移轉叢集管理員),但是可由 ALTER AVAILABILITY GROUP tsql 陳述式加以修改,則表示 IP 組態符合標準。In addition, if an IP configuration that was created outside of SQL ServerSQL Server, for example by using the WSFC Failover Cluster Manager, but can be modified by the ALTER AVAILABILITY GROUP tsql statement, the IP configuration qualifies as conformant.

0 = 接聽程式不符合標準。0 = Listener is nonconformant. 一般來說,這表示 IP 位址無法使用 SQL ServerSQL Server 命令加以設定,但是已直接在 WSFC 叢集中定義。Typically, this indicates an IP address that could not be configured by using SQL ServerSQL Server commands and, instead, was defined directly in the WSFC cluster.
ip_configuration_string_from_clusterip_configuration_string_from_cluster nvarchar(max)nvarchar(max) 此接聽程式的叢集 IP 組態字串 (如果有的話)。Cluster IP configuration strings, if any, for this listener. NULL = 接聽程式沒有虛擬 IP 位址。NULL = Listener has no virtual IP addresses. 例如:For example:

IPv4 位址: address:

IPv6 位址:2001::4898:23:1002:20f:1fff:feff:b3a3IPv6 address: 2001::4898:23:1002:20f:1fff:feff:b3a3



目錄檢視內中繼資料的可見性會限制在使用者所擁有的安全性實體,或已授與使用者某些權限的安全性實體。The visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. 如需相關資訊,請參閱 Metadata Visibility ConfigurationFor more information, see Metadata Visibility Configuration.

另請參閱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)Always On Availability Groups (SQL Server)