Replication status check

select h.agent_id , a.name , rm.publication as pub_name , rm.publisher_db as pub_db , a.publisher_database_id as pub_db_id , a.subscriber_db as sub_db , comments , h.time , isnull(rm.cur_latency, 0) as cur_latency , pub_srv.name as pub_srv , sub_srv.name as sub_srv from distribution_svg011.dbo.msdistribution_agents a with(nolock) join distribution_svg011.dbo.MSreplication_monitordata rm with(nolock) on rm.agent_id=a.id join master.sys.servers pub_srv with(nolock) on a.publisher_id = pub_srv.server_id join master.sys.servers sub_srv with(nolock) on a.subscriber_id= sub_srv.server_id cross apply ( select top 1 * From distribution_SVG011.dbo.msdistribution_history with(nolock) where agent_id=a.id order by timestamp desc ) h order by pub_db, pub_name


Comments (archived from WordPress)

simonsql · 2011-08-16

Usually, token based check it best. But, this case you can really quick check current status.

Simon