檢視可用性群組屬性 (SQL Server)View Availability Group Properties (SQL Server)

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

此主題描述如何使用 SQL Server Management StudioSQL Server Management Studio 中的 Transact-SQLTransact-SQLSQL ServerSQL Server,檢視 AlwaysOn 可用性群組的可用性群組屬性。This topic describes how to view the properties of an availability group for an Always On availability group by using SQL Server Management StudioSQL Server Management Studio or Transact-SQLTransact-SQL in SQL ServerSQL Server.

使用 SQL Server Management StudioUsing SQL Server Management Studio

若要檢視及變更可用性群組的屬性To view and change the properties an availability group

  1. 在 [物件總管] 中,連接到裝載主要複本的伺服器執行個體,然後展開伺服器樹狀目錄。In Object Explorer, connect to the server instance that hosts the primary replica, and expand the server tree.

  2. 依序展開 [Always On 高可用性] 節點和 [可用性群組] 節點。Expand the Always On High Availability node and the Availability Groups node.

  3. 以滑鼠右鍵按一下要檢視其屬性的可用性群組,然後選取 [屬性] 命令。Right-click the availability group whose properties you want to view, and select the Properties command.

  4. [可用性群組屬性] 對話方塊中,使用 [一般][備份喜好設定] 頁面檢視所選可用性群組的屬性,並在某些情況下變更這些屬性。In the Availability Group Properties dialog box, use the General and Backup Preferences pages to view and, in some cases, change properties of the selected availability group. 如需詳細資訊,請參閱可用性群組屬性:新增可用性群組 (General Page)可用性群組屬性/新增可用性群組 (Backup Preferences Page)For more information, see Availability Group Properties: New Availability Group (General Page) and Availability Group Properties: New Availability Group (Backup Preferences Page).

    使用 [權限] 頁面來檢視與可用性群組相關聯的目前登入、角色和明確權限。Use the Permissions page to view the current logins, roles, and explicit permissions associated with the availability group. 如需相關資訊,請參閱 Permissions or Securables PageFor more information, see Permissions or Securables Page.

使用 Transact-SQLUsing Transact-SQL

若要檢視可用性群組的屬性和狀態To view the properties and state of an availability group

若要針對伺服器執行個體裝載其可用性複本的可用性群組,查詢其屬性和狀態,請使用下列檢視:To query the properties and states of the availability groups for which the server instance hosts an availability replica, use the following views:

sys.availability_groupssys.availability_groups
針對裝載可用性複本的 SQL ServerSQL Server 本機執行個體的每一個可用性群組,各傳回一個資料列。Returns a row for each availability group for which the local instance of SQL ServerSQL Server hosts an availability replica. 每一個資料列都包含可用性群組中繼資料的快取副本。Each row contains a cached copy of the availability group metadata.

資料行名稱: group_id、name、resource_id、resource_group_id、failure_condition_level、health_check_timeout、automated_backup_preference、automated_backup_preference_descColumn names: group_id, name, resource_id, resource_group_id, failure_condition_level, health_check_timeout, automated_backup_preference, automated_backup_preference_desc

sys.availability_groups_clustersys.availability_groups_cluster
針對 WSFC 叢集中的每一個可用性群組,各傳回一個資料列。Returns a row for each availability group in the WSFC cluster. 每個資料列都包含 Windows Server 容錯移轉叢集 (WSFC) 叢集中的可用性群組中繼資料。Each row contains the availability group metadata from the Windows Server Failover Clustering (WSFC) cluster.

資料行名稱: group_id、name、resource_id、resource_group_id、failure_condition_level、health_check_timeout、automated_backup_preference、automated_backup_preference_descColumn names: group_id, name, resource_id, resource_group_id, failure_condition_level, health_check_timeout, automated_backup_preference, automated_backup_preference_desc

sys.dm_hadr_availability_group_statessys.dm_hadr_availability_group_states
針對擁有 SQL ServerSQL Server本機執行個體之可用性複本的每一個可用性群組,各傳回一個資料列。Returns a row for each availability group that possesses an availability replica on the local instance of SQL ServerSQL Server. 每個資料列會顯示定義給定之可用性群組健全狀況的狀態。Each row displays the states that define the health of a given availability group.

資料行名稱: group_id、primary_replica、primary_recovery_health、primary_recovery_health_desc、secondary_recovery_health、secondary_recovery_health_desc、synchronization_health、synchronization_health_descColumn names: group_id, primary_replica, primary_recovery_health, primary_recovery_health_desc, secondary_recovery_health, secondary_recovery_health_desc, synchronization_health, synchronization_health_desc

若要檢視可用性群組的相關資訊To view information about availability groups

設定現有的可用性群組To configure an existing availability group

手動容錯移轉可用性群組To manually fail over an availability group

另請參閱See Also

AlwaysOn 可用性群組概觀 (SQL Server) Overview of Always On Availability Groups (SQL Server)
監視可用性群組 (Transact-SQL) Monitor Availability Groups (Transact-SQL)
AlwaysOn 可用性群組操作問題適用的 AlwaysOn 原則 (SQL Server)Always On Policies for Operational Issues with Always On Availability Groups (SQL Server)