Setting up the merge agents

The synchronization process in merge replication ensures that data at the Publisher and Subscribers eventually converge and that all sites end up with the same data values. However, the sites are never completely synchronized unless there is a period of complete inactivity in iBase.

The best way to ensure that the sites are as closely synchronized as possible is to set a low polling interval, particularly for the entity and link data, for example a 1 second polling interval. Different considerations will apply for the iBase security data and audit log.

Note: After you change agent properties, stop and start the agent, or start the agent manually by using Start Synchronizing.

The SQLServerAgent service should be set to auto-start whenever the operating system starts.

Configuring the Merge Agent to run continuously

The pull subscriptions that you use to deploy replication to the subscriber sites for large entity and link databases are configured for On Demand synchronization. However, in day-to-day use, the Merge Agent must run continuously for iBase database replication to function correctly. To reconfigure the Merge Agent, change the properties of the Merge Agent by adding the following to the Run Agent command line:
-Continuous

This parameter specifies that the agent queries the Publisher or Subscriber for data changes at the specified interval, even if there are no updates pending.

You also need to set the polling interval as described in the following information.

Start or restart the agent to use the new agent properties.
Note: Until the Merge Agent is set to run continuously, a pull subscription at the Subscriber has the status Never Started and at the Publisher, the status Deactivated.

Merge Agent for the entity and link database

By default, the Merge Agent runs every 60 seconds. Reconfigure the Merge Agent to run at a 1 second polling interval to reduce the risk that data conflicts occur. Add the following to the Run Agent command line:
-PollingInterval 1
Start or restart the agent to use the new agent properties.

Merge Agent for the security database

For the security data, you can set the polling interval for the Merge Agent for each Subscriber to any required frequency, for example 1 second. To decide the polling interval for this database, consider:
  • How often does the user data in the security database change?
  • How quickly must changes be replicated to other sites?
Note: Users can add records at the Subscriber before their user login is known at the Publisher.

Merge Agent for the audit log

If you replicate the audit log, you can set the polling interval for the Merge Agent for each Subscriber to any suitable frequency, for example hourly. However, the best frequency for your organization depends on:
  • How often analysts consult the audit log
  • How long it takes for a problem to be identified and for analysts to decide to review the audit log
  • The audit level of the database
Where the audit level is set to 5, all database activity is logged including tasks that do not change the data, such as browsing. In this case, you might want to configure an interval that coincides with quieter periods on your communication links.

Merge Agent for a read-only database

Configure the Merge Agent for a read-only iBase database to prevent any changes made at the Subscriber from being uploaded to the Publisher. For example, changes made through SQL Server Query Analyzer.

To reconfigure the Merge Agent, add this parameter to the Run Agent command line:

-ExchangeType 2

The argument specifies that the agent only downloads data changes from the Publisher to the Subscriber.