SQL Server changes replication agent profile parameters and two conflicting policy settings

Source: Internet
Author: User

Original: SQL Server changes replication agent profile parameters and two conflicting policy settings

Since it is often necessary to synchronize tests and change agent profile properties, it is always scripted to facilitate testing.


There are two kinds of conflicting policies for updatable subscriptions: one is conflict in the publication, that is, when the subscription data is conflicting with the publication, and the other is in the subscription conflict, when the data is published to the subscription conflict.


Queue Reader Settings: conflict policy for publish to subscription

Agent Configuration parameter location:



The parameters inside are the parameters that need to be changed, which are not shown, and are not added to the configuration file. But canceling the tick above will see the configuration parameters as well.


using the replication agent Profile reference:https://msdn.microsoft.com/zh-cn/library/ms147893 (v=sql.100). aspx


View replication agent configuration files (msagent_profiles)

SELECT * FROM Msdb.dbo.MSagent_profiles



View the configuration file for the specified agent (executed at the Distributor on any database)

EXEC sp_help_agent_profile @agent_type = 9--9 for Queue Reader Agent


Change the profile description stored in the MSagent_profiles table (executed at the Distributor on any database)

exec sp_change_agent_profile  @profile_id = one, @property = ' description ', @value = ' agent configuration file for the replicated queued transaction reader. '


Increase the parameters of the agent configuration file (executed at the Distributor on any database)

exec sp_add_agent_parameter  @profile_id = 11--configuration file id, @parameter_name = ' resolverstate '--parameter name, @parameter_value = 2--parameter values (conflicts are based on subscriber)


Change the parameters of the agent configuration file (executed at the Distributor on any database)

exec sp_change_agent_parameter  @profile_id = 11--configuration file id, @parameter_name = ' resolverstate '--parameter name, @parameter_ Value = 2--parameter values (conflicts are subject to subscriber)


Publication property settings: Conflicting policy for subscription to publication


--  in the post conflict, the subscription is the same (publish database execution) EXEC sp_changepublication   @publication = n ' publicationname ', @property = N ' conflict_ Policy ', @value = N ' Sub Wins '


More parameter reference: Replication Agent Sp_changepublication


SQL Server changes replication agent profile parameters and two conflicting policy settings

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.