Merge Agent Profile

SQL Replication

Replication

Merge Agent Profile

A default profile for the Merge Agent is installed when a server is configured as a Distributor. The default profile contains the following parameters and values.

Parameter Default Value
Description
-BcpBatchSize 100000 The number of rows to send a bulk copy operation. When performing a bcp in an operation while applying the schema changes, the Merge Agent uses the batch size to determine when to log a progress message. A value of 0 indicates no message logging.
-ChangesPerHistory 100 The threshold beyond which upload and download messages are logged.
-DownloadGenerationsPerBatch 100 The number of generations to be processed in one 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 an unreliable communication link is 10.

In all cases, however, the actual number of generations processed per batch will be equal to the greater of the UploadGenerationsPerBatch setting or the number of articles published plus 1.

-DownloadReadChangesPerBatch 100 The number of changes to be read in one batch while downloading changes from the Publisher to the Subscriber.
-DownloadWriteChangesPerBatch 100 The number of changes to be applied in one batch while downloading changes from the Publisher to the Subscriber.
-FastRowCount 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.
-HistoryVerboseLevel 1 The amount of history logged during a merge operation can be:

1 = Always update a previous history message of the same status (startup, progress, success, and so forth). If no previous record with the same status exists, insert a new record. This level logs the minimum number of messages.
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. This level logs level 1 messages plus additional in-progress messages.
3 = Always insert new records, unless it is for idle messages.

You can minimize the performance effect of history logging by setting the ChangesPerHistory parameter.

-KeepAliveMessageInterval 300 The number of seconds before history thread checks if any of the existing connections is waiting for a response from the server. This value can be increased to avoid getting the agent marked as suspect by the checkup agent when executing a long-running batch.
-LoginTimeOut 15 The number of seconds before the login attempted by the agent times out.
-MaxDownloadChanges 0 The maximum number of changes you want to download during a specific merge session. Because complete generations are processed, the number of rows downloaded may go over the specified maximum.
-MaxUploadChanges 0 The maximum number of changes you want to upload during a specific merge session. Because complete generations are processed, the number of rows uploaded may go over the specified maximum.
-NumDeadlockRetries 5 The number of times the merge process attempts to retry an internal operation when it encounters a deadlock error. Can be any value between 1 and 100.
-PollingInterval 60 The number of seconds the Publisher or Subscriber is queried for data changes when in continuous mode.
-QueryTimeOut 300 The number of seconds before the queries issued by the agent times out.
-StartQueueTimeout 0 If the number of merge processes running is at the limit, this indicates the maximum number of seconds that the Merge Agent waits. 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.
-UploadGenerationsPerBatch 100 The number of generations to be processed in one 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 an unreliable communication link is 1.

In all cases, however, the actual number of generations processed per batch will be equal to the greater of the UploadGenerationsPerBatch setting or the number of articles published plus 1.

-UploadReadChangesPerBatch 100 The number of changes to be read in one batch while uploading changes from the Subscriber to the Publisher.
-UploadWriteChangesPerBatch 100 The number of changes to be applied in one batch while uploading changes from the Subscriber to the Publisher.
-Validate 0 Specifies if validation should be done at the end of the merge session, and, if so, what type of validation. A value of 0 (default) indicates no validation. A value of 1 indicates rowcount-only validation. A value of 2 indicates rowcount and checksum validation. A value of 3 indicates binary checksum validation (available only with SQL Server 2000).
-ValidateInterval 60 The number of minutes the subscription is validated when set to continuous mode.