Wednesday, March 28, 2012
Merge replication with autoincrement field
I have two separate system with some data common between them.
For simplicity let's say System A contains some data that is same with
System B. Now I want to get the data from System A to System B by
merge replication (dont want to send data from System B to System A -
using merge replication for filtering using "join". if this can be
done in some other way using transactional replication please let me
know).
But in System A there are few tables with autoincrement fields set for
the primary key field. I am entering data in those tables in System B
also.
Now, how can I handle this - insert records in both system avoiding
clash for the primary key.
PS: I know in MySQL they handle this case by setting up the
replication and then change the seed value and increment value for
different database systems and by thus avoid the clash.
Thanks,
Rakesh.
Rakesh,
on the article properties form there is a tab to manage the identity values.
In SQL 2005 this is set automatically but in SQL 2000 you have to enable it
manually. Once a large range has been selected, there should be no issues as
the ranges are partitioned.
HTH,
Paul Ibison
Wednesday, March 21, 2012
Merge Replication Problem with separate Publisher/Distributor
publication and distribution. The servers are in the same domain. The same
domain account is used oon all servers involved with the replication. The
setup scripts perform the following task:
Distributor (Master db)
sp_AddDistributor
sp_MSupdateAgentType_default @.profile_id = 1
sp_MSupdateAgentType_default @.profile_id = 2
sp_MSupdateAgentType_default @.profile_id = 4
sp_MSupdateAgentType_default @.profile_id = 6
sp_MSupdateAgentType_default @.profile_id = 11
sp_AddDistributionDB
jobs: Agent History Cleanup
DistributionDB Cleanup
Sp_AddDistPublisher @.SecurityMode = 1
@.Trusted = N'False'
@.ThirdParty_flag = 0
do you have a remote distributor?
If not it sounds like your replication setup is not configured correctly.
Remove replication (follow the menu items to disable publishing) and
reinstall it.
"PaulW" <MSNewsGroup@.Digi-Sol.com> wrote in message
news:%23r2otLqMEHA.2064@.TK2MSFTNGP12.phx.gbl...
> We are trying to setup merge replication using separate servers for the
> publication and distribution. The servers are in the same domain. The same
> domain account is used oon all servers involved with the replication. The
> setup scripts perform the following task:
>
> Distributor (Master db)
>
> sp_AddDistributor
>
> sp_MSupdateAgentType_default @.profile_id = 1
> sp_MSupdateAgentType_default @.profile_id = 2
> sp_MSupdateAgentType_default @.profile_id = 4
> sp_MSupdateAgentType_default @.profile_id = 6
> sp_MSupdateAgentType_default @.profile_id = 11
>
> sp_AddDistributionDB
>
> jobs: Agent History Cleanup
> DistributionDB Cleanup
>
> Sp_AddDistPublisher @.SecurityMode = 1
> @.Trusted =
N'False'
> @.ThirdParty_flag = 0
> .
>
> Jobs: Expired Subscription Cleanup
> Reinitialize subscription having data validation failures
> Replication agent Checkup
> SnapShot
>
>
> Publisher (Master db)
>
> Jobs: Reinitialize subscription having data validation failures
> Replication agent Checkup
>
> sp_AddSubscriber
>
> Server: Msg 14071 Procedure sp_AddSubscriber, line 129 Could not find the
> Distributor or the distribution database for the local server. The
> Distributor may not be installed, or the local server may not be
configured
> as a Publisher at the Distributor
>
>
> E.M. on the distributor list the publisher with out any publications. Line
> 129 of sp_AddSubscriber is sp_HelpDistributor which according to the help
is
> to run only on the distributor, explaining the error. Sp_AddSubscriber is
> supposed to be run on the publisher.
>
> What am I missing?
>
>
> tia
> Paul
>
>
|||We are using a remote distributor. We did not set a password in
sp_adddistributor. In sp_adddistpublisher we tried both trusted and not
trusted. The authentication on all servers is set to Windows only. I noticed
that the distributor_admin account is a SQL Server account. Can this be the
problem? If so, is there a way to get this to run using Windows only?
Paul
"Hilary Cotter" <hilaryk@.att.net> wrote in message
news:ujpd7bxMEHA.2484@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> do you have a remote distributor?
> If not it sounds like your replication setup is not configured correctly.
> Remove replication (follow the menu items to disable publishing) and
> reinstall it.
> "PaulW" <MSNewsGroup@.Digi-Sol.com> wrote in message
> news:%23r2otLqMEHA.2064@.TK2MSFTNGP12.phx.gbl...
same[vbcol=seagreen]
The[vbcol=seagreen]
> N'False'
the[vbcol=seagreen]
> configured
Line[vbcol=seagreen]
help[vbcol=seagreen]
> is
is
>
|||We tried to setup merge replication using the remote distributor through
E.M. and it worked. Then we used the option to generate SQL scripts. When we
ran the scripts, errors were generated. One of the errors was, in one job
only; the server name was used for the server name and the distributor
database name. They were not the same name.
We did find out that the distributor must be using SQL and Windows
authentication. That option along did not get our scripts working. There
must be something subtle that I am missing.
Paul
"PaulW" <MSNewsGroup@.Digi-Sol.com> wrote in message
news:#7OrH#3MEHA.1644@.TK2MSFTNGP09.phx.gbl...
> We are using a remote distributor. We did not set a password in
> sp_adddistributor. In sp_adddistpublisher we tried both trusted and not
> trusted. The authentication on all servers is set to Windows only. I
noticed
> that the distributor_admin account is a SQL Server account. Can this be
the[vbcol=seagreen]
> problem? If so, is there a way to get this to run using Windows only?
>
> Paul
>
> "Hilary Cotter" <hilaryk@.att.net> wrote in message
> news:ujpd7bxMEHA.2484@.TK2MSFTNGP09.phx.gbl...
correctly.[vbcol=seagreen]
the
> same
> The
> the
> Line
> help
> is
>
|||I believe this is because you don't have the addDistributor S.P. being run
on the publisher as well as the distributor. ;)
Friday, March 9, 2012
Merge replication fails with odd message
I've got a merge replication set up between boxes. They're on separate sites both behind an ADSL Nat modem router. The publisher connects to the subscriber via a port forward / Nat translation at the router. This replication set up has been running for some months now. This morning I got this failure message from the merge agent on the publisher.
"the specified remote server name may not be the network name of the remote server or the remote server is unreachable due to network problems. The step failed"
Currently the Enterprise Mgr at the publisher can see the subscriber as can query analyzer running on the publisher.
The host name of the subscriber is the same name used in the server registration at the publisher. The registration uses a Client Network Utility alias to resolve the name.
If I run a ping command at the publisher using the subscribers name I get replies (the resolution of that name is done via a hosts file entry)
Both machines are Win2k Server boxes running SQL Server 2000 Standard.
Any ideas why the agent can't see the subscriber despite the fact its usual communications channel is working just fine?I've still no idea why I was getting this behaviour but I've reinitialised the subscriptions now and the problem's 'gone'.
Saturday, February 25, 2012
Merge Replication between two servers not connected via internet and on two separate domains
I have two sql server 2000 databases and I wish to do merge replication between them, the problem is that they are not connected via the internet (no ping) and are on two separate domains in different countries.
I can use email and I can use encrypted ftp.
I am wondering if I could use sql ce merge replication to a pocket pc which creates an sdf file, that I then email backwards and forwards and build identical publication and subscriptions at either server to merge sync with this sdf file through a pocket pc.
Has anyone done this before?
Does anyone have any other suggestions?
It's not going to be possible. Merge replication is built with partners that can publish/subscribe to each other. If all you have is email/ftp, you will have to roll your own "merge" - take look at bcp/bulkload/dts in book online.Merge Replication Between two Existing Databases?
Hi gang,
We have a couple of databases on separate servers that have exactly the same schema, and we would like to set up merge replication between them.
Is that possible? The few times we've experimented on test databases, the subscriber database has been trashed and rebuilt using data from the publisher, rather than preserving data from both databases.
I'm really new to replication in general, so any kind of advice would be helpful.
Cheers,
Matt
Yes it's possible, see topic in Books Online "Initializing a Merge Subscription Without a Snapshot".
|||Thanks Greg. I guess sometimes the help really is helpful!