Showing posts with label merge. Show all posts
Showing posts with label merge. Show all posts

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)
>
>

Monday, March 12, 2012

how to configure from local distributor to remote

Hi,
I already have a merge replication setup successfully.
However I now need to change the network from a central publisher to a
central publisher with remote distributor
See http://www.databasejournal.com/features/mssql/article.php/1458491 and
Ctrl+F for the words central publisher.
I tried to redo another publication but the wizard no longer asks me whether
I want my distributor to be on a remote machine.
Then I tried to follow this article
http://technet.microsoft.com/en-us/library/ms151192.aspx
and looked for a Configure distribution which I cannot find.
Then I tried this article
http://msdn2.microsoft.com/en-us/library/ms147363.aspx
, but realise that the value of installed in the result set is 1, so I am
not sure what I should do next. Furthermore I am unfamiliar with the T-SQL
syntax necessary to make the changes.
FYI, the result set from using the sp_get_distribution was
installed = 1
distribution server = machineName
distribution db installed = 1
is distribution publisher = 1
has remote distribution = 0
Please advise. I am running SQL server 2005 Trial edition on 2 separate
win2003 server with one of them already set up as a successful central
publisher.
If I really have no choice but to use T-SQL please give me more explicit
details. Thank you.
This is pretty much a one-off choice. To move to a remote distributor I'd
script out the publications, remove the subscriptionas and publications,
remove the distributor entirely, readd the distributor remotely then add the
publications again.
HTH,
Paul Ibison

How to configure a Database both, as a Publisher and a Subscriber ?

Hi ,
I am using merge replication wherein we have the following architecture.
We have three different databases. One DB acts as the back office server. The second acts as the desktop DB and the last one is a mobile DB i.e. SQLCE DB.
Data needs to be synchronized between the back office server and the desktop. The SQL CE database connects to the desktop for data synchronization. i.e.
I want to push and pull data from the mobile DB to the desktop DB. Hence, here the Desktop DB acts as the Publisher, and the SQL CE DB acts as subscriber.
Further, the desktop DB needs to push and pull data from the back office DB. Hence, in this case, the Desktop DB acts as the subscriber to the Server, and the back office DB acts as publisher.

Merge replication is not allowing me to make the desktop DB as publisher as well as the subscriber at the same time.

Is there any way we can accomplish this?

Thanks in advance.
Regards,
Pushkar.Hi,

Open the SQL Enterprise manager and select the distributor SQL server.
Select the replication option in the tools menu.
Select the option Configure publishers, subscribers and distributors.

Remember to declare all the involved SQL servers on the Distributor (!) via the Client Network Utility (a small program which is installed together with SQL server)

Success, VincentJS