This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing a T-SQL script for monitoring the Automatic Seeding of Always On Availability group in SQL Server.
We can use dm_hadr_automatic_seeding system view to monitor the seeding progress. I took the reference script from this official page.
Please check the below script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
SELECT dhas.start_time ,dhas.completion_time ,ag.name ,adb.database_name ,dhas.current_state ,dhas.performed_seeding ,dhas.failure_state ,dhas.failure_state_desc FROM sys.dm_hadr_automatic_seeding as dhas JOIN sys.availability_databases_cluster as adb ON dhas.ag_db_id = adb.group_database_id JOIN sys.availability_groups as ag ON dhas.ag_id = ag.group_id |