Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (16 sloc) 685 Bytes
-- Based on information in https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/automatic-seeding-secondary-replicas
-- Monitor the status of the automatic seeding
SELECT start_time,
ag.name,
db.database_name,
current_state,
performed_seeding,
failure_state,
failure_state_desc
FROM sys.dm_hadr_automatic_seeding autos
JOIN sys.availability_databases_cluster db
ON autos.ag_db_id = db.group_database_id
JOIN sys.availability_groups ag
ON autos.ag_id = ag.group_id
-- If a seeding activity is currently in progres then you can also query the following DMV
SELECT * FROM sys.dm_hadr_physical_seeding_stats