Monday, March 19, 2012

how to configure one-way merge replication?

With the appropriate replacements, this should do the job:
C:\Program Files\Microsoft SQL Server\80\COM>replmerg -
Publisher DH1791628 -PublisherDB xxxPublisher -
Publication xxxPublishertClients -Subscriber DH1791628 -Su
bscriberDB sub1 -Distributor DH1791628 -DistributorLogin
sa -DistributorPassword sa -ExchangeType 2
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Thank you Paul responding back. I tried the script but I keep getting this
error 'the process could not connect to the distributor.sql server does not
exist or access denied'. which login and password are we supposed to be
using? is it same as what the sqlserver agent is running as?
here is my script:
C:\Program Files\Microsoft SQL Server\80\COM>replmerg -publisher westcoast
-publisherDB westcoast -publication westcoast -subcriber testwestcoast
-subscriberDB testwestcoast -Distributor westcoast -distributorLogin sa
-distributorpassword sa -exchangeType 2
I set the log in and password to what my sqlserveragent was running under.
It still doesnt work. Please give me your suggestion on this. Thanks
Jessy
"Paul Ibison" wrote:

> With the appropriate replacements, this should do the job:
> C:\Program Files\Microsoft SQL Server\80\COM>replmerg -
> Publisher DH1791628 -PublisherDB xxxPublisher -
> Publication xxxPublishertClients -Subscriber DH1791628 -Su
> bscriberDB sub1 -Distributor DH1791628 -DistributorLogin
> sa -DistributorPassword sa -ExchangeType 2
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Is this push or pull?
According to the script you have a server called
westcoast, which has a published database called
westcoast and a publication called westcoast - is this
correct?
It looks like it must be a pull, as your distributor is
also westcoast.
If you want to use trusted security for the merge agent,
then set the -SubscriberSecurityMode parameter to 1. It
defaults to SQL Server security, so in the original
script I put sa and a password of sa - don't laugh - I
saw this and blank recently.
Rgds,
Paul Ibison
|||Paul, I am still getting the same error. "could not connect to the
distributor'.
My publisher and publication is called westcoast. I have 'pull' from
subscriber. i am setting my distributor on the same server as my publisher.
Where do you look to check the distributor properties. I check under
Distribution Agent, but its blank. Is this is correct? When you set up the
merge replication the distribution db automactically is generated. what is
this used for?
I set the subscribersecuritymode to 0 because i am using the sql server
authenticaton. I am still having problems setting this up correctly.
Jessy
"Paul Ibison" wrote:

> Is this push or pull?
> According to the script you have a server called
> westcoast, which has a published database called
> westcoast and a publication called westcoast - is this
> correct?
> It looks like it must be a pull, as your distributor is
> also westcoast.
> If you want to use trusted security for the merge agent,
> then set the -SubscriberSecurityMode parameter to 1. It
> defaults to SQL Server security, so in the original
> script I put sa and a password of sa - don't laugh - I
> saw this and blank recently.
> Rgds,
> Paul Ibison
>
|||Can you log into testwestcoast and open up a query
analyser window (connection) to westcoast, using your
values for -DistributorLogin and -DistributorPassword to
log in and check that this works.
The distribution database holds merge metadata and things
like the next identity range to be used, and you'll need
a valid sql server login for your publisher/distributor
for this to work.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Paul - I was able to run script w/o any errors. however its not doing what
i want. I need to only pull from the publisher to the subscriber. If i add
new records in subscriber it gets updated to the publisher. I dont want
data send back to the publisher. What am i doing wrong here?
C:\Program Files\Microsoft SQL Server\80\COM>replmerg -Publisher [TN5347]
-PublisherDB [westcoast] -Publication [westcoast] -Subscriber [TN5347]
-SubscriberDB [testwestcoast] -subscriberlogin sa -subscriberpassword
mypassword -subscribersecuritymode 0 -subscriptionType 1 -Distributor
[TN5347] -distributorlogin sa -distributorpassword sibu27 -exchangetype 2
Here is what the result was after running the script :
Connecting to Subscriber 'TN5347'
Connecting to Distributor 'TN5347'
Initializing
Connecting to Publisher 'TN5347'
Retrieving publication information
Retrieving subscription information
The merge process is cleaning up meta data in database 'westcoast'.
The merge process cleaned up 0 row(s) in MSmerge_genhistory, 0 row(s) in
MSmerge
_contents, and 0 row(s) in MSmerge_tombstone.
The merge process is cleaning up meta data in database 'testwestcoast'.
The merge process cleaned up 0 row(s) in MSmerge_genhistory, 0 row(s) in
MSmerge
_contents, and 0 row(s) in MSmerge_tombstone.
Downloading data changes to the Subscriber
No data needed to be merged.
No data needed to be merged.
"Paul Ibison" wrote:

> Can you log into testwestcoast and open up a query
> analyser window (connection) to westcoast, using your
> values for -DistributorLogin and -DistributorPassword to
> log in and check that this works.
> The distribution database holds merge metadata and things
> like the next identity range to be used, and you'll need
> a valid sql server login for your publisher/distributor
> for this to work.
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Jessy,
I think we're almost there. Please try -exchangetype 1.
Rgds,
Paul Ibison
"Jessy" <Jessy@.discussions.microsoft.com> wrote in message
news:9395EC21-B200-4ED4-9413-1F3FE22912B3@.microsoft.com...[vbcol=seagreen]
> Paul - I was able to run script w/o any errors. however its not doing
> what
> i want. I need to only pull from the publisher to the subscriber. If i
> add
> new records in subscriber it gets updated to the publisher. I dont want
> data send back to the publisher. What am i doing wrong here?
> C:\Program Files\Microsoft SQL Server\80\COM>replmerg -Publisher [TN5347]
> -PublisherDB [westcoast] -Publication [westcoast] -Subscriber [TN5347]
> -SubscriberDB [testwestcoast] -subscriberlogin sa -subscriberpassword
> mypassword -subscribersecuritymode 0 -subscriptionType 1 -Distributor
> [TN5347] -distributorlogin sa -distributorpassword sibu27 -exchangetype 2
> Here is what the result was after running the script :
> Connecting to Subscriber 'TN5347'
> Connecting to Distributor 'TN5347'
> Initializing
> Connecting to Publisher 'TN5347'
> Retrieving publication information
> Retrieving subscription information
> The merge process is cleaning up meta data in database 'westcoast'.
> The merge process cleaned up 0 row(s) in MSmerge_genhistory, 0 row(s) in
> MSmerge
> _contents, and 0 row(s) in MSmerge_tombstone.
> The merge process is cleaning up meta data in database 'testwestcoast'.
> The merge process cleaned up 0 row(s) in MSmerge_genhistory, 0 row(s) in
> MSmerge
> _contents, and 0 row(s) in MSmerge_tombstone.
> Downloading data changes to the Subscriber
> No data needed to be merged.
> No data needed to be merged.
>
> "Paul Ibison" wrote:
|||Paul- i tried the exchangetype 1 but its not working. I mean everything is
updated on both ends. I thought i should be using exchangeType 2 if i want
the publisher to only send data and not get data back. 'A value of 2
indicates that the agent should download data changes from the Publisher to
the Subscriber'. Do we need to reintalize in order for this to work?
Also I am using numeric id 'yes(not for replication)'. I know rowguid is
generated when we set up merge replication. however i noticed the numeric
id's show up twice on the table. If table 1 generated person 1 with id 1
this number is also added to the other table 2 as the same number. but table
2 already has a person with the same number 1. Is this correct?
Lastly, i previously deleted a replication on another database and ran some
store procedures sp_removedbreplication to clean up the merge replication
from publisher and subscriber. But the publications are still displayed in
the publisher folder and snapshot agent folder under replication monitor. So
my replication monitor is showing a red 'X'. How do you get rid of the
deleted publications on the replication monitor?
"Paul Ibison" wrote:

> Jessy,
> I think we're almost there. Please try -exchangetype 1.
> Rgds,
> Paul Ibison
> "Jessy" <Jessy@.discussions.microsoft.com> wrote in message
> news:9395EC21-B200-4ED4-9413-1F3FE22912B3@.microsoft.com...
>
>
|||Jessy,
yes, this value is incorrectly reported in some places so apologies. A value
of 1 indicates uploads to publisher only, 2 means subscriber to publisher.
Actually your previous post indicates you have it set correctly! I just
assumed you'd got the values the wrong way round. "Downloading data changes
to the Subscriber" appears and not the corresponding upload message. There's
no data exchange, but does it report the same message when you add a row to
publisher and subscriber ie no uploads?
Reinitialization is not necessary. Are you using MSDE? If not, then add the
parameter to the merge agents middle step and try there.
For the identity columns, it looks like you haven't enabled automatic range
management. You'll need this to partition the ranges. The best thing here is
to drop your subscription and then edit the article properties (elipsis
button) to enable a large identity range for the publisher and subscriber.
To get rid of the red x running sp_MSload_replication_status normally clears
this error or restarting the sql server service also works - tempdb needs
clearing out and this'll rebuild it.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||where do I look for the message report? I dont see any messages displayed
when i am inserting to the subscriber or publisher. I just click on the "!"
and the whatever i entered in the subscriber is still showing on the
publisher. How do i fix this?
I am using MSDE for just testing purpose. When i get this replication
working the way i want i will i try this on the server box. I believe thats
a standard/enterprise SQL Server.
"Paul Ibison" wrote:

> Jessy,
> yes, this value is incorrectly reported in some places so apologies. A value
> of 1 indicates uploads to publisher only, 2 means subscriber to publisher.
> Actually your previous post indicates you have it set correctly! I just
> assumed you'd got the values the wrong way round. "Downloading data changes
> to the Subscriber" appears and not the corresponding upload message. There's
> no data exchange, but does it report the same message when you add a row to
> publisher and subscriber ie no uploads?
> Reinitialization is not necessary. Are you using MSDE? If not, then add the
> parameter to the merge agents middle step and try there.
> For the identity columns, it looks like you haven't enabled automatic range
> management. You'll need this to partition the ranges. The best thing here is
> to drop your subscription and then edit the article properties (elipsis
> button) to enable a large identity range for the publisher and subscriber.
> To get rid of the red x running sp_MSload_replication_status normally clears
> this error or restarting the sql server service also works - tempdb needs
> clearing out and this'll rebuild it.
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>

No comments:

Post a Comment