檢視可用性群組屬性 (SQL Server)

適用於:SQL Server

本主題說明如何在 SQL Server 中使用 SQL Server Management Studio 或 Transact-SQL,來檢視 Always On 可用性群組的可用性群組屬性。

使用 SQL Server Management Studio

若要檢視及變更可用性群組的屬性

  1. 在 [物件總管] 中,連接到裝載主要複本的伺服器執行個體,然後展開伺服器樹狀目錄。

  2. 依序展開 [Always On 高可用性] 節點和 [可用性群組] 節點。

  3. 以滑鼠右鍵按一下要檢視其屬性的可用性群組,然後選取 [屬性] 命令。

  4. [可用性群組屬性] 對話方塊中,使用 [一般][備份喜好設定] 頁面檢視所選可用性群組的屬性,並在某些情況下變更這些屬性。 如需詳細資訊,請參閱可用性群組屬性:新增可用性群組 (一般頁面)可用性群組屬性:新增可用性群組 (備份喜好設定頁面)

    使用 [權限] 頁面來檢視與可用性群組相關聯的目前登入、角色和明確權限。 如需相關資訊,請參閱 Permissions or Securables Page

使用 TRANSACT-SQL

若要檢視可用性群組的屬性和狀態

若要針對伺服器執行個體裝載其可用性複本的可用性群組,查詢其屬性和狀態,請使用下列檢視:

sys.availability_groups
針對裝載可用性複本的 SQL Server 主機本機執行個體的每一個可用性群組,各傳回一個資料列。 每一個資料列都包含可用性群組中繼資料的快取副本。

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

sys.availability_groups_cluster
針對 WSFC 叢集中的每一個可用性群組,各傳回一個資料列。 每個資料列都包含 Windows Server 容錯移轉叢集 (WSFC) 叢集中的可用性群組中繼資料。

資料行名稱: 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_states
針對擁有 SQL Server 本機執行個體之可用性複本的每個可用性群組,各傳回一個資料列。 每個資料列會顯示定義給定之可用性群組健全狀況的狀態。

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

相關工作

若要檢視可用性群組的相關資訊

設定現有的可用性群組

手動容錯移轉可用性群組

另請參閱

AlwaysOn 可用性群組概觀 (SQL Server)
監視可用性群組 (Transact-SQL)
AlwaysOn 可用性群組操作問題適用的 AlwaysOn 原則 (SQL Server)