Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[AlwaysOn2017] DMV and DMF-Sys.dm_hadr_database_replica_cluster_states of AlwaysOn

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

17 、 Sys. Dm_hadr_database_replica_cluster_states

Returns a row of information that provides insight into the health of the availability database in each AlwaysOn availability group on the Windows Server failover cluster (WSFC). Query Sys.dm_hadr_database_replica_states to answer the following questions:

Are all databases in the availability group ready for failover?

After performing a forced failover, does the secondary database suspend itself locally and confirm its pending state to the new primary copy?

If the primary copy is currently unavailable, which secondary copy allows minimal data loss after it becomes the primary copy?

The value of the log_reuse_wait_desc column of l Sys.databases is "AVAILABILITY_REPLICA". Which secondary copy in the availability group is preventing log truncation on a given primary database?

Column name

Data type

Description

Replica_id

Uniqueidentifier

Identifier of the availability copy within the availability group.

Group_database_id

Uniqueidentifier

The identifier of the database within the availability group. The identifier is the same on each copy to which this database is joined.

Database_name

Sysname

The name of the database that belongs to the availability group.

Is_failover_ready

Bit

Indicates whether the secondary database is synchronized with the corresponding primary database. One of them:

0 = the database is not marked as synchronized in the cluster. The database is not ready for failover.

1 = the database is marked as synchronized in the cluster. The database is ready for failover.

Is_pending_secondary_suspend

Bit

Indicates whether the database is pending after a forced failover, which can be one of the following values:

0 = any state other than HADR_SYNCHRONIZED_ SUSPENDED.

1 = HADR_SYNCHRONIZED_ SUSPENDED. After the forced failover completes, each secondary database is set to ADR_SYNCHONIZED_SUSPENDED and remains in this state until the new primary copy receives an acknowledgment of the secondary database about the SUSPEND message.

NULL = unknown (no arbitration)

Is_database_joined

Bit

Indicates whether the database on this availability copy is joined to an availability group, which can be one of the following values:

0 = the database is not joined to the availability group on this availability copy.

1 = the database is connected to the availability group on this availability copy.

NULL = unknown (availability copy lacks arbitration.)

Recovery_lsn

Numeric (25Phone0)

On the primary copy, the end of the transaction log after a restore or failover, but before the replica is written to any new log records. On the primary copy, the row of a given secondary database will have a primary copy that requires the secondary copy to be synchronized to (that is, reverted to and reinitialized to).

This value is NULL on the secondary copy. Note that each secondary copy will have a Max value or a lower value that the primary copy notifies the secondary copy to return to.

Truncation_lsn

Numeric (25Phone0)

The AlwaysOn availability group log truncation value, which may be higher than the local truncation LSN if local log truncation is blocked (for example, by backup operations).

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report