这篇文章主要介绍Sqlserver如何查询alwayson同步情况,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
SELECT availability_mode_desc ,
role_desc ,
replica_server_name ,
last_redone_time ,
GETDATE() now ,
DATEDIFF(ms, last_redone_time, GETDATE()) diffMS
FROM ( ( sys.availability_groups AS ag
JOIN sys.availability_replicas AS ar ON ag.group_id = ar.group_id
)
JOIN sys.dm_hadr_availability_replica_states AS ar_state ON ar.replica_id = ar_state.replica_id
)
JOIN sys.dm_hadr_database_replica_states dr_state ON ag.group_id = dr_state.group_id
AND dr_state.replica_id = ar_state.replica_id;
以上是“Sqlserver如何查询alwayson同步情况”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!