View Availability Replica Properties (SQL Server)
This topic describes how to view the properties of an availability replica for an AlwaysOn availability group by using SQL Server Management Studio or Transact-SQL in SQL Server 2012.
To view availability replica properties, using:
SQL Server Management Studio
Transact-SQL
Using SQL Server Management Studio
To view and change properties an availability replica
In Object Explorer, connect to the server instance that hosts the primary replica, and expand the server tree.
Expand the AlwaysOn High Availability node and the Availability Groups node.
Expand the availability group to which the availability replica belongs, and expand the Availability Replicas node.
Right-click the availability replica whose properties you want to view, and select the Properties command.
In the Availability Replica Properties dialog box, use the General page to view the properties of this replica. If you are connected to the primary replica, you can change the following properties: availability mode, failover mode, connection access for the primary role, read-access for the secondary role (readable-secondary), and the session-timeout value. For more information, see Availability Replica Properties (General Page).
[Top]
Using Transact-SQL
To view properties and states of availability replicas
To view the properties and states of availability replicas, use the following views and system function:
sys.availability_replicas
Returns a row for every availability replica in each availability group for which the local instance of SQL Server hosts an availability replica.Column names: replica_id, group_id, replica_metadata_id, replica_server_name, owner_sid, endpoint_url, availability_mode, availability_mode_desc, failover_mode, failover_mode_desc, session_timeout, primary_role_allow_connections, primary_role_allow_connections_desc, secondary_role_allow_connections, secondary_role_allow_connections_desc, create_date, modify_date, backup_priority, read_only_routing_url
sys.availability_read_only_routing_lists
Returns a row for the read only routing list of each availability replica in an AlwaysOn availability group in the WSFC failover cluster.Column names: replica_id, routing_priority, read_only_replica_id
sys.dm_hadr_availability_replica_cluster_nodes
Returns a row for every availability replica (regardless of join state) of the AlwaysOn availability groups in the Windows Server Failover Clustering (WSFC) cluster.Column names: group_name, replica_server_name, node_name
sys.dm_hadr_availability_replica_cluster_states
Returns a row for each replica (regardless of join state) of all AlwaysOn availability groups (regardless of replica location) in the Windows Server Failover Clustering (WSFC) cluster.Column names: replica_id, replica_server_name, group_id, join_state, join_state_desc
sys.dm_hadr_availability_replica_states
Returns a row showing the state of each local availability replica and a row for each remote availability replica in the same availability group.Column names: replica_id, group_id, is_local, role, role_desc, operational_state, operational_state_desc, connected_state, connected_state_desc, recovery_health, recovery_health_desc, synchronization_health, synchronization_health_desc, last_connect_error_number, last_connect_error_description, and last_connect_error_timestamp
sys.fn_hadr_backup_is_preferred_replica
Determines whether the current replica is the preferred backup replica. Returns 1 if the database on the current server instance is the preferred replica. Otherwise, it returns 0.
[!UWAGA]
For information about performance counters for availability replicas (the SQLServer:Availability Replica performance object), see SQL Server, Availability Replica.
[Top]
Related Tasks
To view information about availability groups
To manage availability replicas
Add a Secondary Replica to an Availability Group (SQL Server)
Join a Secondary Replica to an Availability Group (SQL Server)
Configure Read-Only Access on an Availability Replica (SQL Server)
Change the Availability Mode of an Availability Replica (SQL Server)
Change the Failover Mode of an Availability Replica (SQL Server)
Change the Session-Timeout Period for an Availability Replica (SQL Server)
Remove a Secondary Replica from an Availability Group (SQL Server)
To manage an availability database
Join a Secondary Database to an Availability Group (SQL Server)
Remove a Secondary Database from an Availability Group (SQL Server)
Remove a Primary Database from an Availability Group (SQL Server)
[Top]
Zobacz także
Koncepcje
Overview of AlwaysOn Availability Groups (SQL Server)
Monitor Availability Groups (Transact-SQL)
Inne zasoby
AlwaysOn Policies for Operational Issues with AlwaysOn Availability Groups (SQL Server)