Table of Contents
Overview
Replication Agents Overview
Replication Distribution Agent
Replication Log Reader Agent
Replication Merge Agent
Replication Queue Reader Agent
Replication Snapshot Agent
Replication Agent Administration
Replication Agent Profiles
Use Alerts for Replication Agent Events
Work with Replication Agent Profiles
Start and Stop a Replication Agent (SQL Server Management Studio)
View and Modify Replication Agent Command Prompt Parameters (SQL Server
Management Studio)
Replication Agents
3/24/2017 • 1 min to read • Edit Online
Replication uses many stand-alone programs, which are named "agents," to perform the tasks associated with
tracking changes and distributing data. This section of the documentation contains parameter references for the
following replication agents.
In This Section
Replication Agents Overview
Replication Distribution Agent
Replication Log Reader Agent
Replication Merge Agent
Replication Queue Reader Agent
Replication Snapshot Agent
Replication Agent Administration
Replication Agents Overview
3/24/2017 • 2 min to read • Edit Online
Replication uses a number of standalone programs, called agents, to carry out the tasks associated with tracking
changes and distributing data. By default, replication agents run as jobs scheduled under SQL Server Agent, and
SQL Server Agent must be running for the jobs to run. Replication agents can also be run from the command line
and by applications that use Replication Management Objects (RMO). Replication agents can be administered from
SQL Server Replication Monitor and SQL Server Management Studio.
SQL Server Agent
SQL Server Agent hosts and schedules the agents used in replication and provides an easy way to run replication
agents. SQL Server Agent also controls and monitors operations outside of replication. For more information, see
Configure SQL Server Agent.
IMPORTANT
By default, the SQL Server Agent service is disabled when SQL Server is installed unless you explicitly choose to autostart the
service during installation. For more information about starting the SQL Server Agent service, see Start, Stop, or Pause the
SQL Server Agent Service.
Snapshot Agent
The Snapshot Agent is typically used with all types of replication. It prepares schema and initial data files of
published tables and other objects, stores the snapshot files, and records information about synchronization in the
distribution database. The Snapshot Agent runs at the Distributor. For more information, see Replication Snapshot
Agent.
Log Reader Agent
The Log Reader Agent is used with transactional replication. It moves transactions marked for replication from the
transaction log on the Publisher to the distribution database. Each database published using transactional
replication has its own Log Reader Agent that runs on the Distributor and connects to the Publisher (the Distributor
can be on the same computer as the Publisher). For more information, see Replication Log Reader Agent.
Distribution Agent
The Distribution Agent is used with snapshot replication and transactional replication. It applies the initial snapshot
to the Subscriber and moves transactions held in the distribution database to Subscribers. The Distribution Agent
runs at either the Distributor for push subscriptions or at the Subscriber for pull subscriptions. For more
information, see Replication Distribution Agent.
Merge Agent
The Merge Agent is used with merge replication. It applies the initial snapshot to the Subscriber and moves and
reconciles incremental data changes that occur. Each merge subscription has its own Merge Agent that connects to
both the Publisher and the Subscriber and updates both. The Merge Agent runs at either the Distributor for push
subscriptions or the Subscriber for pull subscriptions. By default, the Merge Agent uploads changes from the
Subscriber to the Publisher and then downloads changes from the Publisher to the Subscriber. For more
information, see Replication Merge Agent.
Queue Reader Agent
The Queue Reader Agent is used with transactional replication with the queued updating option. The agent runs at
the Distributor and moves changes made at the Subscriber back to the Publisher. Unlike the Distribution Agent and
the Merge Agent, only one instance of the Queue Reader Agent exists to service all Publishers and publications for
a given distribution database. For more information about the Queue Reader Agent, see Replication Queue Reader
Agent. For more information about updatable subscriptions, see Updatable Subscriptions for Transactional
Replication.
Replication Maintenance Jobs
Replication has a number of maintenance jobs that perform scheduled and on-demand maintenance. For more
information, see Replication Agent Administration.
See Also
Start and Stop a Replication Agent (SQL Server Management Studio)
Run Replication Maintenance Jobs (SQL Server Management Studio)
Replication Agent Executables Concepts
Replication Agent Administration
Replication Distribution Agent
3/24/2017 • 12 min to read • Edit Online
The Replication Distribution Agent is an executable that moves the snapshot (for snapshot replication and
transactional replication) and the transactions held in the distribution database tables (for transactional
replication) to the destination tables at the Subscribers.
NOTE
Parameters can be specified in any order. When optional parameters are not specified, values from predefined registry
settings on the local computer are used.
Syntax
distrib [-?]
-Publisher server_name[\instance_name]
-PublisherDB publisher_database
-Subscriber server_name[\instance_name]
-SubscriberDB subscriber_database
[-AltSnapshotFolder alt_snapshot_folder_path]
[-BcpBatchSize bcp_batch_size]
[-CommitBatchSize commit_batch_size]
[-CommitBatchThreshold commit_batch_threshold]
[-Continuous]
[-DefinitionFile def_path_and_file_name]
[-Distributor distributor]
[-DistributorLogin distributor_login]
[-DistributorPassword distributor_password]
[-DistributorSecurityMode [0|1]]
[-EncryptionLevel [0|1|2]]
[-ErrorFile error_path_and_file_name]
[-ExtendedEventConfigFile configuration_path_and_file_name]
[-FileTransferType [0|1]]
[-FtpAddress ftp_address]
[-FtpPassword ftp_password]
[-FtpPort ftp_port]
[-FtpUserName ftp_user_name]
[-HistoryVerboseLevel [0|1|2|3]]
[-Hostname host_name]
[-KeepAliveMessageInterval keep_alive_message_interval_seconds]
[-LoginTimeOut login_time_out_seconds]
[-MaxBcpThreads]
[-MaxDeliveredTransactions number_of_transactions]
[-MessageInterval message_interval]
[-OledbStreamThreshold oledb_stream_threshold]
[-Output output_path_and_file_name]
[-OutputVerboseLevel [0|1|2]]
[-PacketSize packet_size]
[-PollingInterval polling_interval]
[-ProfileName profile_name]
[-Publication publication]
[-QueryTimeOut query_time_out_seconds]
[-QuotedIdentifier quoted_identifier]
[-SkipErrors native_error_id [:...n]]
[-SubscriberDatabasePath subscriber_path]
[-SubscriberLogin subscriber_login]
[-SubscriberPassword subscriber_password]
[-SubscriberSecurityMode [0|1]]
[-SubscriberType [0|1|3]]
[-SubscriptionStreams [1|2|...64]]
[-SubscriptionTableName subscription_table]
[-SubscriptionType [0|1|2]]
[-TransactionsPerHistory [0|1|...10000]]
[-UseDTS]
[-UseInprocLoader]
[-UseOledbStreaming]
Arguments
-?
Prints all available parameters.
-Publisher server_name[\instance_name]
Is the name of the Publisher. Specify server_name for the default instance of Microsoft SQL Server on that server.
Specify server_name\instance_name for a named instance of SQL Server on that server.
-PublisherDB publisher_database
Is the name of the Publisher database.
-Subscriber server_name[\instance_name]
Is the name of the Subscriber. Specify server_name for the default instance of SQL Server on that server. Specify
server_name\instance_name for a named instance of SQL Server on that server.
-SubscriberDB subscriber_database
Is the name of the Subscriber database.
-AltSnapshotFolder alt_snapshot_folder_path
Is the path to the folder that contains the initial snapshot for a subscription.
-BcpBatchSize bcp_batch_size
Is the number of rows to send in a bulk copy operation. When performing a bcp in operation, the batch size is the
number of rows to send to the server as one transaction, and also the number of rows that must be sent before
the Distribution Agent logs a bcp progress message. When performing a bcp out operation, a fixed batch size of
1000 is used.
-CommitBatchSize commit_batch_size
Is the number of transactions to be issued to the Subscriber before a COMMIT statement is issued. The default is
100.
-CommitBatchThreshold commit_batch_threshold
Is the number of replication commands to be issued to the Subscriber before a COMMIT statement is issued. The
default is 1000.
-Continuous
Specifies whether the agent attempts to poll replicated transactions continually. If specified, the agent polls
replicated transactions from the source at polling intervals, even if there are no transactions pending.
-DefinitionFile def_path_and_file_name
Is the path of the agent definition file. An agent definition file contains command prompt arguments for the agent.
The content of the file is parsed as an executable file. Use double quotation marks (") to specify argument values
containing arbitrary characters.
-Distributor distributor
Is the Distributor name. For Distributor (push) distribution, the name defaults to the name of the local Distributor.
-DistributorLogin distributor_login
Is the Distributor login name.
-DistributorPassword distributor_password
Is the Distributor password.
-DistributorSecurityMode [ 0| 1]
Specifies the security mode of the Distributor. A value of 0 indicates SQL Server Authentication Mode, and a value
of 1 indicates Windows Authentication Mode (default).
-EncryptionLevel [ 0 | 1 | 2 ]
Is the level of Secure Sockets Layer (SSL) encryption used by the Distribution Agent when making connections.
ENCRYPTIONLEVEL VALUE
DESCRIPTION
0
Specifies that SSL is not used.
1
Specifies that SSL is used, but the agent does not verify that
the SSL server certificate is signed by a trusted issuer.
ENCRYPTIONLEVEL VALUE
DESCRIPTION
2
Specifies that SSL is used, and that the certificate is verified.
For more information, see Security Overview (Replication).
-ErrorFile error_path_and_file_name
Is the path and file name of the error file generated by the Distribution Agent. This file is generated at any point
where failure occurred while applying replication transactions at the Subscriber; errors that occur at the Publisher
or Distributor are not logged in this file. This file contains the failed replication transactions and associated error
messages. When not specified, the error file is generated in the current directory of the Distribution Agent. The
error file name is the name of the Distribution Agent with an .err extension. If the specified file name exists, error
messages are appended to the file. This parameter can be a maximum of 256 Unicode characters.
-ExtendedEventConfigFile configuration_path_and_file_name
Specifies the path and file name for the extended events XML configuration file. The extended events
configuration file allows you to configure sessions and enable events for tracking.
-FileTransferType [ 0| 1]
Specifies the file transfer type. A value of 0 indicates UNC (universal naming convention), and a value of 1
indicates FTP (file transfer protocol).
-FtpAddress ftp_address
Is the network address of the FTP service for the Distributor. When not specified, DistributorAddress is used. If
DistributorAddress is not specified, Distributor is used.
-FtpPassword ftp_password
Is the user password used to connect to the FTP service.
-FtpPort ftp_port
Is the port number of the FTP service for the Distributor. When not specified, the default port number for FTP
service (21) is used.
-FtpUserName ftp_user_name
Is the user name used to connect to the FTP service. When not specified, anonymous is used.
-HistoryVerboseLevel [ 0 | 1 | 2 | 3 ]
Specifies the amount of history logged during a distribution operation. You can minimize the performance effect
of history logging by selecting 1.
HISTORYVERBOSELEVEL VALUE
DESCRIPTION
0
Progress messages are written either to the console or to an
output file. History records are not logged in the distribution
database.
1
Default. Always update a previous history message of the
same status (startup, progress, success, and so on). If no
previous record with the same status exists, insert a new
record.
2
Insert new history records unless the record is for such things
as idle messages or long-running job messages, in which case
update the previous records.
3
Always insert new records, unless it is for idle messages.
-Hostname host_name
Is the host name used when connecting to the Publisher. This parameter can be a maximum of 128 Unicode
characters.
-KeepAliveMessageInterval keep_alive_message_interval_seconds
Is the number of seconds before the history thread checks if any of the existing connections is waiting for a
response from the server. This value can be decreased to avoid having the checkup agent mark the Distribution
Agent as suspect when executing a long-running batch. The default is 300 seconds.
-LoginTimeOut login_time_out_seconds
Is the number of seconds before the login times out. The default is 15 seconds.
-MaxBcpThreads number_of_threads
Specifies the number of bulk copy operations that can be performed in parallel. The maximum number of threads
and ODBC connections that exist simultaneously is the lesser of MaxBcpThreads or the number of bulk copy
requests that appear in the synchronization transaction in the distribution database. MaxBcpThreads must have
a value greater than 0 and has no hard-coded upper limit. The default is 2 times the number of processors, up to a
maximum value of 8. When applying a snapshot that was generated at the Publisher using the concurrent
snapshot option, one thread is used, regardless of the number you specify for MaxBcpThreads.
-MaxDeliveredTransactions number_of_transactions
Is the maximum number of push or pull transactions applied to Subscribers in one synchronization. A value of 0
indicates that the maximum is an infinite number of transactions. Other values can be used by Subscribers to
shorten the duration of a synchronization being pulled from a Publisher.
NOTE
If -MaxDeliveredTransactions and -Continuous are both specified, the Distribution Agent delivers the specified number of
transactions and then stops (even though -Continuous is specified). You must restart the Distribution Agent after the job
completes.
-MessageInterval message_interval
Is the time interval used for history logging. A history event is logged when one of these parameters is reached:
The TransactionsPerHistory value is reached after the last history event is logged.
The MessageInterval value is reached after the last history event is logged.
If there is no replicated transaction available at the source, the agent reports a no-transaction message to
the Distributor. This option specifies how long the agent waits before reporting another no-transaction
message. Agents always report a no-transaction message when they detect that there are no transactions
available at the source after previously processing replicated transactions. The default is 60 seconds.
-OledbStreamThreshold oledb_stream_threshold
Specifies the minimum size, in bytes, for binary large object data above which the data will be bound as a
stream. You must specify –UseOledbStreaming to use this parameter. Values can range from 400 to
1048576 bytes, with a default of 16384 bytes.
-Output output_path_and_file_name
Is the path of the agent output file. If the file name is not provided, the output is sent to the console. If the
specified file name exists, the output is appended to the file.
-OutputVerboseLevel [ 0| 1| 2]
Specifies whether the output should be verbose. If the verbose level is 0, only error messages are printed. If
the verbose level is 1, all the progress report messages are printed. If the verbose level is 2 (default), all
error messages and progress report messages are printed, which is useful for debugging.
-PacketSize packet_size
Is the packet size, in bytes. The default is 4096 (bytes).
-PollingInterval polling_interval
Is how often, in seconds, the distribution database is queried for replicated transactions. The default is 5
seconds.
-ProfileName profile_name
Specifies an agent profile to use for agent parameters. If ProfileName is NULL, the agent profile is
disabled. If ProfileName is not specified, the default profile for the agent type is used. For information, see
Replication Agent Profiles.
-Publication publication
Is the name of the publication. This parameter is only valid if the publication is set to always have a
snapshot available for new or reinitialized subscriptions.
-QueryTimeOut query_time_out_seconds
Is the number of seconds before the query times out. The default is 1800 seconds.
-QuotedIdentifier quoted_identifier
Specifies the quoted identifier character to use. The first character of the value indicates the value the
Distribution Agent uses. If QuotedIdentifier is used with no value, the Distribution Agent uses a space. If
QuotedIdentifier is not used, the Distribution Agent uses whatever quoted identifier the Subscriber
supports.
-SkipErrors native_error_id [:...n]
Is a colon-separated list that specifies the error numbers to be skipped by this agent.
-SubscriberDatabasePath subscriber_database_path
Is the path to the Jet database (.mdb file) if SubscriberType is 2 (allows a connection to a Jet database
without an ODBC Data Source Name (DSN)).
-SubscriberLogin subscriber_login
Is the Subscriber login name. If SubscriberSecurityMode is 0 (for SQL Server Authentication), this
parameter must be specified.
-SubscriberPassword subscriber_password
Is the Subscriber password. If SubscriberSecurityMode is 0 (for SQL Server Authentication), this
parameter must be specified.
-SubscriberSecurityMode [ 0| 1]
Specifies the security mode of the Subscriber. A value of 0 indicates SQL Server Authentication, and a value
of 1 indicates Windows Authentication Mode (default).
-SubscriberType [ 0| 1| 3]
Specifies the type of Subscriber connection used by the Distribution Agent.
SUBSCRIBERTYPE VALUE
DESCRIPTION
0
SQL Server
1
ODBC data source
3
OLE DB data source
-SubscriptionStreams [0|1|2|...64]
Is the number of connections allowed per Distribution Agent to apply batches of changes in parallel to a
Subscriber, while maintaining many of the transactional characteristics present when using a single thread. For a
SQL Server Publisher, a range of values from 1 to 64 is supported. This parameter is only supported when the
Publisher and Distributor are running on SQL Server 2005 or later versions. This parameter is not supported or
must be 0 for non- SQL Server Subscribers or peer-to-peer subscriptions.
NOTE
If one of the connections fails to execute or commit, all connections will abort the current batch, and the agent will use a
single stream to retry the failed batches. Before this retry phase completes, there can be temporary transactional
inconsistencies at the Subscriber. After the failed batches are successfully committed, the Subscriber is brought back to a
state of transactional consistency.
IMPORTANT
When you specify a value of 2 or greater for -SubscriptionStreams, the order in which transactions are received at the
Subscriber may differ from the order in which they were made at the Publisher. If this behavior causes constraint violations
during synchronization, you should use the NOT FOR REPLICATION option to disable the enforcement of constraints
during synchronization. For more information, see Control the Behavior of Triggers and Constraints During Synchronization
(Replication Transact-SQL Programming).
NOTE
Subscriptionstreams do not work for articles configured to deliver Transact-SQL. To use subscriptionstreams, configure
articles to deliver stored procedure calls instead.
-SubscriptionTableName subscription_table
Is the name of the subscription table generated or used at the given Subscriber. When not specified, the
MSreplication_subscriptions (Transact-SQL) table is used. Use this option for database management systems
(DBMS) that do not support long file names.
-SubscriptionType [ 0| 1| 2]
Specifies the subscription type for distribution. A value of 0 indicates a push subscription, a value of 1 indicates a
pull subscription, and a value of 2 indicates an anonymous subscription.
-TransactionsPerHistory [ 0| 1|... 10000]
Specifies the transaction interval for history logging. If the number of committed transactions after the last
instance of history logging is greater than this option, a history message is logged. The default is 100. A value of 0
indicates infinite TransactionsPerHistory. See the preceding –MessageIntervalparameter.
-UseDTS
Must be specified as a parameter for a publication that allows data transformation.
-UseInprocLoader
Improves the performance of the initial snapshot by causing the Distribution Agent to use the BULK INSERT
command when applying snapshot files to the Subscriber. This parameter is deprecated because it is not
compatible with the XML data type. If you are not replicating XML data, this parameter can be used. This
parameter cannot be used with character mode snapshots or non- SQL Server Subscribers. If you use this
parameter, the SQL Server service account at the Subscriber must have read permissions on the directory where
the snapshot .bcp data files are located. When this parameter is not used, the agent (for non- SQL Server
Subscribers) or the ODBC driver loaded by the agent (for SQL Server Subscribers) reads from the files, so the
security context of the SQL Server service account is not used.
-UseOledbStreaming
When specified, enables the binding of binary large object data as a stream. Use -OledbStreamThreshold to
specify the size, in bytes, above which a stream will be used. UseOledbStreaming is enabled by default.
UseOledbStreaming writes to the C:\Program Files\Microsoft SQL Server\\COM folder.
Remarks
IMPORTANT
If you have installed SQL Server Agent to run under a local system account rather than under a domain user account (the
default), the service can only access the local computer. If the Distribution Agent that runs under SQL Server Agent is
configured to use Windows Authentication Mode when it logs in to an instance of SQL Server, the Distribution Agent fails.
The default setting is SQL Server Authentication. For information on changing security accounts, see View and Modify
Replication Security Settings.
To start the Distribution Agent, execute distrib.exe from the command prompt. For information, see Replication
Agent Executables Concepts.
Change History
UPDATED CONTENT
Added the -ExtendedEventConfigFile parameter.
See Also
Replication Agent Administration
Replication Log Reader Agent
3/24/2017 • 6 min to read • Edit Online
The Replication Log Reader Agent is an executable that monitors the transaction log of each database configured
for transactional replication and copies the transactions marked for replication from the transaction log into the
distribution database.
NOTE
Parameters can be specified in any order. When optional parameters are not specified, predefined values based on the
default agent profile are used.
Syntax
logread [-?]
-Publisher server_name[\instance_name]
-PublisherDB publisher_database
[-Continuous]
[-DefinitionFile def_path_and_file_name]
[-Distributor server_name[\instance_name]]
[-DistributorLogin distributor_login]
[-DistributorPassword distributor_password]
[-DistributorSecurityMode [0|1]]
[-EncryptionLevel [0|1|2]]
[-ExtendedEventConfigFile configuration_path_and_file_name]
[-HistoryVerboseLevel [0|1|2]]
[-KeepAliveMessageInterval keep_alive_message_interval_seconds]
[-LoginTimeOut login_time_out_seconds]
[-LogScanThreshold scan_threshold]
[-MaxCmdsInTran number_of_commands]
[-MessageInterval message_interval]
[-Output output_path_and_file_name]
[-OutputVerboseLevel [0|1|2|3|4]]
[-PacketSize packet_size]
[-PollingInterval polling_interval]
[-ProfileName profile_name]
[-PublisherFailoverPartner server_name[\instance_name] ]
[-PublisherSecurityMode [0|1]]
[-PublisherLogin publisher_login]
[-PublisherPassword publisher_password]
[-QueryTimeOut query_time_out_seconds]
[-ReadBatchSize number_of_transactions]
[-ReadBatchThreshold read_batch_threshold]
[-RecoverFromDataErrors]
Arguments
-?
Displays usage information.
-Publisher server_name[\instance_name]
Is the name of the Publisher. Specify server_name for the default instance of Microsoft SQL Server on that server.
Specify server_name\instance_name for a named instance of SQL Server on that server.
-PublisherDB publisher_database
Is the name of the Publisher database.
-Continuous
Specifies whether the agent tries to poll replicated transactions continually. If specified, the agent polls replicated
transactions from the source at polling intervals even if there are no transactions pending.
-DefinitionFile def_path_and_file_name
Is the path of the agent definition file. An agent definition file contains command-line arguments for the agent.
The content of the file is parsed as an executable file. Use double quotation marks (") to specify argument values
that contain arbitrary characters.
-Distributor server_name[\instance_name]
Is the Distributor name. Specify server_name for the default instance of SQL Server on that server. Specify
server_name\instance_name for a named instance of SQL Server on that server.
-DistributorLogin distributor_login
Is the Distributor login name.
-DistributorPassword distributor_password
Is the Distributor password.
-DistributorSecurityMode [ 0| 1]
Specifies the security mode of the Distributor. A value of 0 indicates SQL Server Authentication Mode (default),
and a value of 1 indicates Microsoft Windows Authentication Mode.
-EncryptionLevel [ 0 | 1 | 2 ]
Is the level of Secure Sockets Layer (SSL) encryption that is used by the Log Reader Agent when making
connections.
ENCRYPTIONLEVEL VALUE
DESCRIPTION
0
Specifies that SSL is not used.
1
Specifies that SSL is used, but the agent does not verify that
the SSL server certificate is signed by a trusted issuer.
2
Specifies that SSL is used, and that the certificate is verified.
For more information, see Security Overview (Replication).
-ExtendedEventConfigFile configuration_path_and_file_name
Specifies the path and file name for the extended events XML configuration file. The extended events configuration
file allows you to configure sessions and enable events for tracking.
-HistoryVerboseLevel [ 0| 1| 2]
Specifies the amount of history logged during a log reader operation. You can minimize the performance effect of
history logging by selecting 1.
HISTORYVERBOSELEVEL VALUE
DESCRIPTION
0
1
Default. Always update a previous history message of the
same status (startup, progress, success, and so on). If no
previous record with the same status exists, insert a new
record.
HISTORYVERBOSELEVEL VALUE
DESCRIPTION
2
Insert new history records unless the record is for such things
as idle messages or long-running job messages, in which case
update the previous records.
-KeepAliveMessageInterval keep_alive_message_interval_seconds
Is the number of seconds before the history thread checks if any of the existing connections is waiting for a
response from the server. This value can be decreased to avoid having the checkup agent mark the Log Reader
Agent as suspect when executing a long-running batch. The default is 300 seconds.
-LoginTimeOut login_time_out_seconds
Is the number of seconds before the login times out. The default is 15 seconds.
-LogScanThreshold scan_threshold
Internal use only.
-MaxCmdsInTran number_of_commands
Specifies the maximum number of statements grouped into a transaction as the Log Reader writes commands to
the distribution database. Using this parameter allows the Log Reader Agent and Distribution Agent to divide
large transactions (consisting of many commands) at the Publisher into several smaller transactions when applied
at the Subscriber. Specifying this parameter can reduce contention at the Distributor and reduce latency between
the Publisher and Subscriber. Because the original transaction is applied in smaller units, the Subscriber can
access rows of a large logical Publisher transaction prior to the end of the original transaction, breaking strict
transactional atomicity. The default is 0, which preserves the transaction boundaries of the Publisher.
NOTE
This parameter is ignored for non- SQL Server publications. For more information, see the section "Configuring the
Transaction Set Job" in Performance Tuning for Oracle Publishers.
-MessageInterval message_interval
Is the time interval used for history logging. A history event is logged when the MessageInterval value is reached
after the last history event is logged.
If there is no replicated transaction available at the source, the agent reports a no-transaction message to the
Distributor. This option specifies how long the agent waits before reporting another no-transaction message.
Agents always report a no-transaction message when they detect that there are no transactions available at the
source after previously processing replicated transactions. The default is 60 seconds.
-Output output_path_and_file_name
Is the path of the agent output file. If the file name is not provided, the output is sent to the console. If the specified
file name exists, the output is appended to the file.
-OutputVerboseLevel [ 0| 1| 2 | 3 | 4 ]
Specifies whether the output should be verbose.
VALUE
DESCRIPTION
0
Only error messages are printed.
1
All agent progress report messages are printed.
2 (default)
All error messages and agent progress report messages are
printed.
VALUE
DESCRIPTION
3
The first 100 bytes of each replicated command are printed.
4
All replicated commands are printed.
Values 2-4 are useful when debugging.
-PacketSize packet_size
Is the packet size, in bytes. The default is 4096 (bytes).
-PollingInterval polling_interval
Is how often, in seconds, the log is queried for replicated transactions. The default is 5 seconds.
-ProfileName profile_name
Specifies an agent profile to use for agent parameters. If ProfileName is NULL, the agent profile is disabled. If
ProfileName is not specified, the default profile for the agent type is used. For information, see Replication Agent
Profiles.
-PublisherFailoverPartner server_name[\instance_name]
Specifies the failover partner instance of SQL Server participating in a database mirroring session with the
publication database. For more information, see Database Mirroring and Replication (SQL Server).
-PublisherSecurityMode [ 0| 1]
Specifies the security mode of the Publisher. A value of 0 indicates SQL Server Authentication (default), and a
value of 1 indicates Windows Authentication Mode.
-PublisherLogin publisher_login
Is the Publisher login name.
-PublisherPassword publisher_password
Is the Publisher password.
-QueryTimeOut query_time_out_seconds
Is the number of seconds before the query times out. The default is 1800 seconds.
-ReadBatchSize number_of_transactions
Is the maximum number of transactions read out of the transaction log of the publishing database per processing
cycle, with a default of 500. The agent will continue to read transactions in batches until all transactions are read
from the log. This parameter is not supported for Oracle Publishers.
-ReadBatchThreshold number_of_commands
Is the number of replication commands to be read from the transaction log before being issued to the Subscriber
by the Distribution Agent. The default is 0. If this parameter is not specified, the Log Reader Agent will read to the
end of the log or to the number specified in -ReadBatchSize (number of transactions).
-RecoverFromDataErrors
Specifies that the Log Reader Agent continue to run when it encounters errors in column data published from a
non-SQL Server Publisher. By default, such errors cause the Log Reader Agent to fail. When you use RecoverFromDataErrors, erroneous column data is replicated either as NULL or an appropriate nonnull value,
and warning messages are logged to the MSlogreader_history table. This parameter is only supported for Oracle
Publishers.
Remarks
IMPORTANT
If you installed SQL Server Agent to run under a local system account instead of under a domain user account (the default),
the service can access only the local computer. If the Log Reader Agent that runs under SQL Server Agent is configured to
use Windows Authentication Mode when it logs in to SQL Server, the Log Reader Agent fails. The default setting is SQL
Server Authentication. For information about changing security accounts, see View and Modify Replication Security Settings.
To start the Log Reader Agent, execute logread.exe from the command prompt. For information, see Replication
Agent Executables Concepts.
Change History
UPDATED CONTENT
Added the -ExtendedEventConfigFile parameter.
See Also
Replication Agent Administration
Replication Merge Agent
3/24/2017 • 16 min to read • Edit Online
The Replication Merge Agent is a utility executable that applies the initial snapshot held in the database tables to
the Subscribers. It also merges incremental data changes that occurred at the Publisher after the initial snapshot
was created, and reconciles conflicts either according to the rules you configure or using a custom resolver you
create.
NOTE
Parameters can be specified in any order. When optional parameters are not specified, values from predefined registry
settings on the local computer are used.
Syntax
replmerg [-?]
-Publisher server_name[\instance_name]
-PublisherDB publisher_database
-Publication publication
-Subscriber server_name[\instance_name]
-SubscriberDB subscriber_database
[-AltSnapshotFolder alt_snapshot_folder_path]
[-Continuous]
[-DefinitionFile def_path_and_file_name]
[-DestThreads number_of_destination_threads]
[-Distributor server_name[\instance_name]]
[-DistributorLogin distributor_login]
[-DistributorPassword distributor_password]
[-DistributorSecurityMode [0|1]]
[-DownloadGenerationsPerBatch download_generations_per_batch]
[-DownloadReadChangesPerBatch download_read_changes_per_batch]
[-DownloadWriteChangesPerBatch download_write_changes_per_batch]
[-DynamicSnapshotLocation dynamic_snapshot_location]
[-EncryptionLevel [0|1|2]]
[-ExchangeType [1|2|3]]
[-FastRowCount [0|1]]
[-FileTransferType [0|1]]
[-ForceConvergenceLevel [0|1|2 (Publisher|Subscriber|Both)]]
[-FtpAddress ftp_address]
[-FtpPassword ftp_password]
[-FtpPort ftp_port]
[-FtpUserNameftp_user_name]
[-HistoryVerboseLevel [0|1|2|3]]
[-Hostname host_name]
[-InteractiveResolution [0|1]]
[-InternetLogin internet_login]
[-InternetPassword internet_password]
[-InternetProxyLogin internet_proxy_login]
[–InternetProxyPassword internet_proxy_password]
[-InternetProxyServer internet_proxy_server]
[-InternetSecurityMode [0|1]]
[-InternetTimeout internet_timeout]
[-InternetURL internet_url]
[-KeepAliveMessageInterval keep_alive_message_interval_seconds]
[-LoginTimeOut login_time_out_seconds]
[-MakeGenerationInterval make_generation_interval_seconds]
[-MaxBcpThreads number_of_threads]
[-MaxDownloadChanges number_of_download_changes]
[-MaxDownloadChanges number_of_download_changes]
[-MaxUploadChanges number_of_upload_changes]
[-MetadataRetentionCleanup [0|1]]
[-Output]
[-OutputVerboseLevel [0|1|2]]
[-ParallelUploadDownload [0|1]]
[-PacketSize packet_size]
[-PollingInterval polling_interval]
[-ProfileName profile_name]
[-PublisherFailoverPartner server_name[\instance_name] ]
[-PublisherLogin publisher_login]
[-PublisherPassword publisher_password]
[-PublisherSecurityMode [0|1]]
[-QueryTimeOut query_time_out_seconds]
[-SrcThreads number_of_source_threads]
[-StartQueueTimeout start_queue_timeout_seconds]
[-SubscriberConflictClean [0|1]]
[-SubscriberDatabasePath subscriber_path]
[-SubscriberDBAddOption [0|1|2|3]]
[-SubscriberLogin subscriber_login]
[-SubscriberPassword subscriber_password
[-SubscriberSecurityMode [0|1]]
[-SubscriberType [0|1|2|3|4|5|6|7|8|9]]
[-SubscriptionType [0|1|2]]
[-SyncToAlternate [0|1]
[-UploadGenerationsPerBatch upload_generations_per_batch]
[-UploadReadChangesPerBatch upload_read_changes_per_batch]
[-UploadWriteChangesPerBatch upload_write_changes_per_batch]
[-UseInprocLoader]
[-Validate [0|1|2|3]]
[-ValidateInterval validate_interval]
Arguments
-?
Prints all available parameters.
-Publisher server_name[\instance_name]
Is the name of the Publisher. Specify server_name for the default instance of Microsoft SQL Server on that server.
Specify server_name\instance_name for a named instance of SQL Server on that server.
-PublisherDB publisher_database
Is the name of the Publisher database.
-Publication publication
Is the name of the publication. This parameter is only valid if the publication is set to always have a snapshot
available for new or reinitialized subscriptions.
-Subscriber server_name[\instance_name]
Is the name of the Subscriber. Specify server_name for the default instance of SQL Server on that server. Specify
server_name\instance_name for a named instance of SQL Server on that server.
-SubscriberDB subscriber_database
Is the name of the Subscriber database.
-AltSnapshotFolder alt_snapshot_folder_path
Is the path to the folder that contains the initial snapshot for a subscription.
-Continuous
Specifies whether the agent attempts to poll replicated transactions continually. If specified, the agent polls
replicated transactions from the source at polling intervals, even if there are no transactions pending.
-DestThreads number_of_destination_threads
Specifies the number of destination threads that the Merge Agent uses to apply changes at the destination. The
destination is the Publisher during upload and the Subscriber during download. The default is 4.
-DefinitionFile def_path_and_file_name
Is the path of the agent definition file. An agent definition file contains command prompt arguments for the agent.
The content of the file is parsed as an executable file. Use double quotation marks (") to specify argument values
containing arbitrary characters.
-Distributor server_name[\instance_name]
Is the Distributor name. Specify server_name for the default instance of SQL Server on that server. Specify
server_name\instance_name for a named instance of SQL Server on that server. For Distributor (push)
distribution, the name defaults to the name of the default instance of SQL Server on the local computer.
-DistributorLogin distributor_login
Is the Distributor login name.
-DistributorPassword distributor_password
Is the Distributor password.
-DistributorSecurityMode [ 0| 1]
Specifies the security mode of the Distributor. A value of 0 indicates SQL Server Authentication Mode (default),
and a value of 1 indicates Windows Authentication Mode.
-DownloadGenerationsPerBatch download_generations_per_batch
Is the number of generations to be processed in a single batch while downloading changes from the Publisher to
the Subscriber. A generation is defined as a logical group of changes per article. The default for a reliable
communication link is 100. The default for an unreliable communication link is 10.
-DownloadReadChangesPerBatch download_read_changes_per_batch
Is the number of changes to be read in a single batch while downloading changes from the Publisher to the
Subscriber. The default is 100.
-DownloadWriteChangesPerBatch download_write_changes_per_batch
Is the number of changes to be applied in a single batch while downloading changes from the Publisher to the
Subscriber. The default is 100.
-DynamicSnapshotLocation dynamic_snapshot_location
Is the location of the filtered data snapshot files when the publication uses parameterized row filters.
-EncryptionLevel [ 0 | 1 | 2 ]
Is the level of Secure Sockets Layer (SSL) encryption used by the Merge Agent when making connections.
ENCRYPTIONLEVEL VALUE
DESCRIPTION
0
Specifies that SSL is not used.
1
Specifies that SSL is used, but the agent does not verify that
the SSL server certificate is signed by a trusted issuer.
2
Specifies that SSL is used, and that the certificate is verified.
For more information, see Security Overview (Replication).
-ExchangeType [ 1| 2| 3]
WARNING
This feature will be removed in a future version of Microsoft SQL Server. Do not use this feature in new development work,
and modify applications that currently use this feature as soon as possible. To restrict uploading, use the
@subscriber_upload_options of sp_addmergearticle instead.
Specifies the type of data exchange during synchronization, which can be one of the following:
EXCHANGETYPE VALUE
DESCRIPTION
1
Agent should upload data changes from the Subscriber to the
Publisher.
2
Agent should download data changes from the Publisher to
the Subscriber.
3 (default)
Agent should first upload data changes from the Subscriber
to the Publisher and then download data changes from the
Publisher to the Subscriber. You must use this option with
Web synchronization.
Download-only articles enable you to control the synchronization behavior of individual articles in a publication,
and they can provide a performance benefit. For more information, see Optimize Merge Replication Performance
with Download-Only Articles.
If using ExchangeType to separate the upload and download phase of merge replication into separate sessions,
you must run the merge agent with ExchangeType set to 1 first and then run the merge agent again with the
value 2. Failure to run the merge agent with both parameters will cause metadata to be deleted and require you to
reinitialize the subscription (without upload).
-FastRowCount [0|1]
Specifies what type of rowcount calculation method should be used for rowcount validation. A value of 1 (default)
indicates the fast method. A value of 0 indicates the full rowcount method.
-FileTransferType [0|1]
Specifies the file transfer type. A value of 0 indicates UNC (universal naming convention), and a value of 1
indicates FTP (file transfer protocol).
-ForceConvergenceLevel [0|1|2 ( Publisher| Subscriber| Both)]
Specifies the level of convergence the Merge Agent should use, and can be one of the following:
FORCECONVERGENCELEVEL VALUE
DESCRIPTION
0 (default)
Default. Perform a standard merge without additional
convergence.
1
Force convergence for all generations.
2
Force convergence for all generations and correct corrupt
lineages. When specifying this value, specify where lineages
should be corrected: the Publisher, the Subscriber, or both
the Publisher and the Subscriber.
-FtpAddress ftp_address
Is the network address of the FTP service for the Distributor. When not specified, Distributor is used.
-FtpPassword ftp_password
Is the user password used to connect to the FTP service.
-FtpPort ftp_port
Is the port number of the FTP service for the Distributor. When not specified, the default port number for FTP
service (21) is used.
-FtpUserName ftp_user_name
Is the user name used to connect to the FTP service. When not specified, anonymous is used.
-HistoryVerboseLevel [1|2|3]
Specifies the amount of history logged during a merge operation. You can minimize the effect of history logging
on performance by selecting 1.
HISTORYVERBOSELEVEL VALUE
DESCRIPTION
0
Log the final agent status message, final session details, and
any errors.
1
Log incremental session details at each session status,
including percent complete, in addition to the final agent
status message, final session details, and any errors.
2
Default. Log both incremental session details at each session
status and article level session details, including percent
complete, in addition to the final agent status message, final
session details, and any errors. Agent status messages are
also logged.
3
The same as -HistoryVerboseLevel = 2, except that more
agent progress messages are logged.
-Hostname host_name
Is the network name of the local computer. The default is the local computer name.
-InteractiveResolution [0|1]
Specifies whether interactive conflict resolution is used when a conflict occurs during synchronization. The default
is 0, indicating that interactive conflict resolution is not used.
-InternetLogin internet_login
Specifies the login name used when connecting to a SQL Server replication listener ISAPI DLL that requires
authentication.
-InternetPassword internet_password
Specifies the password used when connecting to a SQL Server replication listener ISAPI DLL that requires
authentication.
-InternetProxyLogin internet_proxy_login
Specifies the login name used when connecting to a proxy server, defined in internet_proxy_server, that requires
authentication.
–InternetProxyPassword internet_proxy_password
Specifies the password used when connecting to a proxy server, defined in internet_proxy_server, that requires
authentication.
-InternetProxyServer internet_proxy_server
Specifies the proxy server to use when accessing the HTTP resource specified in internet_url.
-InternetSecurityMode [0|1]
Specifies the IIS security mode used when connecting to the Web server during Web synchronization. A value of 0
indicates Basic Authentication, and a value of 1 indicates Windows Integrated Authentication (default).
-InternetTimeout internet_timeout
Is the number of seconds before a connection to the to the SQL Server replication listener ISAPI DLL times out.
-InternetURL internet_url
Specifies the URL used to connect to the SQL Server replication listener ISAPI DLL. This property must be
specified.
-KeepAliveMessageInterval keep_alive_message_interval_seconds
Is the number of seconds before the history thread checks if any of the existing connections is waiting for a
response from the server. This value can be decreased to avoid having the checkup agent mark the Merge Agent
as suspect when executing a long-running batch. The default is 300 seconds.
-LoginTimeOut login_time_out_seconds
Is the number of seconds before the login times out. The default is 15 seconds.
-MakeGenerationInterval make_generation_interval_seconds
Is the number of seconds to wait between creating generations, or batches of changes, to download to the client.
The default is 1 second.
Makegeneration is the process that prepares Publisher changes to be downloaded to Subscribers, and it can be a
performance bottleneck during downloads. If the makegeneration process already ran within the interval specified
by -MakeGenerationInterval, the process is skipped for the current synchronization session. This can benefit
synchronization concurrency and is especially helpful if Subscribers do not expect to download changes.
-MaxBcpThreads number_of_threads
Specifies the number of bulk copy operations that can be performed in parallel. The maximum number of threads
and ODBC connections that exist simultaneously is the lesser of MaxBcpThreads or the number of bulk copy
requests that appear in the system table sysmergeschemachange in the publication database. MaxBcpThreads
must have a value greater than 0 and has no hard-coded upper limit. The default is 1.
-MaxDownloadChanges number_of_download_changes
Specifies the maximum number of changed rows that should be downloaded from the Publisher to the
Subscriber. The number of rows downloaded may be higher than the specified maximum because: complete
generations are processed; and parallel destination threads may run, each of which processes at least 100
changes in its first pass. By default all changes that are ready to be downloaded are sent.
-MaxUploadChanges number_of_upload_changes
Specifies the maximum number of changed rows that should be uploaded from the Subscriber to the Publisher.
The number of rows uploaded may be higher than the specified maximum because: complete generations are
processed; and parallel destination threads may run, each of which processes at least 100 changes in its first pass.
By default all changes that are ready to be uploaded are sent.
-MetadataRetentionCleanup [0|1]
Specifies if metadata is removed from MSmerge_genhistory, MSmerge_contents, MSmerge_tombstone,
MSmerge_past_partition_mappings, and MSmerge_current_partition_mappings based on the publication
retention period. The default is 1, indicating that cleanup should occur. A value of 0 indicates that cleanup should
not occur automatically.
-Output output_path_and_file_name
Is the path of the agent output file. If the file name is not provided, the output is sent to the console. If the specified
file name exists, the output is appended to the file.
-OutputVerboseLevel [0|1|2]
Specifies whether the output should be verbose. If the verbose level is 0, only error messages are printed. If the
verbose level is 1, all of the progress report messages are printed. If the verbose level is 2 (default), all error
messages and progress report messages are printed, which is useful for debugging.
-ParallelUploadDownload [0|1]
Specifies whether the Merge Agent should process in parallel the changes uploaded to the Publisher and those
downloaded to the Subscriber, which is useful in high volume environments with high network bandwidth. If
ParallelUploadDownload is 1, then parallel processing is enabled.
-PacketSize
Is the packet size, in bytes. The default is 4096 (bytes).
-PollingInterval polling_interval
Is how often, in seconds, the Publisher or Subscriber is queried for data changes. The default is 60 seconds.
-ProfileName profile_name
Specifies an agent profile to use for agent parameters. If ProfileName is NULL, the agent profile is disabled. If
ProfileName is not specified, the default profile for the agent type is used. For information, see Replication Agent
Profiles.
-PublisherFailoverPartner server_name[\instance_name]
Specifies the failover partner instance of SQL Server participating in a database mirroring session with the
publication database. For more information, see Database Mirroring and Replication (SQL Server).
-PublisherLogin publisher_login
Is the Publisher login name. If PublisherSecurityMode is 0 (for SQL Server Authentication), this parameter must
be specified.
-PublisherPassword publisher_password
Is the Publisher password. If PublisherSecurityMode is 0 (for SQL Server Authentication), this parameter must
be specified.
-PublisherSecurityMode [0|1]
Specifies the security mode of the Publisher. A value of 0 indicates SQL Server Authentication (default), and a
value of 1 indicates Windows Authentication Mode.
-QueryTimeOut query_time_out_seconds
Is the number of seconds before the query times out. The default is 300 seconds. The Merge Agent also uses the
value of QueryTimeout to determine how long to wait for generation of a partitioned snapshot when this value
is greater than 1800.
-SrcThreads number_of_source_threads
Specifies the number of source threads that the Merge Agent uses to enumerate changes from the source. The
source is the Subscriber during upload and the Publisher during download. The default is 3.
-StartQueueTimeout start_queue_timeout_seconds
Is the maximum number of seconds that the Merge Agent waits when the number of concurrent merge processes
running is at the limit set by the @max_concurrent_merge property of sp_addmergepublication. If the
maximum number of seconds is reached and the Merge Agent is still waiting, it will exit. A value of 0 means that
the agent waits indefinitely, although it can be cancelled.
-SubscriberDatabasePath subscriber_database_path
Is the path to the Jet database (.mdb file) if SubscriberType is 2 (allows a connection to a Jet database without an
ODBC Data Source Name (DSN)).
-SubscriberDBAddOption [0| 1| 2| 3]
Specifies whether there is an existing Subscriber database.
SUBSCRIBERDBADDOPTION VALUE
DESCRIPTION
0
Use the existing database (default).
1
Create a new, empty Subscriber database.
2
Create a new database and attach it to the specified file.
3
Create a new database, attach the database, and enable all
subscriptions that might exist at the file.
NOTE
When you use values 2 and 3, the database path for the Subscriber must be specified in the SubscriberDatabasePath
option.
-SubscriberLogin subscriber_login
Is the Subscriber login name. If SubscriberSecurityMode is 0 (for SQL Server Authentication), this parameter
must be specified.
-SubscriberPassword subscriber_password
Is the Subscriber password. If SubscriberSecurityMode is 0 (for SQL Server Authentication), this parameter
must be specified.
-SubscriberSecurityMode [ 0| 1]
Specifies the security mode of the Subscriber. A value of 0 indicates SQL Server Authentication (default), and a
value of 1 indicates Windows Authentication Mode.
-SubscriberConflictClean [ 0| 1]
Is if conflict tables are cleaned-up at the Subscriber during the synchronization process, where a value of 1
indicates that conflict tables at the Subscriber are cleaned-up. This parameter is used only for subscriptions to
publications with decentralized conflict logging.
-SubscriberType [ 0| 1| 3| 4| 5| 6| 7| 8]
Specifies the type of Subscriber connection used by the Merge Agent. Only the default value of 0 is supported for
this parameter.
-SubscriptionType[ 0| 1| 2]
Specifies the subscription type for distribution. A value of 0 indicates a push subscription (default), a value of 1
indicates a pull subscription, and a value of 2 indicates an anonymous subscription.
-SyncToAlternate [ 0|1]
Specifies whether the Merge Agent is synchronizing between a Subscriber and an alternate Publisher. A value of 1
indicates that it is an alternate Publisher. The default is 0.
-UploadGenerationsPerBatch upload_generations_per_batch
Is the number of generations to be processed in a single batch while uploading changes from the Subscriber to
the Publisher. A generation is defined as a logical group of changes per article. The default for a reliable
communication link is 100. The default for an unreliable communication link is 1.
-UploadReadChangesPerBatch upload_read_changes_per_batch
Is the number of changes to be read in a single batch while uploading changes from the Subscriber to the
Publisher. The default is 100.
-UploadWriteChangesPerBatch upload_write_changes_per_batch
Is the number of changes to be applied in a single batch while uploading changes from the Subscriber to the
Publisher. The default is 100.
-UseInprocLoader
Improves the performance of the initial snapshot by causing the Merge Agent to use the BULK INSERT command
when applying snapshot files to the Subscriber. This parameter is deprecated because it is not compatible with the
XML data type. If you are not replicating XML data, this parameter can be used. This parameter cannot be used
with character mode snapshots. If you use this parameter, the SQL Server service account at the Subscriber must
have read permissions on the directory where the snapshot .bcp data files are located. When this parameter is not
used, the ODBC driver loaded by the agent reads from the files, so the security context of the SQL Server service
account is not used.
-Validate [0|1|2|3]
Specifies whether validation should be done at the end of the merge session, and, if so, what type of validation.
The value of 3 is the recommended value.
VALIDATE VALUE
DESCRIPTION
0 (default)
No validation.
1
Rowcount-only validation.
2
Rowcount and checksum validation.
3
Rowcount and binary checksum validation.
NOTE
Validation by using binary checksum or checksum can incorrectly report a failure if data types are different at the Subscriber
than they are at the Publisher. For more information, see the section "Considerations for Data Validation" in Validate
Replicated Data.
-ValidateInterval validate_interval
Is how often, in minutes, the subscription is validated in continuous mode. The default is 60 minutes.
Remarks
IMPORTANT
If you have installed SQL Server Agent to run under a local system account rather than under a domain user account (the
default), the service can access only the local computer. If the Merge Agent that runs under SQL Server Agent is configured
to use Windows Authentication Mode when it logs in to SQL Server, the Merge Agent fails. The default setting is SQL Server
Authentication.
To start the Merge Agent, execute replmerg.exe from the command prompt. For information, see Replication
Agent Executables.
The merge agent history for the current session is not removed while running in continuous mode. A long
running agent can result in a large number of entries in the merge history tables which could impact
performance. To resolve this problem switch to scheduled mode, or continue to use continuous mode but create a
dedicated job to periodically restart the merge agent, or reduce the verbosity of the history level to reduce the
number of rows and therefor reduce the performance impact.
See Also
Replication Agent Administration
Replication Queue Reader Agent
3/24/2017 • 4 min to read • Edit Online
The Replication Queue Reader Agent is an executable that reads messages stored in a Microsoft SQL Server queue
or a Microsoft Message Queue and then applies those messages to the Publisher. Queue Reader Agent is used
with snapshot and transactional publications that allow queued updating.
NOTE
Parameters can be specified in any order. When optional parameters are not specified, predefined values based on the
default agent profile are used.
Syntax
qrdrsvc [-?]
[-Continuous]
[-DefinitionFile definition_file]
[-Distributor server_name[\instance_name]]
[-DistributionDB distribution_database]
[-DistributorLogin distributor_login]
[-DistributorPassword distributor_password]
[-DistributorSecurityMode [0|1]]
[-EncryptionLevel [0|1|2]]
[-HistoryVerboseLevel [0|1|2|3]]
[-LoginTimeOut login_time_out_seconds]
[-Output output_path_and_file_name]
[-OutputVerboseLevel [0|1|2]]
[-PollingInterval polling_interval]
[-PublisherFailoverPartner server_name[\instance_name] ]
[-ProfileName agent_profile_name]
[-QueryTimeOut query_time_out_seconds]
[-ResolverState [1|2|3]]
Arguments
-?
Displays usage information.
-Continuous
Specifies whether the agent attempts to process queued transactions continuously. If specified, the agent
continues execution even if there are no queued transactions pending from any of the subscribers.
-DefinitionFile def_path_and_file_name
Is the path of the agent definition file. An agent definition file contains command-line arguments for the agent.
The content of the file is parsed as an executable file. Use double quotation marks (") to specify argument values
containing arbitrary characters.
-Distributor server_name[\instance_name]
Is the Distributor name. Specify server_name for the default instance of SQL Server on that server. Specify
server_name\instance_name for a named instance of SQL Server on that server. If not specified, the name defaults
to the name of the default instance of SQL Server on the local computer.
-DistributionDB distribution_database
Is the distribution database.
-DistributorLogin distributor_login
Is the Distributor login name.
-DistributorPassword distributor_password
Is the Distributor password.
-DistributorSecurityMode [ 0| 1]
Specifies the security mode of the Distributor. A value of 0 indicates SQL Server Authentication Mode (default),
and a value of 1 indicates Windows Authentication Mode.
-EncryptionLevel [ 0 | 1 | 2 ]
Is the level of Secure Sockets Layer (SSL) encryption used by the Queue Reader Agent when making connections.
ENCRYPTIONLEVEL VALUE
DESCRIPTION
0
Specifies that SSL is not used.
1
Specifies that SSL is used, but the agent does not verify that
the SSL server certificate is signed by a trusted issuer.
2
Specifies that SSL is used, and that the certificate is verified.
For more information, see Security Overview (Replication).
-HistoryVerboseLevel [ 0| 1| 2| 3]
Specifies the amount of history logged during a queue reader operation. You can minimize the effect of history
logging on performance by selecting 1.
HISTORYVERBOSELEVEL VALUE
DESCRIPTION
0
No history logging (not recommended).
1
Default. Always update a previous history message of the
same status (startup, progress, success, and so on). If no
previous record with the same status exists, insert a new
record.
2
Insert new history records, including idle messages or longrunning job messages.
3
Insert new history records that include additional details that
may be useful for troubleshooting.
-LoginTimeOut login_time_out_seconds
Is the number of seconds before the login times out. The default is 15 seconds.
-Output output_path_and_file_name
Is the path of the agent output file. If the file name is not provided, the output is sent to the console. If the specified
file name exists, the output is appended to the file.
-OutputVerboseLevel [ 0| 1| 2]
Specifies whether the output should be verbose. If the verbose level is 0, only error messages are printed. If the
verbose level is 1, all the progress report messages are printed. If the verbose level is 2 (default), all error
messages and progress report messages are printed, which is useful for debugging.
-PollingInterval polling_interval
Is relevant only for updating subscriptions that use SQL Server based queues. Specifies how often, in seconds, the
SQL Server queue is polled for pending queued transactions. The value can be between 0 and 240 seconds. The
default is 5 seconds.
-PublisherFailoverPartner server_name[\instance_name]
Specifies the failover partner instance of SQL Server participating in a database mirroring session with the
publication database. For more information, see Database Mirroring and Replication (SQL Server).
-ProfileName agent_profile_name
Is the name of an agent profile used to supply a set of default values to the agent. For information, see Replication
Agent Profiles.
-QueryTimeOut query_time_out_seconds
Is the number of seconds before the query times out. The default is 1800 seconds.
-ResolverState [ 1| 2| 3]
Specifies how queued updating conflicts are resolved. A value of 1 indicates the Publisher wins the conflict, and
the current conflicting queued transaction will be rolled back on the Publisher and the originating updating
Subscriber; the processing of subsequent queued transactions will continue. A value of 2 indicates the Subscriber
wins the conflict, and the queued transaction will override the values on the Publisher. A value of 3 indicates that
any conflict will result in Subscriber re-initialization; the Publisher wins the conflict, processing of subsequent
queued transactions will be terminated, and the subscription will be reinitialized. The default setting is 1 for
transactional publications and 3 for snapshot publications.
Remarks
To start the Queue Reader Agent, execute qrdrsvc.exe from the command prompt. For information, see
Replication Agent Executables.
See Also
Replication Agent Administration
Replication Snapshot Agent
3/24/2017 • 9 min to read • Edit Online
The Replication Snapshot Agent is an executable file that prepares snapshot files containing schema and data of
published tables and database objects, stores the files in the snapshot folder, and records synchronization jobs in
the distribution database.
NOTE
Parameters can be specified in any order.
Syntax
snapshot [ -?]
-Publisher server_name[\instance_name]
-Publication publication_name
[-70Subscribers]
[-BcpBatchSize bcp_batch_size]
[-DefinitionFile def_path_and_file_name]
[-Distributor server_name[\instance_name]]
[-DistributorDeadlockPriority [-1|0|1] ]
[-DistributorLogin distributor_login]
[-DistributorPassword distributor_password]
[-DistributorSecurityMode [0|1] ]
[-DynamicFilterHostName dynamic_filter_host_name]
[-DynamicFilterLogin dynamic_filter_login]
[-DynamicSnapshotLocation dynamic_snapshot_location]
[-EncryptionLevel [0|1|2]]
[-FieldDelimiter field_delimiter]
[-HistoryVerboseLevel [0|1|2|3] ]
[-HRBcpBlocks number_of_blocks ]
[-HRBcpBlockSize block_size ]
[-HRBcpDynamicBlocks ]
[-KeepAliveMessageInterval keep_alive_interval]
[-LoginTimeOut login_time_out_seconds]
[-MaxBcpThreads number_of_threads ]
[-MaxNetworkOptimization [0|1]]
[-Output output_path_and_file_name]
[-OutputVerboseLevel [0|1|2] ]
[-PacketSize packet_size]
[-ProfileName profile_name]
[-PublisherDB publisher_database]
[-PublisherDeadlockPriority [-1|0|1] ]
[-PublisherFailoverPartner server_name[\instance_name] ]
[-PublisherLogin publisher_login]
[-PublisherPassword publisher_password]
[-PublisherSecurityMode [0|1] ]
[-QueryTimeOut query_time_out_seconds]
[-ReplicationType [1|2] ]
[-RowDelimiter row_delimiter]
[-StartQueueTimeout start_queue_timeout_seconds]
[-UsePerArticleContentsView use_per_article_contents_view]
Arguments
-?
Prints all available parameters.
-Publisher server_name[\instance_name]
Is the name of the Publisher. Specify server_name for the default instance of Microsoft SQL Server on that server.
Specify server_name\instance_name for a named instance of SQL Server on that server.
-Publication publication
Is the name of the publication. This parameter is only valid if the publication is set to always have a snapshot
available for new or reinitialized subscriptions.
-70Subscribers
Must be used if any Subscribers are running SQL Server version 7.0.
-BcpBatchSize bcp batch\ size
Is the number of rows to send in a bulk copy operation. When performing a bcp in operation, the batch size is the
number of rows to send to the server as one transaction, and also the number of rows that must be sent before
the Distribution Agent logs a bcp progress message. When performing a bcp out operation, a fixed batch size of
1000 is used. A value of 0 indicates no message logging.
-DefinitionFile def_path_and_file_name
Is the path of the agent definition file. An agent definition file contains command line arguments for the agent. The
content of the file is parsed as an executable file. Use double quotation marks (") to specify argument values
containing arbitrary characters.
-Distributor server_name[\instance_name]
Is the Distributor name. Specify server_name for the default instance of SQL Server on that server. Specify
server_name\instance_name for a named instance of SQL Server on that server.
-DistributorDeadlockPriority [-1|0|1]
Is the priority of the Snapshot Agent connection to the Distributor when a deadlock occurs. This parameter is
specified to resolve deadlocks that may occur between the Snapshot Agent and user applications during snapshot
generation.
DISTRIBUTORDEADLOCKPRIORITY VALUE
DESCRIPTION
-1
Applications other than the Snapshot Agent have priority
when a deadlock occurs at the Distributor.
0 (Default)
Priority is not assigned.
1
Snapshot Agent has priority when a deadlock occurs at the
Distributor.
-DistributorLogin distributor_login
Is the login used when connecting to the Distributor using SQL Server Authentication.
-DistributorPassword distributor_password
Is the password used when connecting to the Distributor using SQL Server Authentication. .
-DistributorSecurityMode [ 0| 1]
Specifies the security mode of the Distributor. A value of 0 indicates SQL Server Authentication Mode (default),
and a value of 1 indicates Windows Authentication Mode.
-DynamicFilterHostName dynamic_filter_host_name
Is used to set a value for HOST_NAME (Transact-SQL) in filtering when a dynamic snapshot is created. For
example, if the subset filter clause rep_id = HOST_NAME() is specified for an article, and you set the
DynamicFilterHostName property to "FBJones" before calling the Merge Agent, only rows having "FBJones" in
the rep_id column will be replicated.
-DynamicFilterLogin dynamic_filter_login
Is used to set a value for SUSER_SNAME (Transact-SQL)in filtering when a dynamic snapshot is created. For
example, if the subset filter clause user_id = SUSER_SNAME() is specified for an article, and you set the
DynamicFilterLogin property to "rsmith" before calling the Run method of the SQLSnapshot object, only rows
having "rsmith" in the user_id column will be included in the snapshot.
-DynamicSnapshotLocation dynamic_snapshot_location
Is the location where the dynamic snapshot should be generated.
-EncryptionLevel [ 0 | 1 | 2 ]
Is the level of Secure Sockets Layer (SSL) encryption used by the Snapshot Agent when making connections.
ENCRYPTIONLEVEL VALUE
DESCRIPTION
0
Specifies that SSL is not used.
1
Specifies that SSL is used, but the agent does not verify that
the SSL server certificate is signed by a trusted issuer.
2
Specifies that SSL is used, and that the certificate is verified.
For more information, see Security Overview (Replication).
-FieldDelimiter field_delimiter
Is the character or character sequence that marks the end of a field in the SQL Server bulk-copy data file. The
default is \n<x$3>\n.
-HistoryVerboseLevel [ 1| 2| 3]
Specifies the amount of history logged during a snapshot operation. You can minimize the effect of history
logging on performance by selecting 1.
HISTORYVERBOSELEVEL VALUE
DESCRIPTION
0
Progress messages are written either to the console or to an
output file. History records are not logged in the distribution
database.
1
Always update a previous history message of the same status
(startup, progress, success, and so on). If no previous record
with the same status exists, insert a new record.
2 (default)
Insert new history records unless the record is for such things
as idle messages or long-running job messages, in which case
update the previous records.
3
Always insert new records, unless it is for idle messages.
-HRBcpBlocks number_of_blocks
Is the number of bcp data blocks that are queued between the writer and reader threads. The default value is 50.
HRBcpBlocks is only used with Oracle publications.
NOTE
This parameter is used for performance tuning of bcp performance from an Oracle Publisher.
-HRBcpBlockSizeblock_size
Is the size, in kilobytes (KB), of each bcp data block. The default value is 64 KB. HRBcpBlocks is only used with
Oracle publications.
NOTE
This parameter is used for performance tuning of bcp performance from an Oracle Publisher.
-HRBcpDynamicBlocks
Is whether or not the size of each bcp data block can grow dynamically. HRBcpBlocks is only used with Oracle
publications.
NOTE
This parameter is used for performance tuning of bcp performance from an Oracle Publisher.
-KeepAliveMessageInterval keep_alive_interval
Is the amount of time, in seconds, that the Snapshot Agent waits before logging "waiting for backend message" to
the MSsnapshot_history table. The default value is 300 seconds.
-LoginTimeOut login_time_out_seconds
Is the number of seconds before the login times out. The default is 15 seconds.
-MaxBcpThreads number_of_threads
Specifies the number of bulk copy operations that can be performed in parallel. The maximum number of threads
and ODBC connections that exist simultaneously is the lesser of MaxBcpThreads or the number of bulk copy
requests that appear in the synchronization transaction in the distribution database. MaxBcpThreads must have
a value greater than 0 and has no hard-coded upper limit. The default is 1.
- MaxNetworkOptimization [ 0| 1]
Is if irrelevant deletes are sent to the Subscriber. Irrelevant deletes are DELETE commands that are sent to
Subscribers for rows that do not belong to the Subscriber's partition. Irrelevant deletes do not affect data integrity
or convergence, but they can result in unnecessary network traffic. The default value of
MaxNetworkOptimization is 0. Setting MaxNetworkOptimization to 1 minimizing the chances of irrelevant
deletes thereby reducing network traffic and maximizing network optimization. Setting this parameter to 1 can
also increase the storage of metadata and cause performance to degrade at the Publisher if multiple levels of join
filters and complex subset filters are present. You should carefully assess your replication topology and set
MaxNetworkOptimization to 1 only if network traffic from irrelevant deletes is unacceptably high.
NOTE
Setting this parameter to 1 is useful only when the synchronization optimization option of the merge publication is set to
true (the @keep_partition_changes parameter of sp_addmergepublication (Transact-SQL)).
-Output output_path_and_file_name
Is the path of the agent output file. If the file name is not provided, the output is sent to the console. If the specified
file name exists, the output is appended to the file.
-OutputVerboseLevel [ 0| 1| 2]
Specifies whether the output should be verbose.
OUTPUTVERBOSELEVEL VALUE
DESCRIPTION
0
Only error messages are printed.
1 (default)
All the progress report messages are printed (default).
2
All error messages and progress report messages are printed,
which is useful for debugging.
-PacketSize packet_size
Is the packet size (in bytes) used by the Snapshot Agent when connecting to SQL Server. The default value is 8192
bytes.
NOTE
Do not change the packet size unless you are certain that it will improve performance. For most applications, the default
packet size is best.
-ProfileName profile_name
Specifies an agent profile to use for agent parameters. If ProfileName is NULL, the agent profile is disabled. If
ProfileName is not specified, the default profile for the agent type is used. For information, see Replication Agent
Profiles.
-PublisherDB publisher_database
Is the name of the publication database. This parameter is not supported for Oracle Publishers.
-PublisherDeadlockPriority [-1|0|1]
Is the priority of the Snapshot Agent connection to the Publisher when a deadlock occurs. This parameter is
specified to resolve deadlocks that may occur between the Snapshot Agent and user applications during snapshot
generation.
PUBLISHERDEADLOCKPRIORITY VALUE
DESCRIPTION
-1
Applications other than the Snapshot Agent have priority
when a deadlock occurs at the Publisher.
0 (Default)
Priority is not assigned.
1
Snapshot Agent has priority when a deadlock occurs at the
Publisher.
-PublisherFailoverPartner server_name[\instance_name]
Specifies the failover partner instance of SQL Server participating in a database mirroring session with the
publication database. For more information, see Database Mirroring and Replication (SQL Server).
-PublisherLogin publisher_login
Is the login used when connecting to the Publisher using SQL Server Authentication.
-PublisherPassword publisher_password
Is the password used when connecting to the Publisher using SQL Server Authentication. .
-PublisherSecurityMode [ 0| 1]
Specifies the security mode of the Publisher. A value of 0 indicates SQL Server Authentication (default), and a
value of 1 indicates Windows Authentication Mode.
-QueryTimeOut query_time_out_seconds
Is the number of seconds before the query times out. The default is 1800 seconds.
-ReplicationType [ 1| 2]
Specifies the type of replication. A value of 1 indicates transactional replication, and a value of 2 indicates merge
replication.
-RowDelimiter row_delimiter
Is the character or character sequence that marks the end of a row in the SQL Server bulk-copy data file. The
default is \n<,@g>\n.
-StartQueueTimeout start_queue_timeout_seconds
Is the maximum number of seconds that the Snapshot Agent waits when the number of concurrent dynamic
snapshot processes running is at the limit set by the @max_concurrent_dynamic_snapshots property of
sp_addmergepublication (Transact-SQL). If the maximum number of seconds is reached and the Snapshot Agent
is still waiting, it will exit. A value of 0 means that the agent waits indefinitely, although it can be canceled.
- UsePerArticleContentsView use_per_article_contents_view
This parameter has been deprecated and is supported for backward-compatibility only.
Remarks
IMPORTANT
If you have installed SQL Server Agent to run under a Local System account rather than under a Domain User account (the
default), the service can access only the local computer. If the Snapshot Agent that runs under SQL Server Agent is
configured to use Windows Authentication Mode when it logs in to SQL Server, the Snapshot Agent fails. The default
setting is SQL Server Authentication.
To start the Snapshot Agent, execute snapshot.exe from the command prompt. For information, see Replication
Agent Executables.
See Also
Replication Agent Administration
Replication Agent Administration
3/24/2017 • 3 min to read • Edit Online
Replication agents carry out many of the tasks associated with replication, including creating copies of schema
and data, detecting updates at the Publisher or Subscriber, and propagating changes between servers. By default,
replication agents run under Microsoft SQL Server Agent job steps. The agents are simply executables, so they
can also be called directly from the command line and from batch scripts. Each replication agent supports a set of
run-time parameters used to control how it runs; these parameters are specified in an agent profile or on the
command line.
IMPORTANT
By default, the SQL Server Agent service is disabled when SQL Server is installed unless you explicitly choose to autostart
the service during installation.
Replication agent files are located under <drive>:\Program Files\Microsoft SQL Server\130\\COM. The following
table lists the replication executable names and file names. Click the link for an agent to view its parameter
reference.
AGENT EXECUTABLE
FILE NAME
Replication Snapshot Agent
snapshot.exe
Replication Distribution Agent
distrib.exe
Replication Log Reader Agent
logread.exe
Replication Queue Reader Agent
qrdrsvc.exe
Replication Merge Agent
replmerg.exe
In addition to replication agents, replication has a number of jobs that perform scheduled and on-demand
maintenance.
To run agents and maintenance jobs
SQL Server Management Studio and Replication Monitor: Start and Stop a Replication Agent (SQL Server
Management Studio)
Replication programming: Replication Agent Executables Concepts
Agent Profiles
When replication is configured, a set of agent profiles is installed on the Distributor. An agent profile contains a
set of parameters that are used each time an agent runs: each agent logs in to the Distributor during its startup
process and queries for the parameters in its profile. Replication provides a default profile for each agent and
additional predefined profiles for the Log Reader Agent, Distribution Agent, and Merge Agent. In addition to the
profiles provided, you can create profiles suited to your application requirements. For more information, see
Replication Agent Profiles.
For information about specifying command line parameters directly, see Replication Agent Executables Concepts.
Monitoring Replication Agents
Replication Monitor allows you to view information and perform tasks associated with each replication 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 Agents tab. 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).
Independent and Shared Agents
An independent agent is an agent that services one subscription. A shared agent services multiple subscriptions;
if multiple subscriptions using the same shared agent need to synchronize, by default they wait in a queue, and
the shared agent services them one at a time. Latency is reduced when using independent agents because the
agent is ready whenever the subscription needs to be synchronized. Merge replication always uses independent
agents, and transactional replication uses independent agents by default for publications created in the New
Publication Wizard (in previous versions of SQL Server, transactional replication used shared agents by default).
Replication Maintenance Jobs
Replication uses the following jobs to perform scheduled and on-demand maintenance.
CLEAN UP JOB
DESCRIPTION
DEFAULT SCHEDULE
Agent History Clean Up: Distribution
Removes replication agent history from
the distribution database.
Runs every ten minutes
Distribution Clean Up: Distribution
Removes replicated transactions from
the distribution database. Deactivates
subscriptions that have not been
synchronized within the maximum
distribution retention period.
Runs every ten minutes
Expired Subscription Clean Up
Detects and removes expired
subscriptions from publication
databases.
Runs every day at 1:00 A.M.
CLEAN UP JOB
DESCRIPTION
DEFAULT SCHEDULE
Reinitialize Subscriptions Having Data
Validation Failures
Detects all subscriptions that have data
validation failures and marks them for
reinitialization. The next time the
Merge Agent or Distribution Agent
runs, a new snapshot will be applied at
the Subscribers.
No default schedule (not enabled by
default).
Replication Agents Checkup
Detects replication agents that are not
actively logging history. It writes to the
Microsoft Windows event log if a job
step fails.
Runs every ten minutes.
Replication monitoring refresher for
distribution
Refreshes cached queries used by
Replication Monitor..
Runs continuously.
See Also
Monitoring Replication
Replication Agent Profiles
3/24/2017 • 4 min to read • Edit Online
When replication is configured, a set of agent profiles is installed on the Distributor. An agent profile contains a
set of parameters that are used each time an agent runs: each agent logs in to the Distributor during its startup
process and queries for the parameters in its profile. For merge subscriptions that use Web synchronization,
profiles are downloaded and stored at the Subscriber. If the profile is changed, the profile at the Subscriber is
updated the next time the Merge Agent runs. For more information about Web synchronization, see Web
Synchronization for Merge Replication.
Replication provides a default profile for each agent and additional predefined profiles for the Log Reader Agent,
Distribution Agent, and Merge Agent. In addition to the profiles provided, you can create profiles suited to your
application requirements. An agent profile allows you to change key parameters easily for all agents associated
with that profile. For example, if you have 20 Snapshot Agents and need to change the query timeout value (the QueryTimeout parameter), you can update the profile used by the Snapshot Agents and all agents of that type
will begin using the new value automatically the next time they run.
You might also have different profiles for different instances of an agent. For example, a Merge Agent that
connects to the Publisher and Distributor over a dialup connection could use a set of parameters that are better
suited to the slower communications link by using the slow link profile.
NOTE
If you specify a value for an agent parameter on the command line, that value overrides the value set for the same
parameter in the agent profile.
To use and modify agent profiles
Work with Replication Agent Profiles
Snapshot Agent Profiles
The following table shows the parameters defined in the default profile for the Snapshot Agent. For more
information on these parameters, see Replication Snapshot Agent.
DEFAULT
-BcpBatchSize
100000
-HistoryVerboseLevel
2
-LoginTimeout
15
-QueryTimeout
1800
Log Reader Agent Profiles
The following table shows the parameters defined in the profiles for the Log Reader Agent. Each column in the
table represents a named profile. For more information on these parameters, see Replication Log Reader Agent.
DEFAULT
VERBOSE HISTORY
-HistoryVerboseLevel
1
2
-LoginTimeout
15
15
-LogScanThreshold
500000
500000
-PollingInterval
5
5
-QueryTimeout
1800
1800
-ReadBatchSize
500
500
Distribution Agent Profiles
The following table shows the parameters defined in the profiles for the Distribution Agent. Each column in the
table represents a named profile. For more information on these parameters, see Replication Distribution Agent.
CONTINUE ON
DATA
CONSISTENCY
ERRORS
DISTRIBUTION
PROFILE FOR
OLEDB
STREAMING
DEFAULT
VERBOSE HISTORY
WINDOWS
SYNCHRONIZATIO
N MANAGER
-BcpBatchSize
100000
100000
1000
100000
2147473647
CommitBatchSi
ze
100
100
100
100
100
CommitBatchTh
reshold
1000
1000
1000
1000
1000
HistoryVerbose
Level
1
2
1
1
1
KeepAliveMess
ageInterval
300
300
300
300
300
-LoginTimeout
15
15
15
15
15
MaxBcpThread
s
1
1
1
1
1
MaxDeliveredT
ransactions
0
0
0
0
0
OledbStreamTh
reshold
NULL
NULL
NULL
NULL
32768
CONTINUE ON
DATA
CONSISTENCY
ERRORS
DISTRIBUTION
PROFILE FOR
OLEDB
STREAMING
DEFAULT
VERBOSE HISTORY
WINDOWS
SYNCHRONIZATIO
N MANAGER
-PacketSize
NULL
NULL
NULL
NULL
32768
-PollingInterval
5
5
5
5
5
-QueryTimeout
1800
1800
1800
1800
1800
-SkipErrors
NULL
NULL
NULL
-SkipErrors
2601:2627:2059
8
NULL
TransactionsPer
History
100
100
100
100
100
UseOledbStrea
ming
NULL
NULL
NULL
NULL
UseOledbStrea
ming
Merge Agent Profiles
The following table shows the parameters defined in the profiles for the Merge Agent. Each column in the table
represents a named profile. For more information on these parameters, see Replication Merge Agent.
DEFAULT
VERBOSE
HISTORY
WINDOWS
SYNCHRONI
ZATION
MANAGER
ROWCOUNT
VALIDATION
ROWCOUNT
AND
CHECKSUM
VALIDATION
SLOW LINK
HIGH
VOLUME
SERVER-TOSERVER
BcpBatchS
ize
100000
100000
1000
100000
100000
100000
100000
ChangesPe
rHistory
100
50
50
100
100
100
1000
DestThrea
ds
2
1
1
1
1
1
4
Download
Generatio
nsPerBatc
h
50
50
50
50
50
1
500
Download
ReadChan
gesPerBat
ch
100
100
100
100
100
100
100
DEFAULT
VERBOSE
HISTORY
WINDOWS
SYNCHRONI
ZATION
MANAGER
ROWCOUNT
VALIDATION
ROWCOUNT
AND
CHECKSUM
VALIDATION
SLOW LINK
HIGH
VOLUME
SERVER-TOSERVER
Download
WriteChan
gesPerBat
ch
100
100
100
100
100
100
100
FastRowCo
unt
1
1
1
1
1
1
1
HistoryVer
boseLevel
2
3
1
1
2
1
2
KeepAlive
MessageIn
terval
300
300
300
300
300
300
300
LoginTime
out
15
15
15
15
15
15
15
MaxDownl
oadChang
es
0
0
0
0
0
0
0
MaxUploa
dChanges
0
0
0
0
0
0
0
MetadataR
etentionCl
eanup
1
1
1
1
1
1
1
NumDeadl
ockRetries
5
5
5
5
5
5
5
ParallelUp
loadDownl
oad
NULL
NULL
NULL
NULL
NULL
NULL
1
PollingInte
rval
60
60
60
60
60
60
60
QueryTim
eout
300
300
300
300
300
300
600
DEFAULT
VERBOSE
HISTORY
WINDOWS
SYNCHRONI
ZATION
MANAGER
ROWCOUNT
VALIDATION
ROWCOUNT
AND
CHECKSUM
VALIDATION
SLOW LINK
HIGH
VOLUME
SERVER-TOSERVER
QueueSize
Multiplier
NULL
NULL
NULL
NULL
NULL
NULL
5
SrcThread
s
2
2
2
2
2
1
3
StartQueu
eTimeout
0
0
0
0
0
0
0
UploadGe
nerationsP
erBatch
50
50
50
50
50
1
500
UploadRe
adChanges
PerBatch
100
100
100
100
100
100
100
UploadWri
teChanges
PerBatch
100
100
100
100
100
100
100
-Validate
0
0
0
1
3
0
0
ValidateInt
erval
60
60
60
60
60
60
60
Queue Reader Agent Profiles
The following table shows the parameters defined in the default profile for the Queue Reader Agent. For more
information on these parameters, see Replication Queue Reader Agent.
DEFAULT
-HistoryVerboseLevel
1
-LoginTimeout
15
-PollingInterval
5
-QueryTimeout
1800
See Also
Replication Agent Administration
View and Modify Replication Agent Command Prompt Parameters (SQL Server Management Studio)
Replication Agent Executables Concepts
Use Alerts for Replication Agent Events
3/24/2017 • 4 min to read • Edit Online
SQL Server Management Studio and Microsoft SQL Server Agent provide a way to monitor events, such as
replication agent events, using alerts. SQL Server Agent monitors the Windows application log for events that are
associated with alerts. If such an event occurs, SQL Server Agent responds automatically, by executing a task that
you have defined and/or sending e-mail or a pager message to a specified operator. SQL Server includes a set of
predefined alerts for replication agents that you can configure to execute a task and/or notify an operator. For more
information about defining a task to execute, see the section "Automating a Response to an Alert" in this topic.
The following alerts are installed when a computer is configured as a Distributor:
CONDITION CAUSING THE
ALERT TO FIRE
ENTERS ADDITIONAL
INFORMATION IN
MSDB..SYSREPLICATIONALERT
S
MESSAGE ID
PREDEFINED ALERT
14150
Replication: agent success
Agent shuts down
successfully.
Yes
14151
Replication: agent failure
Agent shuts down with an
error.
Yes
14152
Replication: agent retry
Agent shuts down after
unsuccessfully retrying an
operation (agent encounters
an error such as server not
available, deadlock,
connection failure, or timeout failure).
Yes
14157
Replication: expired
subscription dropped
Expired subscription was
dropped.
No
20572
Replication: Subscription
reinitialized after
validation failure
Response job 'Reinitialize
subscriptions on data
validation failure' reinitializes
a subscription successfully.
No
20574
Replication: Subscriber
has failed data validation
Distribution or Merge Agent
fails data validation.
Yes
20575
Replication: Subscriber
has passed data validation
Distribution or Merge Agent
passes data validation.
Yes
20578
Replication: agent custom
shutdown
22815
Peer-to-peer conflict
detection alert
Distribution Agent detected
a conflict when it tries to
apply a change at a peer-topeer node.
Yes
In addition to these alerts, Replication Monitor provides a set of warnings and alerts related to status and
performance. For more information, see Set Thresholds and Warnings in Replication Monitor. You can also define
alerts for other replication events using the SQL Server alerts infrastructure. For more information, see Create a
User-Defined Event.
To configure predefined replication alerts
SQL Server Management Studio: Configure Predefined Replication Alerts (SQL Server Management Studio)
Viewing the Application Log Directly
To view the Windows application log, use the Microsoft Windows Event Viewer. The application log contains SQL
Server error messages as well as messages for many other activities on the computer. Unlike the SQL Server error
log, a new application log is not created each time you start SQL Server (each SQL Server session writes new events
to an existing application log); however, you can specify how long logged events will be retained. When you view
the Windows application log, you can filter the log for specific events. For more information, see the Windows
documentation.
Automating a Response to an Alert
Replication provides a response job for subscriptions that fail data validation, and also provides a framework for
creating additional automated responses to alerts. The response job is titled Reinitialize subscriptions on data
validation failure and is stored in the SQL Server Agent Jobs folder in SQL Server Management Studio. For
information about enabling this response job, see Configure Predefined Replication Alerts (SQL Server
Management Studio). If articles in a transactional publication fail validation, the response job reinitializes only those
articles that failed. If articles in a merge publication fail validation, the response job reinitializes all articles in the
publication.
Framework for Automating Responses
Usually, when an alert occurs, the only information you have to help you understand what caused the alert and the
appropriate action to take is contained in the alert message itself. Parsing this information can be error-prone and
time-consuming. Replication makes automating responses easier by providing additional information about the
alert in the sysreplicationalerts system table; the information provided is already parsed in a form easily used by
customized programs.
For example, if the data in the Sales.SalesOrderHeader table at Subscriber A fails validation, SQL Server can
trigger message 20574, notifying you of that failure. The message you receive will be: "Subscriber 'A', subscription
to article 'SalesOrderHeader' in publication 'MyPublication' failed data validation."
If you create a response based on the message, you must manually parse the Subscriber name, article name,
publication name, and error from the message. However, because the Distribution Agent and Merge Agent write
that same information to sysreplicationalerts (along with details such as the type of agent, time of the alert,
publication database, Subscriber database, and type of publication) the response job can directly query the relevant
information from the table. Although the exact row cannot be associated with a specific instance of the alert, the
table has a status column, which can be used to keep track of serviced entries. The entries in this table are
maintained for the history retention period.
For example, if you were to create a response job in Transact-SQL that services alert message 20574, you might use
the following logic:
declare @publisher sysname, @publisher_db sysname, @publication sysname, @publication_type int, @article
sysname, @subscriber sysname, @subscriber_db sysname, @alert_id int
declare hc cursor local for select publisher, publisher_db, publication, publication_type, article, subscriber,
subscriber_db, alert_id from
msdb..sysreplicationalerts where
alert_error_code = 20574 and status = 0
for read only
open hc
fetch hc into @publisher, @publisher_db, @publication, @publication_type, @article, @subscriber,
@subscriber_db, @alert_id
while (@@fetch_status <> -1)
begin
/* Do custom work */
/* Update status to 1, which means the alert has been serviced. This prevents subsequent runs of this job from
doing this again */
update msdb..sysreplicationalerts set status = 1 where alert_id = @alert_id
fetch hc into @publisher, @publisher_db, @publication, @publication_type, @article, @subscriber,
@subscriber_db, @alert_id
end
close hc
deallocate hc
See Also
Replication Agent Administration
Best Practices for Replication Administration
Monitoring (Replication)
Work with Replication Agent Profiles
3/24/2017 • 9 min to read • Edit Online
This topic describes how to work with Replication Agent Profiles in SQL Server 2017 by using SQL Server
Management Studio, Transact-SQL, or Replication Management Objects (RMO). The behavior of each replication
agent is controlled by a set of parameters that can be set through agent profiles. Each agent has a default profile,
and some have additional predefined profiles; at a given time, only one profile is active for an agent.
In This Topic
To work with Replication Agent Profiles, using:
SQL Server Management Studio
Access the Agent Profiles dialog box
Specify a profile for an agent
Create a profile
Modify a profile
Delete a profile
Transact-SQL
Create a profile
Modify a profile
Delete a profile
Use agent profiles during synchronization
Transact-SQL example
Replication Management Objects
Create a profile
Modify a profile
Delete a profile
Follow Up: After Changing Agent Parameters
Using SQL Server Management Studio
To access the Agent Profiles dialog box from SQL Server Management Studio
1. On the General page of the Distributor Properties - <Distributor> dialog box, click Profile Defaults.
To access the Agent Profiles dialog box from Replication Monitor
To open the dialog box for all agents, right-click a Publisher, and then click Agent Profiles.
To open the dialog box for a single agent:
1. Expand a Publisher group in the left pane of Replication Monitor, expand a Publisher, and then click a
publication.
2. For Distribution Agent and Merge Agent profiles, right-click a subscription on the All Subscriptions
tab, and then click Agent Profile. For other agents, right-click the agent on the Agents tab, and then
click Agent Profile.
To specify a profile for an agent
1. If the Agent Profiles dialog box displays profiles for more than one agent, select an agent.
2. Select a profile in the Default for new column of the Agent profiles grid. By default, the profile is only
applied to agents for new publications and subscriptions.
3. To specify that all agents of the selected type for existing publications or subscriptions should use this
profile, click Change existing agents.
To view and edit the parameters associated with a profile
1. If the Agent Profiles dialog box displays profiles for more than one agent, select an agent.
2. Click the properties button (…) next to a profile.
3. View the parameters and values in the <ProfileName> Profile Properties dialog box.
Parameters in user-defined profiles can be edited; parameters in predefined system profiles cannot.
To view all parameters for an agent, clear the Show only parameters used in this profile check
box. For information about agent parameters, see the links at the end of this topic.
4. Click Close.
To create a user-defined profile
1. If the Agent Profiles dialog box displays profiles for more than one agent, select an agent.
2. Click New.
3. In the New Agent Profile initialization dialog box, select an existing profile on which to base the new
profile.
4. In the New Agent Profile dialog box, enter values in the Name and Description text boxes.
5. Modify parameters to tailor the profile. To view all parameters for an agent, clear the Show only
parameters used in this profile check box. For information about agent parameters, see the links at the
end of this topic.
6. Click OK.
To delete a user-defined profile
1. If the Agent Profiles dialog box displays profiles for more than one agent, select an agent.
2. If a profile is associated with one or more agents, change the profile for those agents:
a. Select a different profile in the Agent profiles grid.
b. Click Change existing agents.
NOTE
This will change the profile for all agents of the selected type for existing publications or subscriptions, not
only the ones using the profile you want to delete.
3. Select the profile you want to delete, and then click Delete.
4. Click OK.
Using Transact-SQL
To create a new agent profile
1. At the Distributor, execute sp_add_agent_profile (Transact-SQL). Specify @name, a value of 1 for
@profile_type, and one of the following values for @agent_type:
1 - Replication Snapshot Agent
2 - Replication Log Reader Agent
3 - Replication Distribution Agent
4 - Replication Merge Agent
9 - Replication Queue Reader Agent
If this profile will become the new default profile for its type of replication agent, specify a value of 1
for @default. The identifier for the new profile is returned using the @profile_id output parameter.
This creates a new profile with a set of profile parameters based on the default profile for the given
agent type.
2. After the new profile has been created, add, remove, or modify the default parameters to customize the
profile.
To modify an existing agent profile
1. At the Distributor, execute sp_help_agent_profile (Transact-SQL). Specify one of the following values for
@agent_type:
1 - Replication Snapshot Agent
2 - Replication Log Reader Agent
3 - Replication Distribution Agent
4 - Replication Merge Agent
9 - Replication Queue Reader Agent
This returns all profiles for the specified type of agent. Note the value of profile_id in the result set
for the profile to change.
2. At the Distributor, execute sp_help_agent_parameter (Transact-SQL). Specify the profile identifier from step
1 for @profile_id. This returns all parameters for the profile. Note the name of any parameters to modify or
remove from the profile.
3. To change the value of a parameter in a profile, execute sp_change_agent_profile (Transact-SQL). Specify the
profile identifier from step 1 for @profile_id, the name of the parameter to change for @property, and a
new value for the parameter for @value.
NOTE
You cannot change an existing agent profile to become the default profile for an agent. You must instead create a
new profile as the default profile, as shown in the previous procedure.
4. To remove a parameter from a profile, execute sp_drop_agent_parameter (Transact-SQL). Specify the profile
identifier from step 1 for @profile_id and the name of the parameter to remove for @parameter_name.
5. To add a new parameter to a profile, you must do the following:
Query the MSagentparameterlist (Transact-SQL) table at the Distributor to determine which profile
parameters can be set for each agent type.
At the Distributor, execute sp_add_agent_parameter (Transact-SQL). Specify the profile identifier from
step 1 for @profile_id, the name of a valid parameter to add for @parameter_name, and the value
of the parameter for @parameter_value.
To delete an agent profile
1. At the Distributor, execute sp_help_agent_profile (Transact-SQL). Specify one of the following values for
@agent_type:
1 - Replication Snapshot Agent
2 - Replication Log Reader Agent
3 - Replication Distribution Agent
4 - Replication Merge Agent
9 - Replication Queue Reader Agent
This returns all profiles for the specified type of agent. Note the value of profile_id in the result set
for the profile to remove.
2. At the Distributor, execute sp_drop_agent_profile (Transact-SQL). Specify the profile identifier from step 1
for @profile_id.
To use agent profiles during synchronization
1. At the Distributor, execute sp_help_agent_profile (Transact-SQL). Specify one of the following values for
@agent_type:
1 - Replication Snapshot Agent
2 - Replication Log Reader Agent
3 - Replication Distribution Agent
4 - Replication Merge Agent
9 - Replication Queue Reader Agent
This returns all profiles for the specified type of agent. Note the value of profile_name in the result
set for the profile to use.
2. If the agent is started from an agent job, edit the job step that starts the agent to specify the value of
profile_name obtained in step 1 after the -ProfileName command-line parameter. For more information,
see View and Modify Replication Agent Command Prompt Parameters (SQL Server Management Studio).
3. When starting the agent from the command prompt, specify the value of profile_name obtained in step 1
after the -ProfileName command-line parameter.
Example (Transact-SQL )
This example creates a custom profile for the Merge Agent named custom_merge, changes the value of the UploadReadChangesPerBatch parameter, adds a new -ExchangeType parameter, and returns information on
the profile that is created.
DECLARE @profilename AS sysname;
DECLARE @profileid AS int;
SET @profilename = N'custom_merge';
-- Create a temporary table to hold the returned
-- Merge Agent profiles.
CREATE TABLE #profiles (
profile_id int,
profile_name sysname,
agent_type int,
[type] int,
description varchar(3000),
def_profile bit)
INSERT INTO #profiles (profile_id, profile_name,
agent_type, [type],description, def_profile)
EXEC sp_help_agent_profile @agent_type = 4;
SET @profileid = (SELECT profile_id FROM #profiles
WHERE profile_name = @profilename);
IF (@profileid IS NOT NULL)
BEGIN
EXEC sp_drop_agent_profile @profileid;
END
DROP TABLE #profiles
-- Add a new merge agent profile.
EXEC sp_add_agent_profile @profile_id = @profileid OUTPUT,
@profile_name = @profilename, @agent_type = 4,
@description = N'custom merge profile';
-- Change the value of uploadreadchangesperbatch in the profile.
EXEC sp_change_agent_parameter @profile_id = @profileid,
@parameter_name = N'-UploadReadChangesPerBatch', @parameter_value = 50;
-- Add a new parameter ExchangeType the profile.
EXEC sp_add_agent_parameter @profile_id = @profileid,
@parameter_name = N'-ExchangeType', @parameter_value = 1;
-- Verify the new profile.
EXEC sp_help_agent_parameter @profileid;
GO
Using RMO
To create a new agent profile
1. Create a connection to the Distributor by using an instance of the ServerConnection class.
2. Create an instance of the AgentProfile class.
3. Set the following properties on the object:
Name - the name for the profile.
AgentType - an AgentType value that specifies the type of replication agent for which the profile is
being created.
ConnectionContext - the ServerConnection created in step 1.
(Optional) Description - a description of the profile.
(Optional) Default - set this property to true if all new agent jobs for this AgentType will use this
profile by default.
4. Call the Create method to create the profile on the server.
5. Once the profile exists on the server, you can customize it by adding, removing, or changing the values of
replication agent parameters.
6. To assign the profile to an existing replication agent job, call the AssignToAgent method. Pass the name of
the distribution database for distributionDBName and the ID of the job for agentID.
To modify an existing agent profile
1. Create a connection to the Distributor by using an instance of the ServerConnection class.
2. Create an instance of the ReplicationServer class. Pass the ServerConnection object created in step 1.
3. Call the LoadProperties method. If this method returns false, verify that the Distributor exists.
4. Call the EnumAgentProfiles method. Pass an AgentType value to narrow down the returned profiles to a
specific type of replication agent.
5. Get the desired AgentProfile object from the returned ArrayList, where the Name property of the object
matches the profile name.
6. Call one of the following methods of AgentProfile to change the profile:
AddParameter - adds a supported parameter to the profile, where name is the name of the
replication agent parameter and value is the specified value. To enumerate all supported agent
parameters for a given agent type, call the EnumParameterInfo method. This method returns an
ArrayList of AgentProfileParameterInfo objects that represent all supported parameters.
RemoveParameter - removes an existing parameter from the profile, where name is the name of the
replication agent parameter. To enumerate all current agent parameters defined for the profile, call
the EnumParameters method. This method returns an ArrayList of AgentProfileParameter objects that
represent the existing parameter for this profile.
ChangeParameter - changes the setting of an existing parameter in the profile, where name is the
name of the agent parameter and newValue is the value to which the parameter is being changed. To
enumerate all current agent parameters defined for the profile, call the EnumParameters method.
This method returns an ArrayList of AgentProfileParameter objects that represent the existing
parameter for this profile. To enumerate all supported agent parameter settings, call the
EnumParameterInfo method. This method returns an ArrayList of AgentProfileParameterInfo objects
that represent the supported values for all parameters.
To delete an agent profile
1. Create a connection to the Distributor by using an instance of the ServerConnection class.
2. Create an instance of the AgentProfile class. Set the name of the profile for Name and the ServerConnection
from step 1 for ConnectionContext.
3. Call the LoadProperties method. If this method returns false, either the specified name was incorrect or the
profile does not exist on the server.
4. Verify that the Type property is set to User, which indicates a customer profile. You should not remove a
profile that has a value of System for Type.
5. Call the Remove method to remove the user-defined profile represented by this object from the server.
Follow Up: After Changing Agent Parameters
Agent parameter changes take effect the next time the agent is started. If the agent runs continuously, you must
stop and restart the agent.
See Also
Replication Agent Profiles
Replication Snapshot Agent
Replication Log Reader Agent
Replication Distribution Agent
Replication Merge Agent
Replication Queue Reader Agent
Start and Stop a Replication Agent (SQL Server
Management Studio)
3/24/2017 • 1 min to read • Edit Online
Start and stop agents from the Jobs folder and the Replication folder in Microsoft SQL Server Management
Studio and from Replication Monitor. Start and stop the following agents and jobs:
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 Distribution Agent, which synchronizes subscriptions to transactional and snapshot publications.
The Merge Agent, which synchronizes subscriptions to merge publications.
Replication maintenance jobs.
For more information about starting the Merge Agent and the Distribution Agent, see Synchronize a Push
Subscription and Synchronize a Pull Subscription. For more information about maintenance jobs, see Run
Replication Maintenance Jobs (SQL Server Management Studio).
For information about starting Replication Monitor, see Start the Replication Monitor.
To start and stop a Snapshot Agent or Log Reader Agent from Management Studio
1. Connect to the Publisher in Management Studio, and then expand the server node and the Replication
folder.
2. Expand the Local Publications folder, and then right-click a publication.
3. Click View Snapshot Agent Status or View Log Reader Agent Status.
4. Click Start or Stop.
To start and stop a Queue Reader Agent from Management Studio
1. Connect to the Distributor in Management Studio, and then expand the server node.
2. Expand the SQL Server Agent folder, and then expand the Jobs folder.
3. Right-click the job for the agent, and then click Start Job or Stop Job. The name of the job for the Queue
Reader Agent is in the form [<Distributor>].<integer>.
To start and stop a Snapshot Agent, Log Reader Agent, or Queue Reader Agent from Replication Monitor
1. Expand a Publisher group in the left pane, expand a Publisher, and then click a publication.
2. Click the Agents tab.
3. Right-click an agent, and then click Start Agent or Stop Agent.
See Also
Monitoring Replication
Replication Agent Executables Concepts
Replication Agents Overview
View and Modify Replication Agent Command
Prompt Parameters
4/6/2017 • 2 min to read • Edit Online
Replication agents are executables that accept command line parameters. By default, agents run under Microsoft
SQL Server Agent job steps, so these parameters can be viewed and modified using the Job Properties - <Job>
dialog box. This dialog box is available from the Jobs folder in SQL Server Management Studio and from the
Agents tab in Replication Monitor. For information about starting Replication Monitor, see Start the Replication
Monitor.
NOTE
Agent parameter changes take effect the next time the agent is started. If the agent runs continuously, you must stop and
restart the agent.
Although parameters can be modified directly, it is more common to modify them through an agent profile. For
more information, see Replication Agent Profiles.
If you access agent jobs from the Jobs folder, use the following table to determine the agent job name and the
parameters available for each agent.
AGENT
JOB NAME
FOR A LIST OF PARAMETERS, SEE…
Snapshot Agent
<Publisher><PublicationDatabase><Publication>-<integer>
Replication Snapshot Agent
Snapshot Agent for a merge publication
partition
Dyn_<Publisher><PublicationDatabase><Publication>-<GUID>
Replication Snapshot Agent
Log Reader Agent
<Publisher><PublicationDatabase>-<integer>
Replication Log Reader Agent
Merge Agent for pull subscriptions
<Publisher><PublicationDatabase><Publication>-<Subscriber><SubscriptionDatabase>-<integer>
Replication Merge Agent
Merge Agent for push subscriptions
<Publisher><PublicationDatabase><Publication>-<Subscriber><integer>
Replication Merge Agent
Distribution Agent for push
subscriptions
<Publisher><PublicationDatabase><Publication>-<Subscriber><integer>*
Replication Distribution Agent
AGENT
JOB NAME
FOR A LIST OF PARAMETERS, SEE…
Distribution Agent for pull subscriptions
<Publisher><PublicationDatabase><Publication>-<Subscriber><SubscriptionDatabase>-<GUID>\
Replication Distribution Agent
Distribution Agent for push
subscriptions to non-SQL Server
Subscribers
<Publisher><PublicationDatabase><Publication>-<Subscriber><integer>
Replication Distribution Agent
Queue Reader Agent
[<Distributor>].<integer>
Replication Queue Reader Agent
*For push subscriptions to Oracle publications, it is <Publisher>-<Publisher> rather than <Publisher><PublicationDatabase>
**For pull subscriptions to Oracle publications, it is <Publisher>-<DistributionDatabase> rather than
<Publisher>-<PublicationDatabase>
To view and modify replication agent command line parameters from Management Studio
1. Connect to the appropriate computer in Management Studio, and then expand the server node:
For the Distribution Agent and Merge Agent for pull subscriptions, connect to the Subscriber.
For all other agents, connect to the Distributor.
2. Expand the SQL Server Agent folder, and then expand the Jobs folder.
3. Right-click a job, and then click Properties.
4. On the Steps page of the Job Properties - <Job> dialog box, select the step Run agent, and then click
Edit.
5. In the Job Step Properties - Run agent dialog box, edit the Command field.
6. Click OK on both dialog boxes.
To view and modify Distribution Agent and Merge Agent command line parameters from Replication Monitor
1. Expand a Publisher group in the left pane of Replication Monitor, expand a Publisher, and then click a
publication.
2. Click the All Subscriptions tab.
3. Right-click a subscription, and then click View Details.
4. In the Subscription < SubscriptionName> window, click Action, and then click <AgentName> Job
Properties.
5. On the Steps page of the Job Properties - <Job> dialog box, select the step Run agent, and then click
Edit.
6. In the Job Step Properties - Run agent dialog box, edit the Command field.
7. Click OK on both dialog boxes.
To view and modify Snapshot Agent, Log Reader Agent, and Queue Reader Agent command line parameters
from Replication Monitor
1. Expand a Publisher group in the left pane of Replication Monitor, expand a Publisher, and then click a
publication.
2. Click the Agents tab.
3. Right-click an agent in the grid, and then click Properties.
4. On the Steps page of the Job Properties - <Job> dialog box, select the step Run agent, and then click
Edit.
5. In the Job Step Properties - Run agent dialog box, edit the Command field.
6. Click OK on both dialog boxes.
See Also
Replication Agent Administration
Replication Agent Executables Concepts
Replication Agents Overview
© Copyright 2026 Paperzz