Monitoring (Replication) | Microsoft Docs

Table of Contents
Overview
Monitoring Replication
Overview of the Replication Monitor Interface
Start the Replication Monitor
Allow Non-Administrators to Use Replication Monitor
Add and Remove Publishers from Replication Monitor
Refresh Data in Replication Monitor
Monitor Performance with Replication Monitor
Measure Latency and Validate Connections for Transactional Replication
Monitor Replication Agents
Programmatically Monitor Replication
Set Thresholds and Warnings in Replication Monitor
Caching, Refresh, and Replication Monitor Performance
View Publication and Subscription Status in Replication Monitor
View Information and Perform Tasks for a Publisher (Replication Monitor)
View Information and Perform Tasks for a Publication (Replication Monitor)
View Information and Perform Tasks for the Agents Associated With a Publication
(Replication Monitor)
View Information and Perform Tasks for a Subscription (Replication Monitor)
View Information and Perform Tasks for the Agents Associated With a Subscription
(Replication Monitor)
View Replicated Commands and Other Information in the Distribution Database
(Replication Transact-SQL Programming)
Monitoring Replication with System Monitor
Monitoring (Replication)
3/24/2017 • 1 min to read • Edit Online
Monitoring a replication topology is an important aspect of deploying replication. Because replication activity is
distributed, it is essential to track activity and status across all computers involved in replication. The following tools
can be used to monitor replication:
Microsoft SQL Server Replication Monitor
Replication Monitor is the most important tool for monitoring replication, presenting a Publisher-focused
view of all replication activity. For more information, see Monitoring Replication.
Microsoft SQL Server Management Studio
Management Studio provides access to Replication Monitor. It also allows you to view the current status and
last message logged by the following agents and allows you start and stop each agent: Log Reader Agent,
Snapshot Agent, Merge Agent, and Distribution Agent. For more information, see Monitor Replication
Agents.
Transact-SQL and Replication Management Objects (RMO)
Both interfaces allow you to monitor all types of replication from the Distributor. Merge replication also
provides the ability to monitor replication from the Subscriber.
Alerts for replication agent events
Replication provides a number of predefined alerts for replication agent events, and you can create
additional alerts if necessary. Alerts can be used to trigger an automated response to an event and/or notify
an administrator. For more information, see Use Alerts for Replication Agent Events.
System Monitor
System Monitor can be useful for monitoring performance, providing a number of counters for replication.
For more information, see Monitoring Replication with System Monitor.
See Also
Administration (Replication)
Best Practices for Replication Administration
Monitoring Replication
Monitoring Replication Overview
3/24/2017 • 2 min to read • Edit Online
Microsoft SQL Server Replication Monitor is a graphical tool that allows you to monitor the overall health of a
replication topology. Replication Monitor provides detailed information on the status and performance of
publications and subscriptions, allowing you to answer common questions, such as:
Is my replication system healthy?
Which subscriptions are slow?
How far behind is my transactional subscription?
How long will it take a transaction committed now to reach a Subscriber in transactional replication?
Why is my merge subscription slow?
Why is an agent not running?
To monitor replication, a user must be a member of the sysadmin fixed server role at the Distributor or a
member of the replmonitor fixed database role in the distribution database. A system administrator can
add any user to the replmonitor role, which allows that user to view replication activity in Replication
Monitor; however, the user cannot administer replication.
In This Section
The following topics provide information about Replication Monitor features.
Overview of the Replication Monitor Interface
Describes each window and tab in Replication Monitor and provides information on how to answer the questions
listed above.
Start the Replication Monitor
Describes how to start the Replication Monitor.
Allow Non-Administrators to Use Replication Monitor
Describes how to assign permissions to non-administrators so that they can use Replication Monitor.
Add and Remove Publishers from Replication Monitor
Describes how to add or remove Publishers from Replication Monitor.
Refresh Data in Replication Monitor
Describes how to refresh data in Replication Monitor.
Monitor Performance with Replication Monitor
Describes how to monitor performance in Replication Monitor, including information on setting performance
thresholds. Includes information on article-level statistics for merge replication, which provide a detailed view of
processing.
Measure Latency and Validate Connections for Transactional Replication
Describes tracer tokens, which allow you to measure the performance of a transactional replication topology.
Monitor Replication Agents
Describes how to find information about each replication agent.
Set Thresholds and Warnings in Replication Monitor
Describes the warnings, thresholds, and alerts you can set in Replication Monitor. It is recommended that you
enable warnings for your topology, so that you are informed about status and performance in a timely manner.
Caching, Refresh, and Replication Monitor Performance
Describes how Replication Monitor caches data and calculations to improve performance; explains how refresh of
the user interface relates to refresh of the cache.
View Publication and Subscription Status in Replication Monitor
Describes how to view status information a Publication or Subscription by using the Replication Monitor.
View Information and Perform Tasks for a Publisher (Replication Monitor)
Describes how to view information and perform tasks for a Publisher by using the Replication Monitor.
View Information and Perform Tasks for a Publication (Replication Monitor)
Describes how to view information and perform tasks for a Publication by using the Replication Monitor.
View Information and Perform Tasks for the Agents Associated With a Publication (Replication Monitor)
Describes how to view information and perform tasks for the agents associated with a Publication by using the
Replication Monitor.
View Information and Perform Tasks for a Subscription (Replication Monitor)
Describes how to view information and perform tasks for a Subscription by using the Replication Monitor.
View Information and Perform Tasks for the Agents Associated With a Subscription (Replication Monitor)
Describes how to view information and perform tasks for the agents associated with a Subscription by using the
Replication Monitor.
Overview of the Replication Monitor Interface
3/24/2017 • 9 min to read • Edit Online
Microsoft SQL Server Replication Monitor presents a Publisher-focused view or Distributor-focused view of all
replication activity in a two pane format. You add a Publisher to the monitor in the left pane, and in the right pane
the monitor displays information on the Publisher, its publications, the subscriptions to those publications, and the
various replication agents. In addition to presenting information for the replication topology, Replication Monitor
allows you to perform a number of tasks, such as starting and stopping agents, and validating data.
Viewing Information for the Entire Topology
The left pane of Replication Monitor displays
Publisher groups, Publishers, and publications.
Distributors, Publishers, and publications.
To view any information in Replication Monitor, you must first add a Publisher. For more information, see
Add and Remove Publishers from Replication Monitor.
The left pane helps answer the following questions:
Is my replication system healthy?
The replication system is relatively healthy if there are no error icons on nodes in the left pane. To get a
more complete view of system health, you should also check the Subscription Watch List tab, which
displays information on subscriptions that might require attention.
Why is an agent not running?
An agent is not running at a particular time either because it is not scheduled to run or because an error has
occurred. If an error has occurred, an error icon is displayed on the appropriate nodes in the left pane. For
example, if the Snapshot Agent for a publication stopped because of an error, an error icon is displayed on
the Publisher group, Publisher, and publication nodes. Summary information for the Snapshot Agent is
displayed on the Agents tab for the publication; double click the Snapshot Agent on this tab for detailed
error information.
Viewing Information and Performing Tasks Related to Distributors
Replication Monitor displays information about Distributors on three tabs:
Publications tab
This tab provides summary information for all publications of a Distributor.
Subscription Watch List tab
This tab provides information about subscriptions for the selected Distributor. You can filter the list of
subscriptions to see errors, warnings, and any poorly performing subscriptions. The tab also lets you to
perform the following tasks: access subscription properties, access detailed information about the agent or
agents associated with a subscription, reinitialize subscriptions, and validate subscriptions.
The Subscription Watch List tab helps answer the following questions:
Which subscriptions are slow?
Set options on this tab so that the grid displays subscriptions in order by their relative performance.
Is my replication system healthy?
The grid on this tab displays error and warning icons for any subscriptions that require your
attention.
This tab is not available for Distributors that are running versions of SQL Server 2008 or earlier.
Agents tab
This tab displays detailed information about the agents and jobs that are used by all types of replication. The
tab also let you start and stop each agent and job.
Replication Monitor also provides a context menu for the Distributor node. Right-click a Distributor in the
left pane to perform the following tasks:
Add a Publisher to Replication Monitor.
Edit Replication Monitor settings for the Distributor.
Switch to the Publisher Group view.
Viewing Information and Performing Tasks Related to Publishers
Replication Monitor displays information about Publishers on three tabs:
Publications tab
This tab provides summary information for all publications at a Publisher.
Subscription Watch List tab
This tab is intended to display information on subscriptions from all publications available at the selected
Publisher. You can filter the list of subscriptions to see errors, warnings, and any poorly performing
subscriptions. The tab also allows you to: access subscription properties; access detailed information about
the agent or agents associated with a subscription; reinitialize subscriptions; and validate subscriptions.
The Subscription Watch List tab helps answer the following questions:
Which subscriptions are slow?
Set options on this tab so that the grid displays subscriptions in order by their relative performance.
Is my replication system healthy?
The grid on this tab displays error and warning icons for any subscriptions that require your
attention.
This tab is not displayed for Distributors running versions prior to SQL Server 2005.
Agents tab
This tab displays detailed information about the agents and jobs used by all types of replication. The tab also
allows you to start and stop each agent and job.
For more information, see View Information and Perform Tasks for a Publisher (Replication Monitor).
Replication Monitor also provides a context menu for the Publisher node. Right-click a Publisher in the left
pane to:
Edit Replication Monitor settings for the Publisher
Remove the Publisher from Replication Monitor
View and edit agent profiles
Connect to or disconnect from the Distributor that stores information about the Publisher
Viewing Information and Performing Tasks Related to Publications
Replication Monitor displays information about publications on three tabs and a number of detail windows:
All Subscriptions tab
This tab displays information about all subscriptions to the selected publication. By default, this tab is sorted
in priority order: errors, then warnings, then in increasing order of performance, with any poorly performing
subscriptions at the top.
The All Subscriptions tab helps answer the following questions:
Which subscriptions are slow?
Set options on this tab so that the grid displays subscriptions in order by their relative performance.
Is my replication system healthy?
The grid on this tab displays error and warning icons for any subscriptions that require your
attention.
Agents tab
This tab displays information about the agents that are used by replication. This tab displays information
about the following agents:
The Snapshot Agent, which is used by all publications.
The Log Reader Agent, which is used by all transactional publications.
The Queue Reader Agent, which is used by transactional publications enabled for queued updating
subscriptions.
The tab also allows for you to perform the following tasks: access detailed information about each
agent, and start and stop each agent. For information about agents that are associated with
subscriptions (the Distribution Agent and Merge Agent), see the section "Viewing Information and
Performing Tasks Related to Subscriptions" in this topic.
Warnings tab
This tab enables you to specify warnings and alerts for agents. For more information, see Set Thresholds and
Warnings in Replication Monitor.
Tracer Tokens tab (transactional replication only)
This tab allows you to measure latency, the amount of time that elapses between a transaction being
committed at the Publisher and the corresponding transaction being committed at the Subscriber.
This tab helps answers the following question:
How long will it take a transaction committed now to reach a Subscriber in transactional replication?
View the total time for a transaction to travel through the system and also compare it to previous
times.
This tab is not displayed for Distributors running SQL Server 2008 or earlier. For more information
on tracer tokens, see Measure Latency and Validate Connections for Transactional Replication.
Detail windows for the agents associated with a publication. The following agents are associated with
publications:
The Snapshot Agent, which is used by all publications.
The Log Reader Agent, which is used by all transactional publications.
The Queue Reader Agent, which is used by transactional publications enabled for queued updating
subscriptions.
Double-click an agent in Replication Monitor to access information in a detail window. In addition to
the agents listed above, there are agents associated with subscriptions: the Distribution Agent for
subscriptions to snapshot and transactional publications; and the Merge Agent for subscriptions to
merge publications. For more information, see the section "Viewing Information and Performing
Tasks Related to Subscriptions" in this topic.
The agent detail windows provide information about agent sessions, including start time, end time,
duration, and the actions performed in a session. They help to answer the following question:
Why is an agent not running?
The error messages available provide detailed information on why an agent is not running and
provide a starting point for troubleshooting issues with the agents associated with a publication.
For more information, see View Information and Perform Tasks for a Publication (Replication Monitor) and
View Information and Perform Tasks for the Agents Associated With a Publication (Replication Monitor).
Replication Monitor also provides a context menu for the publications node. Right-click a publication in the
left pane to:
Reinitialize all subscriptions to a publication
Validate all subscriptions to a publication
Generate a snapshot for a publication
View and edit publication properties
Viewing Information and Performing Tasks Related to Subscriptions
Replication Monitor displays information about subscriptions on a number of different tabs. Double-click a
subscription in Replication Monitor to access these tabs in a detail window. All of the tabs are useful in answering
the question "Why is an agent not running?" The error messages available provide detailed information on why an
agent is not running and provide a starting point for troubleshooting issues with the agents associated with a
subscription.
All Subscriptions tab and Subscription Watch List tab.
These tabs are described earlier in this topic.
Publisher to Distributor History tab (transactional replication only)
This tab displays information on the Log Reader Agent for a publication (the tab is identical to the Log
Reader Agent details window).
Distributor to Subscriber History tab (snapshot replication and transactional replication)
This tab displays information on the Distribution Agent for a subscription.
Undistributed Commands tab (transactional replication only)
This tab displays information about the number of commands in the distribution database that have not
been delivered to the selected Subscriber, and the estimated time to deliver those commands. The tab helps
answer the question, "How far behind is my subscription?" This tab is not displayed for Distributors running
versions prior to SQL Server 2005.
Synchronization History tab (merge replication only)
This tab displays information on the Merge Agent for a subscription. This tab helps answer the following
question:
Why is my merge subscription slow?
This tab provides detailed statistics for each article processed during synchronization, including the
amount of time spent in each processing phase (uploading changes, downloading changes, and so
on). It can help pinpoint specific tables that are causing slowdowns and is the best place to
troubleshoot performance issues with merge subscriptions.
For more information, see View Information and Perform Tasks for a Subscription (Replication Monitor) and
View Information and Perform Tasks for the Agents Associated With a Subscription (Replication Monitor).
Viewing Information and Performing Tasks Related to Agent Profiles
Replication Monitor includes a number of dialog boxes for managing agent profiles. Agent profiles are sets of
parameters for an agent that determine agent behavior. For more information, see Replication Agent Profiles. The
dialog boxes are:
Agent Profiles
This dialog box allows you to: change the properties of profiles; create and delete profiles; specify a default
profile; and specify that all agents of a specific type (such as Snapshot Agents) should use a given profile.
<AgentProfileName> Properties
This dialog box allows you to view and edit the parameter settings in a profile.
New Agent Profile
This dialog box allows you to create a new profile, optionally including the values from an existing profile.
See Also
Monitoring Replication
Start the Replication Monitor
3/24/2017 • 1 min to read • Edit Online
Replication Monitor can be started from SQL Server Management Studio on any instance of SQL Server, or from
the command prompt. After starting Replication Monitor, add one or more Publishers to monitor. For more
information, see Add and Remove Publishers from Replication Monitor.
To start Replication Monitor from SQL Server Management Studio
1. Connect to an instance of SQL Server in SQL Server Management Studio, and then expand the server node.
2. Right-click the Replication folder or any of its subfolders, and then click Launch Replication Monitor.
To start Replication Monitor from the command prompt
1. From the command prompt, navigate to the tools installation directory. The default path is C:\Program
Files\Microsoft SQL Server\130\Tools\Binn\ .
2. Run sqlmonitor.exe.
See Also
Monitoring Replication
Allow Non-Administrators to Use Replication Monitor
3/24/2017 • 2 min to read • Edit Online
This topic describes how to allow non-administrators to use Replication Monitor in SQL Server 2017 by using SQL
Server Management Studio or Transact-SQL. Replication Monitor can be used by users who are members of the
following roles:
The sysadmin fixed server role.
These users can monitor replication and have full control over changing replication properties such as agent
schedules, agent profiles, and so on.
The replmonitor database role in the distribution database.
These users can monitor replication, but cannot change any replication properties.
In This Topic
Before you begin:
Security
To allow non-administrators to use Replication Monitor, using:
SQL Server Management Studio
Transact-SQL
Before You Begin
Security
Permissions
To allow non-administrators to use Replication Monitor, a member of the sysadmin fixed server role must add the
user to the distribution database and assign that user to the replmonitor role.
Using SQL Server Management Studio
To allow non-administrators to use Replication Monitor
1. In SQL Server Management Studio, connect to the Distributor, and then expand the server node.
2. Expand Databases, expand System Databases, and then expand the distribution database (named
distribution by default).
3. Expand Security, right-click Users, and then click New User.
4. Enter a user name and login for the user.
5. Select a default schema of replmonitor.
6. Select the replmonitor check box in the Database role membership grid.
7. Click OK.
Using Transact-SQL
To add a user to the replmonitor fixed database role
1. At the Distributor on the distribution database, execute sp_helpuser (Transact-SQL). If the user is not listed in
UserName in the result set, the user must be granted access to the distribution database using the CREATE
USER (Transact-SQL) statement.
2. At the Distributor on the distribution database, execute sp_helprolemember (Transact-SQL), specifying a
value of replmonitor for the @rolename parameter. If the user is listed in MemberName in the result set,
the user already belongs to this role.
3. If the user does not belong to the replmonitor role, execute sp_addrolemember (Transact-SQL) at the
Distributor on the distribution database. Specify a value of replmonitor for @rolename and the name of
the database user or the Microsoft Windows login being added for @membername.
To remove a user from the replmonitor fixed database role
1. To verify that the user belongs to the replmonitor role, execute sp_helprolemember (Transact-SQL) at the
Distributor on the distribution database, and specify a value of replmonitor for @rolename. If the user is
not listed in MemberName in the result set, the user does not currently belong to this role.
2. If the user does belong to the replmonitor role, execute sp_droprolemember (Transact-SQL) at the
Distributor on the distribution database. Specify a value of replmonitor for @rolename and the name of
the database user or the Windows login being removed for @membername.
Add and Remove Publishers from Replication
Monitor
3/24/2017 • 5 min to read • Edit Online
The server from which you launch Replication Monitor is automatically added to the monitor if it is a Publisher.
Additional Publishers can be added through the Add Publisher dialog box. After adding a Publisher, it is displayed
in a group in the left pane of the monitor. The My Publishers group is included by default, but you can create new
groups to manage one or more replication topologies. For information about starting Replication Monitor, see
Start the Replication Monitor.
To add a SQL Server Publisher
1. Right-click the Replication Monitor node or a Publisher group node in the left pane, and then click Add
Publisher.
2. In the Add Publisher dialog box, click Add, and then click Add SQL Server Publisher.
3. In the Connect to Server dialog box, enter the name of the Publisher, and then select the authentication
type. If you select SQL Server Authentication, enter a login and password. The credentials you specify are
saved by Replication Monitor to use when connecting to this server in the future. The Windows account or
SQL Server login specified must be a member of the sysadmin fixed server role or a member of the
replmonitor fixed database role in the distribution database.
4. Click Connect. If the Publisher uses a remote Distributor, you will be prompted to connect to the
Distributor in the Connect to Server dialog box. The credentials you specify are saved by Replication
Monitor to use when connecting to this server in the future. The Windows account or SQL Server login
specified must be a member of the sysadmin fixed server role or a member of the replmonitor fixed
database role in the distribution database.
5. The name of the Publisher and Distributor are displayed in the Start monitoring the following
Publisher(s) grid.
6. To specify refresh and connection options for the Publisher, select the Publisher in the grid, and modify
options as necessary. For more information about refresh options, see Caching, Refresh, and Replication
Monitor Performance.
7. Select the group under which the Publisher should be displayed in Replication Monitor. To create a new
group, click New Group, and then enter a group name; select the group in the Show this Publisher(s) in
the following group list.
8. Click OK.
To add an Oracle Publisher
1. Right-click the Replication Monitor node or a Publisher group node in the left pane, and then click Add
Publisher.
2. In the Add Publisher dialog box, click Add, and then click Add Oracle Publisher.
3. In the Connect to Server dialog box, enter the name of the Microsoft SQL Server Distributor associated
with the Oracle Publisher, and then select the authentication type. If you select SQL Server Authentication,
enter a login and password. The credentials you specify are saved by Replication Monitor to use when
connecting to this server in the future. The Windows account or SQL Server login specified must be a
member of the sysadmin fixed server role or a member of the replmonitor fixed database role in the
distribution database.
4. Click Connect.
5. The name of the Publisher and Distributor are displayed in the Start monitoring the following
Publisher(s) grid.
6. To specify refresh and connection options for the Publisher, select the Publisher in the grid, and modify
options as necessary. For more information about refresh options, see Caching, Refresh, and Replication
Monitor Performance.
7. Select the group under which the Publisher should be displayed in Replication Monitor. To create a new
group, click New Group, and then enter a group name; select the group in the Show this Publisher(s) in
the following group list.
8. Click OK.
To add one or more Publishers that use the same Distributor
1. Right-click the Replication Monitor node or a Publisher group node in the left pane, and then click Add
Publisher.
2. In the Add Publisher dialog box, click Add, and then click Specify a Distributor and Add Its Publishers.
3. In the Connect to Server dialog box, enter the name of the Distributor, and then select the authentication
type. If you select SQL Server Authentication, enter a login and password. The credentials you specify are
saved by Replication Monitor to use when connecting to this server in the future. The Windows account or
SQL Server login specified must be a member of the sysadmin fixed server role or a member of the
replmonitor fixed database role in the distribution database.
4. Click Connect.
5. The name of the Distributor and each Publisher are displayed in the Start monitoring the following
Publisher(s) grid. If a Publisher has already been added to Replication Monitor, it does not appear in the
grid.
6. To specify refresh and connection options for the Publisher, select the Publisher in the grid, and modify
options as necessary. For more information about refresh options, see Caching, Refresh, and Replication
Monitor Performance.
7. Select the group under which Publishers should be displayed in Replication Monitor. To create a new group,
click New Group, and then enter a group name; select the group in the Show this Publisher(s) in the
following group list.
8. Click OK.
To modify settings for the Publisher and Publisher Groups
1. Right-click a Publisher in the left pane, and then click Publisher Settings.
2. Make any changes in the Publisher Settings dialog box:
To change the credentials that Replication Monitor uses to connect to a server, click Publisher
Connection or Distributor Connection, and then enter credentials in the Connect to Server
dialog box.
To move a Publisher from one group to another, select the Publisher in the Start monitoring the
following Publisher(s) grid, and then select the new group in the Show this Publisher(s) in the
following group list.
3. Click OK.
To remove a Publisher from Replication Monitor
1. Right-click a Publisher in the left pane.
2. Click Remove.
To add a Publisher group to Replication Monitor
1. Publisher groups can be created only when adding a Publisher or modifying settings for a Publisher. See the
how to procedures on adding a Publisher for more information.
To remove a Publisher group from Replication Monitor
1. Move all Publishers to a different group or remove them from Replication Monitor. For more information,
see previous procedures in this topic.
2. Right-click the Publisher group, and then click Remove.
See Also
Configure Distribution
Monitoring Replication
Refresh Data in Replication Monitor
3/24/2017 • 1 min to read • Edit Online
In Replication Monitor, the main window and detail windows (those windows launched from the main window) can
be refreshed automatically or manually. To refresh a window manually, press F5. By default, the main window is
refreshed automatically every five seconds; the rate can be customized for each Publisher.
The data displayed in Replication Monitor is queried from a cache; for information about the relationship between
the cache and refreshing Replication Monitor, see Caching, Refresh, and Replication Monitor Performance. For
information about starting Replication Monitor, see Start the Replication Monitor.
To set refresh options for Replication Monitor
1. Right-click a Publisher in the left pane of Replication Monitor, and then click Publisher Settings.
2. In the Publisher Settings dialog box, set the Auto refresh and Refresh rate options. The Auto refresh
setting affects the main window in Replication Monitor. The Refresh rate setting also affects any detail
windows that are set to refresh automatically (changes to the setting only affect the detail windows opened
after the change).
3. Click OK.
To specify that a detail window should automatically refresh
1. Open a detail window in Replication Monitor. For example:
a. Expand a Publisher group in the left pane, expand a Publisher, and then click a publication.
b. Click the All Subscriptions tab.
c. Right-click a subscription, and then click View Details.
2. In the Subscription <SubscriptionName> detail window, click Action, and then click Auto Refresh. The
refresh rate is determined by the Refresh rate setting in the Publisher Settings dialog box.
See Also
Monitoring Replication
Monitor Performance with Replication Monitor
3/24/2017 • 4 min to read • Edit Online
Microsoft SQL Server Replication Monitor allows you to monitor the performance of transactional replication and
merge replication in the following ways:
Setting warnings and thresholds
Viewing performance measurements
Determining latency with tracer tokens (transactional replication)
Viewing detailed synchronization statistics (merge replication)
Viewing transactions and delivery time (transactional replication)
Set Warnings and Thresholds
Replication Monitor allows you to enable warnings for a number of performance conditions. When you enable a
warning, you specify a threshold. When that threshold is met or exceeded, a warning is displayed in the Status
column for the subscription and the publication with which it synchronizes (unless an issue with a higher priority
needs to be displayed). In addition to displaying a warning in Replication Monitor, reaching a threshold can also
trigger an alert. You can enable warnings for the following performance conditions:
Exceeding the specified latency (the amount of time that elapses between a transaction being committed at
the Publisher and the corresponding transaction being committed at the Subscriber).
This applies to transactional replication. If the specified threshold is met or exceeded, the status is displayed
as Performance critical.
Exceeding the specified synchronization time.
This applies to merge replication. If the specified threshold is met or exceeded, the status is displayed as
Long-running merge. You can specify different thresholds for dial-up and Local Area Network (LAN)
connections.
Falling short of processing the specified number of rows in a given amount of time.
This applies to merge replication. If the specified threshold is met or exceeded, the status is displayed as
Performance critical. You can specify different thresholds for dial-up and LAN connections.
For more information, see Set Thresholds and Warnings in Replication Monitor.
View Performance Measurements
Replication Monitor displays performance quality values for transactional replication and merge replication in the
Current Average Performance and Current Worst Performance columns for publications and the
Performance column for subscriptions. The values are:
Excellent
Good
Fair
Poor
Critical (transactional replication only)
The values are determined in the following ways:
For transactional replication, performance quality is determined by the latency threshold. If the threshold is
not set, a value is not displayed. The following table shows the correlation between the threshold and the
performance quality value. For example, if the threshold is set to 60 seconds and the actual latency is 30
seconds, latency is 50% of the threshold, resulting in a value of Good.
EXCELLENT
GOOD
FAIR
POOR
CRITICAL
0 – 34%
35 – 59%
60 – 84%
85 – 99%
100% +
For merge replication, performance quality is independent of either threshold (the row processing threshold
does determine if a value of Performance critical is displayed in the Status column). Performance quality
is determined by comparing individual subscription performance to the average historical performance of
subscriptions to the publication that have the same connection type (dial-up or LAN). Replication Monitor
displays a value after five synchronizations have occurred with 50 or more changes each over the same
type of connection. If there have been less than five synchronizations with 50 or more changes or the most
recent synchronization has less than 50 changes, Replication Monitor does not display a value.
The following table shows the correlation between the average performance and the performance quality
value. For example, if ten Subscribers have synchronized over a LAN connection with an average rate of 100
rows per second, and one of the subscriptions then synchronizes at a rate of 125 rows per second, the
performance for that Subscriber's synchronization is 125% of the average, resulting in a value of Good.
EXCELLENT
GOOD
FAIR
POOR
151+%
76 – 150%
26 – 75%
0 – 25%
For more information about viewing subscription information, see View Information and Perform Tasks for
a Subscription (Replication Monitor).
Determine Latency with Tracer Tokens
Transactional replication allows you to measure the latency in a system by inserting a token (a small amount of
data) in the transaction log of the publication database and recording how long it takes to arrive at the Distributor
and Subscribers. The token also allows you to identify if data is not reaching the Distributor or Subscriber. For
more information, see Measure Latency and Validate Connections for Transactional Replication.
View Detailed Synchronization Performance for Merge Replication
For merge replication, Replication Monitor displays detailed statistics for each article processed during
synchronization, including the amount of time spent in each processing phase (uploading changes, downloading
changes, and so on). It can help pinpoint specific tables that are causing slow downs and is the best place to
troubleshoot performance issues with merge subscriptions. For more information on viewing detailed statistics,
see View Information and Perform Tasks for the Agents Associated With a Subscription (Replication Monitor).
View Transactions and Delivery Time for Transactional Replication
For transactional replication, Replication Monitor displays information about the number of transactions in the
distribution database that have not yet been distributed to a Subscriber and the estimated time for distributing
these transactions. For more information, see View Information and Perform Tasks for the Agents Associated With
a Subscription (Replication Monitor).
See Also
Monitoring Replication
Set Thresholds and Warnings in Replication Monitor
Measure Latency and Validate Connections for
Transactional Replication
3/24/2017 • 7 min to read • Edit Online
This topic describes how to measure latency and validate connections for transactional replication in SQL Server
2017 by using Replication Monitor, Transact-SQL, or Replication Management Objects (RMO). Transactional
replication provides the tracer token feature, which provides a convenient way to measure latency in transactional
replication topologies and to validate the connections between the Publisher, Distributor and Subscribers. A token
(a small amount of data) is written to the transaction log of the publication database, marked as though it were a
typical replicated transaction, and sent through the system, allowing a calculation of:
How much time elapses between a transaction being committed at the Publisher and the corresponding
command being inserted in the distribution database at the Distributor.
How much time elapses between a command being inserted in the distribution database and the
corresponding transaction being committed at a Subscriber.
From these calculations, you can answer a number of questions, including:
Which Subscribers take the longest to receive a change from the Publisher?
Of the Subscribers expected to receive the tracer token, which, if any, have not received it?
In This Topic
Before you begin:
Limitations and Restrictions
To measure latency and validate connections, using:
SQL Server Replication Monitor
Transact-SQL
Replication Management Objects
Before You Begin
Limitations and Restrictions
Tracer tokens can also be useful when quiescing a system, which involves stopping all activity and verifying that all
nodes have received all outstanding changes. For more information, see Quiesce a Replication Topology
(Replication Transact-SQL Programming).
To use tracer tokens, you must use certain versions of Microsoft SQL Server:
The Distributor must be Microsoft SQL Server 2005 or later.
The Publisher must be SQL Server 2005 or later or be an Oracle Publisher.
For push subscriptions, tracer token statistics are gathered from the Publisher, Distributor, and Subscribers
if the Subscriber is Microsoft SQL Server 7.0 or later.
For pull subscriptions, tracer token statistics are gathered from Subscribers only if the Subscriber is SQL
Server 2005 or later. If the Subscriber is SQL Server 7.0 or Microsoft SQL Server 2000, statistics are
gathered only from the Publisher and Distributor.
There are also a number of other issues and restrictions to be aware of:
Subscriptions must be active to receive a tracer token. A subscription is active if it has been initialized.
Reinitialization removes any pending tracer tokens for the relevant subscriptions.
Subscribers only receive tracer tokens that were created after their initial synchronization.
Tracer tokens are not forwarded by republishing Subscribers.
After failover to a secondary, Replication Monitor is unable to adjust the name of the publishing instance of
SQL Server and will continue to display replication information under the name of the original primary
instance of SQL Server. After failover, a tracer token cannot be entered by using the Replication Monitor,
however a tracer token entered on the new publisher by using Transact-SQL, is visible in Replication
Monitor.
Using SQL Server Replication Monitor
For information about starting Replication Monitor, see Start the Replication Monitor.
To insert a tracer token and view information on the token
1. Expand a Publisher group in the left pane, expand a Publisher, and then click a publication.
2. Click the Tracer Tokens tab.
3. Click Insert Tracer.
4. View elapsed time for the tracer token in the following columns: Publisher to Distributor, Distributor to
Subscriber, Total Latency. A value of Pending indicates that the token has not reached a given point.
To view information on a tracer token inserted previously
1. Expand a Publisher group in the left pane, expand a Publisher, and then click a publication.
2. Click the Tracer Tokens tab.
3. Select a time from the Time inserted drop-down list.
4. View elapsed time for the tracer token in the following columns: Publisher to Distributor, Distributor to
Subscriber, Total Latency. A value of Pending indicates that the token has not reached a given point.
NOTE
Tracer token information is retained for the same time period as other historical data, which is governed by the
history retention period of the distribution database. For information about changing distribution database
properties, see View and Modify Distributor and Publisher Properties.
Using Transact-SQL
To post a tracer token to a transactional publication
1. (Optional) At the Publisher on the publication database, execute sp_helppublication (Transact-SQL). Verify
that the publication exists and that the status is active.
2. (Optional) At the Publisher on the publication database, execute sp_helpsubscription (Transact-SQL). Verify
that the subscription exists and that the status is active.
3. At the Publisher on the publication database, execute sp_posttracertoken (Transact-SQL), specifying
@publication. Note the value of the @tracer_token_id output parameter.
To determine latency and validate connections for a transactional publication
1. Post a tracer token to the publication using the previous procedure.
2. At the Publisher on the publication database, execute sp_helptracertokens (Transact-SQL), specifying
@publication. This returns a list of all tracer tokens posted to the publication. Note the desired tracer_id
in the result set.
3. At the Publisher on the publication database, execute sp_helptracertokenhistory (Transact-SQL), specifying
@publication and the tracer token ID from step 2 for @tracer_id. This returns latency information for the
selected tracer token.
To remove tracer tokens
1. At the Publisher on the publication database, execute sp_helptracertokens (Transact-SQL), specifying
@publication. This returns a list of all tracer tokens posted to the publication. Note the tracer_id for the
tracer token to delete in the result set.
2. At the Publisher on the publication database, execute sp_deletetracertokenhistory (Transact-SQL), specifying
@publication and the ID of the tracer to delete from step 2 for @tracer_id.
Example (Transact-SQL )
This example posts a tracer token record and uses the returned ID of the posted tracer token to view latency
information.
DECLARE @publication AS sysname;
DECLARE @tokenID AS int;
SET @publication = N'AdvWorksProductTran';
USE [AdventureWorks2012]
-- Insert a new tracer token in the publication database.
EXEC sys.sp_posttracertoken
@publication = @publication,
@tracer_token_id = @tokenID OUTPUT;
SELECT 'The ID of the new tracer token is ''' +
CONVERT(varchar,@tokenID) + '''.'
GO
-- Wait 10 seconds for the token to make it to the Subscriber.
WAITFOR DELAY '00:00:10';
GO
-- Get latency information for the last inserted token.
DECLARE @publication AS sysname;
DECLARE @tokenID AS int;
SET @publication = N'AdvWorksProductTran';
CREATE TABLE #tokens (tracer_id int, publisher_commit datetime)
-- Return tracer token information to a temp table.
INSERT #tokens (tracer_id, publisher_commit)
EXEC sys.sp_helptracertokens @publication = @publication;
SET @tokenID = (SELECT TOP 1 tracer_id FROM #tokens
ORDER BY publisher_commit DESC)
DROP TABLE #tokens
-- Get history for the tracer token.
EXEC sys.sp_helptracertokenhistory
@publication = @publication,
@tracer_id = @tokenID;
GO
Using Replication Management Objects (RMO)
To post a tracer token to a transactional publication
1. Create a connection to the Publisher by using the ServerConnection class.
2. Create an instance of the TransPublication class.
3. Set the Name and DatabaseName properties for the publication, and set the ConnectionContext property to
the connection created in step 1.
4. Call the LoadProperties method to get the properties of the object. If this method returns false, either the
publication properties in step 3 were defined incorrectly or the publication does not exist.
5. Call the PostTracerToken method. This method inserts a tracer token into the publication's transaction log.
To determine latency and validate connections for a transactional publication
1. Create a connection to the Distributor by using the ServerConnection class.
2. Create an instance of the PublicationMonitor class.
3. Set the Name, DistributionDBName, PublisherName, and PublicationDBName properties, and set the
ConnectionContext property to the connection created in step 1.
4. Call the LoadProperties method to get the properties of the object. If this method returns false, either the
publication monitor properties in step 3 were defined incorrectly or the publication does not exist.
5. Call the EnumTracerTokens method. Cast the returned ArrayList object to an array of TracerToken objects.
6. Call the EnumTracerTokenHistory method. Pass a value of TracerTokenId for a tracer token from step 5. This
returns latency information for the selected tracer token as a DataSet object. If all tracer token information
is returned, the connection between the Publisher and Distributor and the connection between the
Distributor and the Subscriber both exist and the replication topology is functioning.
To remove tracer tokens
1. Create a connection to the Distributor by using the ServerConnection class.
2. Create an instance of the PublicationMonitor class.
3. Set the Name, DistributionDBName, PublisherName, and PublicationDBName properties, and set the
ConnectionContext property to the connection created in step 1.
4. Call the LoadProperties method to get the properties of the object. If this method returns false, either the
publication monitor properties in step 3 were defined incorrectly or the publication does not exist.
5. Call the EnumTracerTokens method. Cast the returned ArrayList object to an array of TracerToken objects.
6. Call the CleanUpTracerTokenHistory method. Pass one of the following values:
The TracerTokenId for a tracer token from step 5. This deletes information for a selected token.
A DateTime object. This deletes information for all tokens older than the specified date and time.
Monitor Replication Agents
3/24/2017 • 2 min to read • Edit Online
Microsoft SQL Server Replication Monitor provides a systemic view of replication activity, but also makes it
straightforward to find information on a specific agent. The following list includes each agent, the tabs in the
Replication Monitor on which it can be found, and a link to a topic that explains how to access these tabs:
The following agents are associated with publications in Replication Monitor:
Snapshot Agent
Log Reader Agent
Queue Reader Agent
Access information and tasks associated with these agents through the following tabs: Agents
(available for each Publisher and publication) and Warnings (available for each publication). For
more information, see View Information and Perform Tasks for the Agents Associated With a
Publication (Replication Monitor).
The following agents are associated with subscriptions in Replication Monitor:
Distribution Agent
Merge Agent
Access information and tasks associated with these agents through the following tabs: Subscription
Watch List (available for each Publisher) or the All Subscriptions tab (available for each
publication). For more information, see View Information and Perform Tasks for the Agents
Associated With a Subscription (Replication Monitor).
Using SQL Server Management Studio to Monitor Replication Agents
Microsoft SQL Server Management Studio provides the following dialog boxes for monitoring replication agents:
View Snapshot Agent Status (for all publications)
View Log Reader Agent Status (for all transactional publications)
View Synchronization Status (for all subscriptions; this dialog box allows access to the Distribution Agent
and the Merge Agent)
Replication Monitor provides additional information about each agent and provides monitoring for the
Queue Reader Agent, if it is used. For more information, see View Information and Perform Tasks for the
Agents Associated With a Publication (Replication Monitor), View Information and Perform Tasks for the
Agents Associated With a Publication (Replication Monitor), and View Information and Perform Tasks for the
Agents Associated With a Subscription (Replication Monitor).
To monitor the Snapshot Agent and Log Reader Agent
1. Connect to the Publisher in Management Studio, and then expand the server node.
2. Expand the Replication folder, and then expand the Local Publications folder.
3. Right-click a publication, and then click View Log Reader Agent Status or View Snapshot Agent Status.
4. In the View Log Reader Agent Status or View Snapshot Agent Status dialog box:
View agent status.
Start or stop the agent if necessary.
Click Monitor to launch Replication Monitor.
5. Click Close.
To monitor the Distribution Agent and Merge Agent (from the Publisher)
1. Connect to the Publisher in Management Studio, and then expand the server node.
2. Expand the Replication folder, and then expand the Local Publications folder.
3. Expand the publication for the subscription you want to monitor.
4. Right-click the subscription, and then click View Synchronization Status.
5. In the View Synchronization Status dialog box:
View agent status.
Start or stop the agent if necessary.
For push subscriptions, click Monitor to launch Replication Monitor.
For pull subscriptions, click View Job History to launch the Log File Viewer, which displays output
from the agent log.
6. Click Close.
To monitor the Distribution Agent and Merge Agent (from the Subscriber)
1. Connect to the Subscriber in Management Studio, and then expand the server node.
2. Expand the Replication folder, and then expand the Local Subscriptions folder.
3. Right-click the subscription you want to monitor, and then click View Synchronization Status.
4. In the View Synchronization Status dialog box:
View agent status.
Start or stop the agent if necessary.
Click View Job History to launch the Log File Viewer, which displays output from the agent log.
5. Click Close.
See Also
Monitoring Replication
Replication Agents Overview
Programmatically Monitor Replication
3/24/2017 • 10 min to read • Edit Online
Replication Monitor is a graphical tool that allows you to monitor a replication topology. You can access the same
monitoring data programmatically by using Transact-SQL replication stored procedures or replication
management objects (RMO). These objects enable you to program the following tasks:
Monitor the state of Publishers, publications, and subscriptions.
Monitor Merge Agent sessions at one or more Subscribers.
Monitor transactional commands waiting to be applied at one or more Subscribers.
Define the threshold metrics that determine when a publication requires intervention.
Monitor the status of tracer tokens.
In this topic:
Transact-SQL
Replication Management Objects (RMO)
Transact-SQL
To monitor Publishers, publications, and subscriptions from the Distributor
1. At the Distributor on the distribution database, execute sp_replmonitorhelppublisher. This returns
monitoring information for all Publishers using this Distributor. To limit the result set to a single Publisher,
specify @publisher.
2. At the Distributor on the distribution database, execute sp_replmonitorhelppublication. This returns
monitoring information for all publications using this Distributor. To limit the result set to a single Publisher,
publication, or published database, specify @publisher, @publication, or @publisher_db, respectively.
3. At the Distributor on the distribution database, execute sp_replmonitorhelpsubscription. This returns
monitoring information for all subscriptions using this Distributor. To limit the result set to subscriptions
belonging to a single Publisher, publication, or published database, specify @publisher, @publication, or
@publisher_db, respectively.
To monitor transactional commands waiting to be applied at the Subscriber
1. At the Distributor on the distribution database, execute sp_replmonitorsubscriptionpendingcmds. This returns
monitoring information for all commands pending for all subscriptions using this Distributor. To limit the result
set to commands pending for subscriptions belonging to a single Publisher, Subscriber, publication, or
published database, specify @publisher, @subscriber, @publication, or @publisher_db, respectively.
To monitor merge changes waiting to be uploaded or downloaded
1. At the Publisher on the publication database, execute sp_showpendingchanges. This returns a result set
showing information on changes that are waiting to be replicated to Subscribers. To limit the result set to
changes that belong to a single publication or article, specify @publication or @article, respectively.
2. At a Subscriber on the subscription database, execute sp_showpendingchanges. This returns a result set
showing information on changes that are waiting to be replicated to the Publisher. To limit the result set to
changes that belong to a single publication or article, specify @publication or @article, respectively.
To monitor Merge Agent sessions
1. At the Distributor on the distribution database, execute sp_replmonitorhelpmergesession. This returns
monitoring information, including Session_id, on all Merge Agent sessions for all subscriptions using this
Distributor. You can also obtain Session_id by querying the MSmerge_sessions system table.
2. At the Distributor on the distribution database, execute sp_replmonitorhelpmergesessiondetail. Specify a
Session_id value from step 1 for @session_id. This displays detailed monitor information about the
session.
3. Repeat step 2 for each session of interest.
To monitor Merge Agent sessions for pull subscriptions from the Subscriber
1. At the Subscriber on the subscription database, execute sp_replmonitorhelpmergesession. For a given
subscription, specify @publisher, @publication, and the name of the publication database for
@publisher_db. This returns monitoring information for the last five Merge Agent sessions for this
subscription. Note the value of Session_id for sessions of interest in the result set.
2. At the Subscriber on the subscription database, execute sp_replmonitorhelpmergesessiondetail. Specify a
Session_id value from step 1 for @session_id. This displays detailed monitoring information about the
session.
3. Repeat step 2 for each session of interest.
To view and modify the monitor threshold metrics for a publication
1. At the Distributor on the distribution database, execute sp_replmonitorhelppublicationthresholds. This
returns the monitoring thresholds set for all publications using this Distributor. To limit the result set to
monitor thresholds to publications belonging to a single Publisher or published database or to a single
publication, specify @publisher, @publisher_db, or @publication, respectively. Note the value of
Metric_id for any thresholds that must be changed. For more information, see Set Thresholds and Warnings
in Replication Monitor.
2. At the Distributor on the distribution database, execute sp_replmonitorchangepublicationthreshold. Specify
the following as needed:
The Metric_id value obtained in step 1 for @metric_id.
A new value for the monitor threshold metric for @value.
A value of 1 for @shouldalert for an alert to be logged when this threshold is reached, or a value of
0 if an alert is not needed.
A value of 1 for @mode to enable the monitor threshold metric or a value of 2 to disable it.
Replication Management Objects (RMO)
To monitor a subscription to a merge publication at the Subscriber
1. Create a connection to the Subscriber by using the ServerConnection class.
2. Create an instance of the MergeSubscriberMonitor class, and set the Publisher, Publication, PublisherDB,
SubscriberDB properties for the subscription, and set the ConnectionContext property to the
ServerConnection created in step 1.
3. Call one of the following methods to return information on Merge Agent sessions for this subscription:
GetSessionsSummary - returns an array of MergeSessionSummary objects with information on up to
the last five Merge Agent sessions. Note the SessionId value for any sessions of interest.
GetSessionsSummary - returns an array of MergeSessionSummary objects with information on
Merge Agent sessions that have occurred during the past number of hours passed in as the hours
parameter (up to the last five sessions). Note the SessionId value for any sessions of interest.
GetLastSessionSummary - returns a MergeSessionSummary object with information on the last
Merge Agent session. Note the SessionId value for this session.
GetSessionsSummaryDataSet - returns a DataSet object with information on up to the last five Merge
Agent sessions, one in each row. Note the value of the Session_id column for any sessions of
interest.
GetLastSessionSummaryDataRow - returns a DataRow object with information on the last Merge
Agent session. Note the value of the Session_id column for this session.
4. (Optional) Call RefreshSessionSummary to refresh the data for the MergeSessionSummary object passed as
mss, or call RefreshSessionSummary to refresh the data in the DataRow object passed as drRefresh.
5. Using the session ID obtained in step 3, call one of the following methods to return information on the
details of a particular session:
GetSessionDetails - returns an array of MergeSessionDetail objects for the supplied SessionId.
GetSessionDetailsDataSet - returns a DataSet object with information for the specified SessionId.
To monitor replication properties for all publications at a Distributor
1. Create a connection to the Distributor by using the ServerConnection class.
2. Create an instance of the ReplicationMonitor class.
3. Set the ConnectionContext property to the ServerConnection created in step 1.
4. Call the LoadProperties method to get the properties of the object.
5. Execute one or more of the following methods to return replication information for all Publishers that use
this Distributor.
EnumDistributionAgents - returns a DataSet object that contains information about all Distribution
Agents at this Distributor.
EnumErrorRecords - returns a DataSet object that contains information about errors stored at the
Distributor.
EnumLogReaderAgents - returns a DataSet object that contains information about all Log Reader
Agents at the Distributor.
EnumMergeAgents - returns a DataSet object that contains information about all Merge Agents at the
Distributor.
EnumMiscellaneousAgents - returns a DataSet object that contains information about all other
replication agents at the Distributor.
EnumPublishers - returns a DataSet object that contains information about all Publishers at this
Distributor.
EnumPublishers2 - returns a DataSet object that returns the Publishers that use this Distributor.
EnumQueueReaderAgents - returns a DataSet object that contains information about all Queue
Reader Agents at the Distributor.
EnumQueueReaderAgentSessionDetails - returns a DataSet object that contains details about the
specified Queue Reader Agent and session.
EnumQueueReaderAgentSessions - returns a DataSet object that contains session information about
the specified Queue Reader Agent.
EnumSnapshotAgents - returns a DataSet object that contains information about all Snapshot Agents
at the Distributor.
To monitor publication properties for a specific Publisher at the Distributor
1. Create a connection to the Distributor by using the ServerConnection class.
2. Get a PublisherMonitor object in one of these ways.
Create an instance of the PublisherMonitor class. Set the Name property for the Publisher, and set the
ConnectionContext property to the ServerConnection created in step 1. Call the LoadProperties
method to get the properties of the object. If this method returns false, either the Publisher name was
defined incorrectly or the publication does not exist.
From the PublisherMonitorCollection accessed by means of the PublisherMonitors property of an
existing ReplicationMonitor object.
3. Execute one or more of the following methods to return replication information for all publications that
belong to this Publisher.
EnumDistributionAgentSessionDetails - returns a DataSet object that contains details about the
specified Distribution Agent and session.
EnumDistributionAgentSessions - returns a DataSet object that contains session information about
the specified Distribution Agent.
EnumErrorRecords - returns a DataSet object that contains error record information about the
specified error.
EnumLogReaderAgentSessionDetails - returns a DataSet object that contains details for the specified
Log Reader Agent and session.
EnumLogReaderAgentSessions - returns a DataSet object that contains session information for the
specified Log Reader Agent.
EnumMergeAgentSessionDetails - returns a DataSet object that contains details about the specified
Merge Agent and session.
EnumMergeAgentSessionDetails2 - returns a DataSet object that contains additional details about the
specified Merge Agent and session.
EnumMergeAgentSessions - returns a DataSet object that contains session information for the
specified Merge Agent.
EnumMergeAgentSessions2 - returns a DataSet object that contains additional session information
for the specified Merge Agent.
EnumPublications - returns a DataSet object that contains information about all publications at this
Distributor.
EnumPublications2 - returns a DataSet object that contains additional information about all
publications at this Distributor.
EnumSnapshotAgentSessionDetails - returns a DataSet object that contains details about the
specified Snapshot Agent and session.
EnumSnapshotAgentSessions - returns a DataSet object that contains session information for the
specified Snapshot Agent.
EnumSubscriptions - returns a DataSet object that contains information about all subscriptions to
publications at this Distributor.
To monitor properties for a specific publication at the Distributor
1. Create a connection to the Distributor by using the ServerConnection class.
2. Get a PublicationMonitor object in one of these ways.
Create an instance of the PublicationMonitor class. Set the DistributionDBName, PublisherName,
PublicationDBName, and Name properties for the publication, and set the ConnectionContext
property to the ServerConnection created in step 1. Call the LoadProperties method to get the
properties of the object. If this method returns false, either the publication properties were defined
incorrectly or the publication does not exist.
From the PublicationMonitorCollection accessed by means of the PublicationMonitors property of an
existing PublisherMonitor object.
3. Execute one or more of the following methods to return information about this publication.
EnumErrorRecords - returns a DataSet object that contains error records about the specified error.
EnumLogReaderAgent - returns a DataSet object that contains information about the Log Reader
Agent for this publication.
EnumMonitorThresholds - returns a DataSet object that contains information about the monitor
warning thresholds set for this publication.
EnumQueueReaderAgent - returns a DataSet object that contains information about the Queue
Reader Agent used by this publication.
EnumSnapshotAgent - returns a DataSet object that contains information about the Snapshot Agent
for this publication.
EnumSubscriptions - returns a DataSet object that contains information about subscriptions to this
publication.
EnumSubscriptions2 - returns a DataSet object that contains additional information about
subscriptions to this publication based on the supplied SubscriptionResultOption.
EnumTracerTokenHistory - returns a DataSet object that contains latency information for the specified
tracer token.
EnumTracerTokens - returns a DataSet object that contains information about all tracer tokens
inserted into this publication.
To monitor transactional commands that are waiting to be applied at the Subscriber
1. Create a connection to the Distributor by using the ServerConnection class.
2. Get a PublicationMonitor object in one of these ways.
Create an instance of the PublicationMonitor class. Set the DistributionDBName, PublisherName,
PublicationDBName, and Name properties for the publication, and set the ConnectionContext
property to the ServerConnection created in step 1. Call the LoadProperties method to get the
properties of the object. If this method returns false, either the publication properties were defined
incorrectly or the publication does not exist.
From the PublicationMonitorCollection accessed by means of the PublicationMonitors property of an
existing PublisherMonitor object.
3. Execute the TransPendingCommandInfo method, which returns a PendingCommandInfo object.
4. Use the properties of this PendingCommandInfo object to determine the estimated number of pending
commands and the length of time it will take to complete the delivery of these commands.
To set the monitor warning thresholds for a publication
1. Create a connection to the Distributor by using the ServerConnection class.
2. Get a PublicationMonitor object in one of these ways.
Create an instance of the PublicationMonitor class. Set the DistributionDBName, PublisherName,
PublicationDBName, and Name properties for the publication, and set the ConnectionContext
property to the ServerConnection created in step 1. Call the LoadProperties method to get the
properties of the object. If this method returns false, either the publication properties were defined
incorrectly or the publication does not exist.
From the PublicationMonitorCollection accessed by means of the PublicationMonitors property of an
existing PublisherMonitor object.
3. Execute the EnumMonitorThresholds method. Note the current threshold settings in the returned ArrayList
of MonitorThreshold objects.
4. Execute the ChangeMonitorThreshold method. Pass the following parameters:
metricID - an Int32 value that represents the monitoring threshold metric from the following table:
VALUE
DESCRIPTION
1
expiration - monitors for imminent expiration of
subscriptions to transactional publications.
2
latency - monitors for the performance of
subscriptions to transactional publications.
4
mergeexpiration - monitors for imminent expiration
of subscriptions to merge publications.
5
mergeslowrunduration - monitors the duration of
merge synchronizations over low-bandwidth (dialup)
connections.
6
mergefastrunduration - monitors the duration of
merge synchronizations over high-bandwidth (LAN)
connections.
7
mergefastrunspeed - monitors the synchronization
rate of merge synchronizations over high-bandwidth
(LAN) connections.
8
mergeslowrunspeed - monitors the synchronization
rate of merge synchronizations over low-bandwidth
(dialup) connections.
enable - Boolean value that indicates whether the metric is enabled for the publication.
thresholdValue - integer value that sets the threshold.
shouldAlert - integer that indicates whether this threshold should generate an alert.
Set Thresholds and Warnings in Replication Monitor
3/24/2017 • 4 min to read • Edit Online
Microsoft SQL Server Replication Monitor displays status information for publications and subscriptions. By
default, Replication Monitor displays warnings only for uninitialized subscriptions, but you can enable warnings
for other conditions. It is recommended that you enable warnings for your topology, so that you are informed
about status and performance in a timely manner.
When you enable a warning, you specify a threshold. When that threshold is met or exceeded, a warning is
displayed (unless an issue with a higher priority needs to be displayed). In addition to displaying a warning in
Replication Monitor, reaching a threshold can also trigger an alert. You can enable warnings for the following
conditions:
Imminent subscription expiration
This applies to all types of replication. If the specified threshold is met or exceeded, the subscription status
is displayed as Expiring soon/Expired.
Exceeding the specified latency (the amount of time that elapses between a transaction being committed at
the Publisher and the corresponding transaction being committed at the Subscriber).
This applies to transactional replication. If the specified threshold is met or exceeded, the subscription
status is displayed as Performance critical.
Exceeding the specified synchronization time.
This applies to merge replication. If the specified threshold is met or exceeded, the status is displayed as
Long-running merge. You can specify different thresholds for dialup and Local Area Network (LAN)
connections.
Falling short of processing the specified number of rows in a given amount of time.
This applies to merge replication. If the specified threshold is met or exceeded, the status is displayed as
Performance critical. You can specify different thresholds for dialup and LAN connections.
For more information on the warnings Performance critical and Long-running merge, see Monitor
Performance with Replication Monitor.
In This Topic
Set thresholds and warnings for a transactional publication
Set thresholds and warnings for a merge publication
Set thresholds and warnings for a snapshot publication
To set thresholds and warnings for a transactional publication
1. Expand a Publisher group in the left pane, expand a Publisher, and then click a publication.
2. Click the Warnings tab. To view more information about the options on this tab click Help on the menu
bar.
3. Enable a warning by selecting the appropriate check box: Warn if a subscription will expire within the
threshold or Warn if latency exceeds the threshold.
4. Set a threshold for the warnings in the Threshold column. For example, if you selected Warn if latency
exceeds the threshold in step 3, you could select a latency of 60 seconds in the Threshold column.
5. Click Save Changes.
To configure an alert for a threshold
1. Click Configure Alerts.
2. In the Configure Replication Alerts dialog box, select an alert, and then click Configure.
This dialog box displays alerts for all publication types, including alerts that are not related to monitoring
thresholds. For more information, see Use Alerts for Replication Agent Events.
3. Set options in the <AlertName> alert properties dialog box:
On the General page, click Enable; specify which database the alert should apply to.
On the Response page, specify whether an e-mail should be sent and/or a job should be executed.
On the Options page, customize the text of the response.
4. Click OK.
5. Click Close.
Set thresholds and warnings for a merge publication
1. Expand a Publisher group in the left pane, expand a Publisher, and then click a publication.
2. Click the Warnings tab. To view more information about the options on this tab, click Help on the menu
bar.
3. Enable a warning by selecting the appropriate check box:
Warn if a subscription will expire within the threshold
Warn if a merge length for dialup connections exceeds the threshold
Warn if a merge length for LAN connections exceeds the threshold
Warn if rows merged per second for LAN connections is less than the threshold
Warn if rows merged per second for dialup connections is less than the threshold
4. Set thresholds for the warnings in the Threshold column. For example, if you selected Warn if a merge
length for dialup connections exceeds the threshold in step 3, you could select a time of 10 minutes
in the Threshold column.
5. Click Save Changes.
To configure an alert for a threshold
1. Click Configure Alerts.
2. In the Configure Replication Alerts dialog box, select an alert, and then click Configure.
This dialog box displays alerts for all publication types, including alerts that are not related to monitoring
thresholds.
3. Set options in the <AlertName> alert properties dialog box:
On the General page, click Enable; specify which database the alert should apply to.
On the Response page, specify whether an e-mail should be sent and/or a job should be executed.
On the Options page, customize the text of the response.
4. Click OK.
5. Click Close.
Set thresholds and warnings for a snapshot publication
1. Expand a Publisher group in the left pane, expand a Publisher, and then click a publication.
2. Click the Warnings tab. To view more information about the options on this tab click Help on the top
menu.
3. Enable a warning by selecting the check box Warn if a subscription will expire within the threshold.
4. Set a threshold for the warning in the Threshold column. For example, you could select a value of 70% in
the Threshold column.
5. Click Save Changes.
To configure an alert for a threshold
1. Click Configure Alerts.
2. In the Configure Replication Alerts dialog box, select an alert, and then click Configure.
This dialog box displays alerts for all publication types, including alerts that are not related to monitoring
thresholds. For more information, see Use Alerts for Replication Agent Events.
3. Set options in the <AlertName> alert properties dialog box:
On the General page, click Enable; specify which database the alert should apply to.
On the Response page, specify whether an e-mail should be sent and/or a job should be executed.
On the Options page, customize the text of the response.
4. Click OK.
5. Click Close.
See Also
Monitoring Replication
Caching, Refresh, and Replication Monitor
Performance
3/24/2017 • 2 min to read • Edit Online
Microsoft SQL Server Replication Monitor is designed to efficiently monitor a large number of computers in a
production system. The queries that Replication Monitor uses to perform calculations and gather data are cached
and refreshed on a periodic basis. Caching reduces the number of queries and calculations required as you view
different pages in Replication Monitor and allows monitoring to scale well for multiple users.
Cache refresh is handled by a SQL Server Agent job, the Replication monitoring refresher for distribution.
The job runs continuously, but the cache refresh schedule is based on waiting a certain amount time after the
previous refresh:
If there were agent history changes since the cache was last created, the wait time is the minimum of: 4
seconds; or the amount of time taken to create the previous cache.
If there were no agent history changes since the cache was last created (there could have been other
changes), the wait time is the maximum of: 30 seconds; or the amount of time taken to create the previous
cache.
Refreshing the Replication Monitor User Interface
The Replication Monitor user interface can be refreshed in the following ways:
The main Replication Monitor window (including all tabs), automatically refreshes by default every five
seconds. Automatic refreshes do not force a refresh of the cache; the user interface displays the most recent
version of the data from the cache. You can customize the refresh rate used for all windows associated with
a Publisher by editing the Publisher settings. You can also disable automatic refreshes for a Publisher.
The detail windows that are launched from Replication Monitor are not automatically refreshed by default,
with the exception of windows related to merge subscriptions that are synchronizing. If you specify that
detail windows should automatically refresh, they refresh on the same schedule as the main Replication
Monitor window.
All windows can be manually refreshed by pressing F5 or by right-clicking a node in the Replication
Monitor tree and clicking Refresh. Manual refreshes force a refresh of the cache.
For more information, see Refresh Data in Replication Monitor.
Performance Considerations
Although Replication Monitor is designed to run efficiently, be aware of the following:
If you have a large number of publications or subscriptions, consider setting a less frequent automatic
refresh schedule for the user interface.
Avoid concurrently running multiple instances of Replication Monitor.
Avoid registering a large number of Distributors and setting Replication Monitor to automatically connect
to all of them.
See Also
Run Replication Maintenance Jobs (SQL Server Management Studio)
Monitoring Replication
View Publication and Subscription Status in
Replication Monitor
3/24/2017 • 2 min to read • Edit Online
Microsoft SQL Server Replication Monitor displays status information for publications and subscriptions:
The status of a publication is determined by the highest priority status of its subscriptions. For example, if
one subscription to a publication has an error and another has a performance issue, a status of error is
displayed for the publication.
The status of a subscription is determined by the status of the agents that service the subscription. For
merge replication, this is the Merge Agent. For transactional replication, this is either the Log Reader Agent
or the Distribution Agent (the higher priority status is displayed; the status can also be determined by the
Queue Reader Agent if queued updating subscriptions are used). For snapshot replication, this is the
Snapshot Agent or the Distribution Agent (the higher priority status is displayed).
Tables in the following sections list the possible status values for publications and subscriptions. Three of the
status values are displayed only if a threshold is met or exceeded:
Expiring subscription
This status value applies to all types of replication. For more information, see Set Thresholds and Warnings
in Replication Monitor.
Performance critical
This status value applies to transactional replication and merge replication. For more information, see
Monitor Performance with Replication Monitor.
Long-running merge
This status value applies to merge replication. For more information, see Monitor Performance with
Replication Monitor.
In addition to publication and subscription status, merge replication provides article-level statistics, which
give detailed information about: how much longer a merge phase will take to complete; how much time was
spent processing a given article; the type of connection a Subscriber is using; and other important
information. The statistics are displayed in the Merge Agent window in Replication Monitor. Snapshot and
transactional replication provide detailed information on Distribution Agent processing.
To view publication and subscription status
Replication Monitor: View Information and Perform Tasks for a Publication (Replication Monitor) and View
Information and Perform Tasks for a Subscription (Replication Monitor)
To view detailed information for agents
Replication Monitor: View Information and Perform Tasks for the Agents Associated With a Publication
(Replication Monitor) and View Information and Perform Tasks for the Agents Associated With a
Subscription (Replication Monitor).
Publication Status Values
The following table shows publication status values and their corresponding icons in priority order.
STATUS
ICON
Error
Performance critical
Retrying failed command
OK
none
Subscription Status Values
The following tables show subscription status values and their corresponding icons in priority order. It is possible
for a subscription to be in two states at the same time, such as Expiring soon/Expired and Retrying failed
command; the highest priority status is displayed.
The status values Performance critical, Expiring soon/Expired, and Uninitialized are warnings. When a
warning is displayed, Replication Monitor also displays whether an agent is running. For example, the status could
be Running, Performance critical.
Transactional subscriptions
STATUS
ICON
Error
Performance critical
Expiring soon/Expired
Uninitialized subscription
Retrying failed command
Not running
Running
Merge subscriptions
STATUS
Error
Performance critical
Long-running merge
Expiring soon/Expired
Uninitialized subscription
Retrying failed command
ICON
STATUS
ICON
Synchronizing
Not Synchronizing
Snapshot subscriptions
STATUS
Error
Expiring soon/Expired
Uninitialized subscription
Retrying failed command
Synchronizing
Not Synchronizing
See Also
Monitoring Replication
ICON
View Information and Perform Tasks for a Publisher
(Replication Monitor)
3/24/2017 • 1 min to read • Edit Online
Replication Monitor provides the following tabs that display information about the selected Publisher:
Publications
This tab displays information about all publications at the selected Publisher.
Subscription Watch List
This tab is intended to display information about subscriptions from all publications available at the selected
Publisher that have errors, warnings, or the poorest performance. This tab is not displayed for Distributors
running versions prior to Microsoft SQL Server 2005.
Agents tab
This tab displays detailed information about the agents and jobs that are used by all types of replication. The
tab also allows you to start and stop each agent and job.
To view more information about the options on each tab, click the tab in the right pane, and then click Help
on the menu bar. For information about starting Replication Monitor, see Start the Replication Monitor.
To view information and perform tasks for a Publisher
1. Expand a Publisher group in the left pane, and then click a Publisher.
2. To view information about all publications, click the Publications tab.
3. To view information about subscriptions, click the Subscription Watch List tab. You can also access more
detailed information and perform tasks from this tab:
To view detailed information about the agent associated with a subscription, right-click the
subscription, and then click View Details.
To view the properties of a subscription, right-click the subscription, and then click Properties.
To synchronize a push subscription, right-click the subscription, and then click Start Synchronizing.
To reinitialize a subscription, right-click the subscription, and then click Reinitialize Subscription.
4. To view information about agents, click the Agents tab. You can also access more detailed information and
perform tasks on this tab:
To view detailed information about an agent (such as informational messages and any error
messages), right-click the agent, and then click View Details.
To view detailed information about the job that runs the agent (such as the schedule, job step details,
and so on), right-click the agent, and then click Properties.
To manage profiles for the agent, right-click the agent, and then click Agent Profile. For more
information, see Work with Replication Agent Profiles.
To start an agent that is not running, right-click the agent, and then click Start Agent.
To stop an agent that is running, right-click the agent, and then click Stop Agent.
See Also
View and Modify Distributor and Publisher Properties
Monitoring Replication
View Information and Perform Tasks for a Publication
(Replication Monitor)
3/24/2017 • 1 min to read • Edit Online
Replication Monitor provides the following tabs that include information about the selected publication:
All Subscriptions
This tab displays information about all subscriptions to the selected publication.
Agents
This tab displays information about all agents used by a publication:
The Snapshot Agent, which is used by all publications.
The Log Reader Agent, which is used by all transactional publications.
The Queue Reader Agent, which is used by transactional publications that have queued updating
subscriptions.
Warnings (for Distributors running SQL Server 2005 and later)
This tab allows you to specify warnings and alerts for agents.
Tracer Tokens (transactional replication only, for Distributors running SQL Server 2005 and later)
This tab allows you to measure latency, the amount of time that elapses between a transaction being
committed at the Publisher and the corresponding transaction being committed at the Subscriber.
For more information about the options on each tab, click the tab in the right pane, and then click Help on
the menu bar. For information about starting Replication Monitor, see Start the Replication Monitor.
To view information and perform tasks for a publication
1. Expand a Publisher group in the left pane, expand a Publisher, and then click a publication.
2. To view and modify publication properties, right-click the publication, and then click Properties.
3. To view information about subscriptions, click the All Subscriptions tab.
To view and modify subscription properties, right-click the subscription, and then click Properties. You can
also access more detailed information and perform tasks on this tab. For more information, see View
Information and Perform Tasks for the Agents Associated With a Subscription (Replication Monitor).
4. To view information about agents, click the Agents tab. You can also access more detailed information and
perform tasks on this tab. For more information, see View Information and Perform Tasks for the Agents
Associated With a Publication (Replication Monitor).
5. To view information about agent warnings and thresholds, click the Warnings tab. For more information,
see Set Thresholds and Warnings in Replication Monitor.
6. To view information about tracer tokens, click the Tracer Tokens tab. For more information about how to
use tracer tokens, see Measure Latency and Validate Connections for Transactional Replication.
See Also
View and Modify Publication Properties
Monitoring Replication
View Information and Perform Tasks for Publication
Agents
3/29/2017 • 1 min to read • Edit Online
Replication Monitor provides the Agents tab, which includes information about the agents associated with the
selected publication. The Distribution Agent and Merge Agent are associated with subscriptions; for more
information, see View Information and Perform Tasks for the Agents Associated With a Subscription (Replication
Monitor).
This tab displays information about the following agents:
The Snapshot Agent, which is used by all publications.
The Log Reader Agent, which is used by all transactional publications.
The Queue Reader Agent, which is used by transactional publications enabled for queued updating
subscriptions.
To view more information about the options on this tab, click Help on the menu bar. For information
about starting Replication Monitor, see Start the Replication Monitor.
To view information and perform tasks for the agents associated with a publication
1. Expand a Publisher group in the left pane, expand a Publisher, and then click a publication.
2. Click the Agents tab to view information about agents. You can also access more detailed information and
perform tasks on this tab:
To view detailed information about an agent (such as informational messages and any error
messages), right-click the agent, and then click View Details.
To view detailed information about the job that runs the agent (such as the schedule, job step
details, and so on), right-click the agent, and then click Properties.
To manage profiles for the agent, right-click the agent, and then click Agent Profile. For more
information, see Work with Replication Agent Profiles.
To start an agent that is not running, right-click the agent, and then click Start Agent.
To stop an agent that is running, right-click the agent, and then click Stop Agent.
See Also
Set Thresholds and Warnings in Replication Monitor
View Information and Perform Tasks for a Publication (Replication Monitor)
Replication Agent Administration
Monitoring Replication
View Information and Perform Tasks for a
Subscription (Replication Monitor)
3/24/2017 • 1 min to read • Edit Online
Replication Monitor provides the following tabs that include information about subscriptions:
All Subscriptions
This tab displays information about all subscriptions to the selected publication.
Subscription Watch List
This tab is intended to display information about subscriptions from all publications available at the
selected Publisher that have errors, warnings, or the poorest performance. This tab is not displayed for
Distributors running versions prior to Microsoft SQL Server 2005.
For more information about the options on each tab, click the tab in the right pane, and then click Help on
the menu bar. For information about starting Replication Monitor, see Start the Replication Monitor.
To view information and perform tasks for subscriptions in the All Subscriptions tab
1. Expand a Publisher group in the left pane, expand a Publisher, and then click a publication.
2. To view information about subscriptions, click the All Subscriptions tab. To view only those subscriptions
in a given state, such as synchronizing, select an option from the Show drop-down list.
3. To view and modify subscription properties, right-click the subscription, and then click Properties. You can
also access more detailed information and perform tasks on this tab. For more information, see View
Information and Perform Tasks for the Agents Associated With a Subscription (Replication Monitor).
To view information and perform tasks for subscriptions in the Subscription Watch List tab
1. Expand a Publisher group in the left pane, and then click a Publisher.
2. To view information about subscriptions, click the Subscription Watch List tab.
3. Select the type of subscription to display from the Show <SubscriptionType> Subscriptions drop-down
list. To view only those subscriptions in a given state, such as synchronizing, select an option from the
Show drop-down list.
4. To view and modify subscription properties, right-click the subscription, and then click Properties. You can
also access more detailed information and perform tasks on this tab. For more information, see View
Information and Perform Tasks for the Agents Associated With a Subscription (Replication Monitor).
See Also
View and Modify Push Subscription Properties
View and Modify Pull Subscription Properties
Monitoring Replication
View Information and Perform Tasks for Subscription
Agents
3/29/2017 • 2 min to read • Edit Online
Replication Monitor provides two tabs that allow access to information about the agent(s) associated with a
subscription:
All Subscriptions
This tab displays information about all subscriptions to the selected publication.
Subscription Watch List
This tab is intended to display information about subscriptions from all publications available at the
selected Publisher that have errors, warnings, or the poorest performance. This tab is not displayed for
Distributors running versions prior to Microsoft SQL Server 2005.
For more information about the options on each tab, click the tab in the right pane, and then click Help
on the menu bar. For information about starting Replication Monitor, see Start the Replication Monitor.
To view information and perform tasks for the agents associated with a subscription (All Subscriptions tab)
1. Expand a Publisher group in the left pane, expand a Publisher, and then click a publication.
2. Click the All Subscriptions tab to view information about subscriptions. You can also access more
detailed information and perform tasks on this tab:
To view detailed information about the agent associated with a subscription, right-click the
subscription, and then click View Details. Detailed information includes: agent history and error
messages; performance statistics for transactional replication; and article-level synchronization
statistics for merge replication.
The tabs on the detail window that is launched depend on the type of subscription: for snapshot
subscriptions, the tab is Distributor to Subscriber History; for transactional subscriptions, the
tabs are Publisher to Distributor History, Distributor to Subscriber History, and
Undistributed Commands; for merge subscriptions, the tab is Synchronization History.
To synchronize a push subscription, right-click the subscription, and then click Start
Synchronizing.
To reinitialize a subscription, right-click the subscription, and then click Reinitialize Subscription.
To validate a single merge subscription, right-click the subscription, and then click Validate
Subscription. To validate all subscriptions to a merge publication, right-click the publication, and
then click Validate All Subscriptions; to validate all subscriptions for a transactional publication,
right-click the publication, and then click Validate Subscriptions.
To manage profiles for the agent, right-click the agent, and then click Agent Profile. For more
information, see Work with Replication Agent Profiles.
To view information and perform tasks for the agents associated with a subscription (Subscription Watch List
tab)
1. Expand a Publisher group in the left pane, and then click a Publisher.
2. Click the Subscription Watch List tab to view information about subscriptions. You can also access
more detailed information and perform tasks on this tab:
To view detailed information about the agent associated with a subscription, right-click the
subscription, and then click View Details. Detailed information includes: agent history and error
messages; performance statistics for transactional replication; and article-level synchronization
statistics for merge replication.
The tabs on the detail window that is launched depend on the type of subscription: for snapshot
subscriptions, the tab is Distributor to Subscriber History; for transactional subscriptions, the
tabs are Publisher to Distributor History, Distributor to Subscriber History, and
Performance; for merge subscriptions, the tab is Synchronization History.
To synchronize a push subscription, right-click the subscription, and then click Start
Synchronizing.
To reinitialize a subscription, right-click the subscription, and then click Reinitialize Subscription.
To validate a single merge subscription, right-click the subscription, and then click Validate
Subscription. To validate all subscriptions to a merge publication, right-click the publication, and
then click Validate All Subscriptions; to validate all subscriptions for a transactional publication,
right-click the publication, and then click Validate Subscriptions.
To manage profiles for the agent, right-click the agent, and then click Agent Profile. For more
information, see Work with Replication Agent Profiles.
See Also
View Information and Perform Tasks for a Subscription (Replication Monitor)
Monitoring Replication
View Replicated Commands and Information in
Distribution Database
3/29/2017 • 1 min to read • Edit Online
When using transactional replication, transaction commands are stored in the distribution database until the
Distribution Agent propagates them to all Subscribers or a Distribution Agent at the Subscriber pulls the changes.
These pending commands in the distribution database can be viewed programmatically using replication stored
procedures. For more information, see Replication Stored Procedures (Transact-SQL).
To view replicated commands from all transactional publications in the distribution database
1. At the Distributor on the distribution database, execute sp_browsereplcmds.
To view replicated commands in the distribution database from a specific article or from a specific database
published using transactional replication
1. (Optional) At the Publisher on the publication database, execute sp_helparticle. Specify @publication and
@article. Note the value of article id in the result set.
2. At the Distributor on the distribution database, execute sp_browsereplcmds. (Optional) Specify the article ID
from step 2 for @article_id. (Optional) Specify the ID of the publication database for
@publisher_database_id, which can be obtained from the database_id column in the sys.databases
catalog view.
See Also
Programmatically Monitor Replication
Monitoring Replication with System Monitor
3/24/2017 • 1 min to read • Edit Online
Microsoft Windows System Monitor allows you to use graphs, charts, and reports to gauge the efficiency of your
computer, and identify and troubleshoot possible problems (such as unbalanced resource use, insufficient
hardware, or poor program design), and plan for additional hardware needs. For more information, see Monitor
Resource Usage (System Monitor).
System Monitor uses performance objects and counters, which provide information on the performance of various
processes. You can measure replication performance through counters associated with the replication agents:
AGENT
PERFORMANCE OBJECT
COUNTER
DESCRIPTION
All agents
Microsoft SQL Server:
Replication Agents
Running
The number of replication
agents currently running.
Snapshot Agent
SQL Server: Replication
Snapshot
Snapshot: Delivered
Cmds/sec
The number of commands
per second delivered to the
Distributor.
Snapshot Agent
SQL Server: Replication
Snapshot
Snapshot: Delivered
Trans/sec
The number of transactions
per second delivered to the
Distributor.
Log Reader Agent
SQL Server: Replication
Logreader
Logreader: Delivered
Cmds/sec
The number of commands
per second delivered to the
Distributor.
Log Reader Agent
SQL Server: Replication
Logreader
Logreader: Delivered
Trans/sec
The number of transactions
per second delivered to the
Distributor.
Log Reader Agent
SQL Server: Replication
Logreader
Logreader: Delivery Latency
The current amount of time,
in milliseconds, elapsed from
when transactions are
applied at the Publisher to
when they are delivered to
the Distributor.
Distribution Agent
SQL Server: Replication Dist.
Dist: Delivered Cmds/sec
The number of commands
per second delivered to the
Subscriber.
Distribution Agent
SQL Server: Replication Dist.
Dist: Delivered Trans/sec
The number of transactions
per second delivered to the
Subscriber.
Distribution Agent
SQL Server: Replication Dist.
Dist: Delivery Latency
The current amount of time,
in milliseconds, elapsed from
when transactions are
delivered to the Distributor
to when they are applied at
the Subscriber.
AGENT
PERFORMANCE OBJECT
COUNTER
DESCRIPTION
Merge Agent
SQL Server: Replication
Merge
Conflicts/sec
The number of conflicts per
second occurring during the
merge process.
Merge Agent
SQL Server: Replication
Merge
Downloaded Changes/sec
The number of rows per
second replicated from the
Publisher to the Subscriber.
Merge Agent
SQL Server: Replication
Merge
Uploaded Changes/sec
The number of rows per
second replicated from the
Subscriber to the Publisher.
See Also
Monitoring (Replication)