Interesting one today:
Last time we walked through the T-SQL steps to insert a tracer token to measure latency in replication topology. Today, we’ll look at an alternate method to query tracer token details; a.k.a. MStracer_tokens & MStracer_history meta tables.
Along with the T-SQL procedures (sys.sp_helptracertokenhistory), Sql Server also provides a way to query the tracer tokens using metadata tables i.e. MStracer_tokens & MStracer_history. They keep track of details for each token. Querying them will provide us necessary information.
-- -- Query tracer token tables -- SELECT publication_id , agent_id , t.publisher_commit , t.distributor_commit , h.subscriber_commit FROM MStracer_tokens t JOIN MStracer_history h ON t.tracer_id = h.parent_tracer_id ORDER BY t.publisher_commit DESC GO
_Sqltimes