Hi,
I'm trying to resolve a merge replication conflict problem, and I'm not sure
how to do it, additionally to this, I imagine that this is a very common
problem, so, some expert may point me on the right direction.
I have 3 tables that needs to be replicated, 1 publisher, 10 anonymous
subscribers that do a 'pull' and each subscriber synchronize automatically
once a day, a requirement is that all conflicts must be resolved without
human intervention.
These are the structures of the tables I'm using :
CREATE TABLE [dbo].[States] (
[Id] uniqueidentifier ROWGUIDCOL NOT NULL ,
[Name] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[Cities] (
[Id] uniqueidentifier ROWGUIDCOL NOT NULL ,
[Name] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[StateId] [uniqueidentifier] NOT NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[Properties] (
[Id] uniqueidentifier ROWGUIDCOL NOT NULL ,
[PublicationDate] [datetime] NOT NULL ,
[Address] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[CityId] [uniqueidentifier] NOT NULL ,
[Price] [money] NOT NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[States] WITH NOCHECK ADD
CONSTRAINT [PK_States] PRIMARY KEY CLUSTERED
(
[Id]
) ON [PRIMARY]
ALTER TABLE [dbo].[Cities] WITH NOCHECK ADD
CONSTRAINT [PK_Cities] PRIMARY KEY CLUSTERED
(
[Id]
) ON [PRIMARY]
ALTER TABLE [dbo].[Properties] WITH NOCHECK ADD
CONSTRAINT [PK_Properties] PRIMARY KEY CLUSTERED
(
[Id]
) ON [PRIMARY]
ALTER TABLE [dbo].[States] ADD
CONSTRAINT [DF_States_Id] DEFAULT (newid()) FOR [Id],
CONSTRAINT [IX_States] UNIQUE NONCLUSTERED
(
[Name]
) ON [PRIMARY]
ALTER TABLE [dbo].[Cities] ADD
CONSTRAINT [DF_Cities_Id] DEFAULT (newid()) FOR [Id],
CONSTRAINT [IX_Cities] UNIQUE NONCLUSTERED
(
[Name]
) ON [PRIMARY]
ALTER TABLE [dbo].[Properties] ADD
CONSTRAINT [DF_Properties_Id] DEFAULT (newid()) FOR [Id]
ALTER TABLE [dbo].[Cities] ADD
CONSTRAINT [FK_Cities_States] FOREIGN KEY
(
[StateId]
) REFERENCES [dbo].[States] (
[Id]
)
ALTER TABLE [dbo].[Properties] ADD
CONSTRAINT [FK_Properties_Cities] FOREIGN KEY
(
[CityId]
) REFERENCES [dbo].[Cities] (
[Id]
)
Ok. the three tables needs to be merged and I want to resolve this problem :
Subscriber1 enter this data :
State [1, 'state1']
City [1, 'city1', 1]
Subscriber2 enter this data :
State [2, 'state1']
City [2, 'city2', 2]
Now subscriber1 synchronize and then subscriber2, and the data on the
publisher is :
State [1, 'state1']
City [1, 'city1', 1]
(the second state1 cant be inserted because of the unique contraint on the
name and the city2 cant be inserted because the fk does not exists)
(this is with the default resolver)
And I want this to be resolved as :
State [1, 'state1']
City [1, 'city1', 1]
City [2, 'city2', 1]
So, the questions are :
Can this be resolved with a custom stored procedure resolver ?
It seems that I need to run an stored procedure on the publisher just after
a subscriber upload his data, so the modified keys are properly changed at
the subscriber when the data back to him... obiously, for this to work I
need to remove the name's unique constraints, and handle this uniqueness
manually... can this solution be applied ?
I would really apressiate some help, thanks.
Paul.
Please any advice ?
"-ND-" <ndeath@.gmx.net> wrote in message
news:%23WwDRSvxEHA.1168@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I'm trying to resolve a merge replication conflict problem, and I'm not
sure
> how to do it, additionally to this, I imagine that this is a very common
> problem, so, some expert may point me on the right direction.
> I have 3 tables that needs to be replicated, 1 publisher, 10 anonymous
> subscribers that do a 'pull' and each subscriber synchronize automatically
> once a day, a requirement is that all conflicts must be resolved without
> human intervention.
> These are the structures of the tables I'm using :
> CREATE TABLE [dbo].[States] (
> [Id] uniqueidentifier ROWGUIDCOL NOT NULL ,
> [Name] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
> ) ON [PRIMARY]
> CREATE TABLE [dbo].[Cities] (
> [Id] uniqueidentifier ROWGUIDCOL NOT NULL ,
> [Name] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
> [StateId] [uniqueidentifier] NOT NULL
> ) ON [PRIMARY]
> CREATE TABLE [dbo].[Properties] (
> [Id] uniqueidentifier ROWGUIDCOL NOT NULL ,
> [PublicationDate] [datetime] NOT NULL ,
> [Address] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
,
> [CityId] [uniqueidentifier] NOT NULL ,
> [Price] [money] NOT NULL
> ) ON [PRIMARY]
> ALTER TABLE [dbo].[States] WITH NOCHECK ADD
> CONSTRAINT [PK_States] PRIMARY KEY CLUSTERED
> (
> [Id]
> ) ON [PRIMARY]
> ALTER TABLE [dbo].[Cities] WITH NOCHECK ADD
> CONSTRAINT [PK_Cities] PRIMARY KEY CLUSTERED
> (
> [Id]
> ) ON [PRIMARY]
> ALTER TABLE [dbo].[Properties] WITH NOCHECK ADD
> CONSTRAINT [PK_Properties] PRIMARY KEY CLUSTERED
> (
> [Id]
> ) ON [PRIMARY]
> ALTER TABLE [dbo].[States] ADD
> CONSTRAINT [DF_States_Id] DEFAULT (newid()) FOR [Id],
> CONSTRAINT [IX_States] UNIQUE NONCLUSTERED
> (
> [Name]
> ) ON [PRIMARY]
> ALTER TABLE [dbo].[Cities] ADD
> CONSTRAINT [DF_Cities_Id] DEFAULT (newid()) FOR [Id],
> CONSTRAINT [IX_Cities] UNIQUE NONCLUSTERED
> (
> [Name]
> ) ON [PRIMARY]
> ALTER TABLE [dbo].[Properties] ADD
> CONSTRAINT [DF_Properties_Id] DEFAULT (newid()) FOR [Id]
> ALTER TABLE [dbo].[Cities] ADD
> CONSTRAINT [FK_Cities_States] FOREIGN KEY
> (
> [StateId]
> ) REFERENCES [dbo].[States] (
> [Id]
> )
> ALTER TABLE [dbo].[Properties] ADD
> CONSTRAINT [FK_Properties_Cities] FOREIGN KEY
> (
> [CityId]
> ) REFERENCES [dbo].[Cities] (
> [Id]
> )
>
> Ok. the three tables needs to be merged and I want to resolve this problem
:
> Subscriber1 enter this data :
> State [1, 'state1']
> City [1, 'city1', 1]
> Subscriber2 enter this data :
> State [2, 'state1']
> City [2, 'city2', 2]
> Now subscriber1 synchronize and then subscriber2, and the data on the
> publisher is :
> State [1, 'state1']
> City [1, 'city1', 1]
> (the second state1 cant be inserted because of the unique contraint on the
> name and the city2 cant be inserted because the fk does not exists)
> (this is with the default resolver)
> And I want this to be resolved as :
> State [1, 'state1']
> City [1, 'city1', 1]
> City [2, 'city2', 1]
> So, the questions are :
> Can this be resolved with a custom stored procedure resolver ?
> It seems that I need to run an stored procedure on the publisher just
after
> a subscriber upload his data, so the modified keys are properly changed at
> the subscriber when the data back to him... obiously, for this to work I
> need to remove the name's unique constraints, and handle this uniqueness
> manually... can this solution be applied ?
> I would really apressiate some help, thanks.
> Paul.
>
Showing posts with label resolve. Show all posts
Showing posts with label resolve. Show all posts
Wednesday, March 28, 2012
Friday, March 9, 2012
Merge Replication Errors 18456 and 20028
Hello,
I am currently in the process of setting up merge replication and am
encountering some errors that I can not resolve. I hope that I am able to
provide enough information, however please ask for more detail if necessary.
While using the Replication wizard, my first error encountered was the 18456
- the original error message was sa login failed...while messing with the
remote login mapping the error changed to distributor_admin login failed. I
resolved this by using the sp_changedistributor_password and this then
allowed me to run through the wizard to set up the distributor. At this
point, I did not set up the publisher or publications or subscribers.
Ok, so now I can go into the confiuration screen and set up the publisher to
use the non-trusted SQL Server authentication using distributor_admin (also
tried sa). When I specify a merge publication and click ok (only trying one
table at this point) I get the 20028 error saying that the distributor is not
configured correctly.
In reading through multiple forums and asking questions, I'm told to use the
sp_dropserver dropping the logins in the process of course and then the
sp_addserver with the local param.
This has not resolved the issue...There are 3 servers right now in the
sysservers table. S13 is the local server name id=0, DALSQL is the
distributor with id=2 and repl_distributor with id=3.
Any suggestions or thoughts would be greatly appreciated!
Thanks in advance,
Brian
here's the output of the @.@.servername and the server name property along with
the records in the sysservers table...
SELECT @.@.SERVERNAME
SELECT CONVERT(char(20), SERVERPROPERTY('servername'))
SELECT * FROM SYSSERVERS
S13
S13
0 1089 S13 SQL Server SQLOLEDB S13 NULL NULL 2005-11-08 08:03:09.880 NULL
NULL NULL NULL 0 0 S13 0 1 0 0 0 0 1 0 0 0 1 0 NULL
1 1609 repl_distributor SQL Server SQLOLEDB S13 NULL NULL 2005-11-08
07:04:25.793 NULL NULL NULL NULL 0 0 S13 0 1 0 0 1 0 1 0 0 1 1 0 NULL
2 1089 ORDSQL01 SQL Server SQLOLEDB ORDSQL01 NULL NULL 2005-11-08
05:26:16.060 NULL NULL NULL NULL 0 0 ORDSQL01 0 1 0 0 0 0 1 0 0 0 1 0 NULL
3 1089 DALSQL01.SPAREBACKUP.COM SQL Server SQLOLEDB DALSQL01.SPAREBACKUP.COM
NULL NULL 2005-11-08 05:41:31.450 NULL NULL NULL NULL 0 0
DALSQL01.SPAREBACKUP.COM 0 1 0 0 0 0 1 0 0 0 1 0 NULL
"brianswestra" wrote:
> Hello,
> I am currently in the process of setting up merge replication and am
> encountering some errors that I can not resolve. I hope that I am able to
> provide enough information, however please ask for more detail if necessary.
> While using the Replication wizard, my first error encountered was the 18456
> - the original error message was sa login failed...while messing with the
> remote login mapping the error changed to distributor_admin login failed. I
> resolved this by using the sp_changedistributor_password and this then
> allowed me to run through the wizard to set up the distributor. At this
> point, I did not set up the publisher or publications or subscribers.
> Ok, so now I can go into the confiuration screen and set up the publisher to
> use the non-trusted SQL Server authentication using distributor_admin (also
> tried sa). When I specify a merge publication and click ok (only trying one
> table at this point) I get the 20028 error saying that the distributor is not
> configured correctly.
> In reading through multiple forums and asking questions, I'm told to use the
> sp_dropserver dropping the logins in the process of course and then the
> sp_addserver with the local param.
> This has not resolved the issue...There are 3 servers right now in the
> sysservers table. S13 is the local server name id=0, DALSQL is the
> distributor with id=2 and repl_distributor with id=3.
> Any suggestions or thoughts would be greatly appreciated!
> Thanks in advance,
> Brian
|||Here's the output I receive after disabling publishing and then enabling it.
From there I tried to configure publishing along with the publications and
subscriber. I am so lost and frustrated that I think if I can't resolve this
today then tomorrow morning I'm going to start an incident report with
Microsoft through my MSDN subscription option.
Here are the errors...
SQL Server Enterprise Manager could not enable 'ORDSQL01.SPAREBACKUP.COM as
a subscriber.
Error 14071: 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.
SQL Server Enterprise Manager could not enable database 'Affiliates' for
merge replication.
Error 20028: The Distributor has not been installed correctly. Could not
enable database for publishing. The Replication option of 'merge publish' of
database 'Affiliates' has been set to false.
**this error occurs for all databases in SEM**
SQL Server Enterprise Manager successfully enabled
'DALSQL01.SPAREBACKUP.COM' as the Distributor for 'DALSQL01.SPAREBACKUP.COM'.
S13
S13
01089S13SQL ServerSQLOLEDBS13NULLNULL2005-11-08
08:03:09.880NULLNULLNULLNULL00S13
010000100010NULL
11609repl_distributorSQL ServerSQLOLEDBS13NULLNULL2005-11-09
04:59:47.530NULLNULLNULLNULL00S13
010010100110NULL
21089ORDSQL01SQL ServerSQLOLEDBORDSQL01NULLNULL2005-11-08
05:26:16.060NULLNULLNULLNULL00ORDSQL01
010000100010NULL
31089DALSQL01.SPAREBACKUP.COMSQL
ServerSQLOLEDBDALSQL01.SPAREBACKUP.COMNULLNULL2005-11-08
05:41:31.450NULLNULLNULLNULL00DALSQL01.SPAREBACKUP.COM
010000100010NULL
"brianswestra" wrote:
> Hello,
> I am currently in the process of setting up merge replication and am
> encountering some errors that I can not resolve. I hope that I am able to
> provide enough information, however please ask for more detail if necessary.
> While using the Replication wizard, my first error encountered was the 18456
> - the original error message was sa login failed...while messing with the
> remote login mapping the error changed to distributor_admin login failed. I
> resolved this by using the sp_changedistributor_password and this then
> allowed me to run through the wizard to set up the distributor. At this
> point, I did not set up the publisher or publications or subscribers.
> Ok, so now I can go into the confiuration screen and set up the publisher to
> use the non-trusted SQL Server authentication using distributor_admin (also
> tried sa). When I specify a merge publication and click ok (only trying one
> table at this point) I get the 20028 error saying that the distributor is not
> configured correctly.
> In reading through multiple forums and asking questions, I'm told to use the
> sp_dropserver dropping the logins in the process of course and then the
> sp_addserver with the local param.
> This has not resolved the issue...There are 3 servers right now in the
> sysservers table. S13 is the local server name id=0, DALSQL is the
> distributor with id=2 and repl_distributor with id=3.
> Any suggestions or thoughts would be greatly appreciated!
> Thanks in advance,
> Brian
I am currently in the process of setting up merge replication and am
encountering some errors that I can not resolve. I hope that I am able to
provide enough information, however please ask for more detail if necessary.
While using the Replication wizard, my first error encountered was the 18456
- the original error message was sa login failed...while messing with the
remote login mapping the error changed to distributor_admin login failed. I
resolved this by using the sp_changedistributor_password and this then
allowed me to run through the wizard to set up the distributor. At this
point, I did not set up the publisher or publications or subscribers.
Ok, so now I can go into the confiuration screen and set up the publisher to
use the non-trusted SQL Server authentication using distributor_admin (also
tried sa). When I specify a merge publication and click ok (only trying one
table at this point) I get the 20028 error saying that the distributor is not
configured correctly.
In reading through multiple forums and asking questions, I'm told to use the
sp_dropserver dropping the logins in the process of course and then the
sp_addserver with the local param.
This has not resolved the issue...There are 3 servers right now in the
sysservers table. S13 is the local server name id=0, DALSQL is the
distributor with id=2 and repl_distributor with id=3.
Any suggestions or thoughts would be greatly appreciated!
Thanks in advance,
Brian
here's the output of the @.@.servername and the server name property along with
the records in the sysservers table...
SELECT @.@.SERVERNAME
SELECT CONVERT(char(20), SERVERPROPERTY('servername'))
SELECT * FROM SYSSERVERS
S13
S13
0 1089 S13 SQL Server SQLOLEDB S13 NULL NULL 2005-11-08 08:03:09.880 NULL
NULL NULL NULL 0 0 S13 0 1 0 0 0 0 1 0 0 0 1 0 NULL
1 1609 repl_distributor SQL Server SQLOLEDB S13 NULL NULL 2005-11-08
07:04:25.793 NULL NULL NULL NULL 0 0 S13 0 1 0 0 1 0 1 0 0 1 1 0 NULL
2 1089 ORDSQL01 SQL Server SQLOLEDB ORDSQL01 NULL NULL 2005-11-08
05:26:16.060 NULL NULL NULL NULL 0 0 ORDSQL01 0 1 0 0 0 0 1 0 0 0 1 0 NULL
3 1089 DALSQL01.SPAREBACKUP.COM SQL Server SQLOLEDB DALSQL01.SPAREBACKUP.COM
NULL NULL 2005-11-08 05:41:31.450 NULL NULL NULL NULL 0 0
DALSQL01.SPAREBACKUP.COM 0 1 0 0 0 0 1 0 0 0 1 0 NULL
"brianswestra" wrote:
> Hello,
> I am currently in the process of setting up merge replication and am
> encountering some errors that I can not resolve. I hope that I am able to
> provide enough information, however please ask for more detail if necessary.
> While using the Replication wizard, my first error encountered was the 18456
> - the original error message was sa login failed...while messing with the
> remote login mapping the error changed to distributor_admin login failed. I
> resolved this by using the sp_changedistributor_password and this then
> allowed me to run through the wizard to set up the distributor. At this
> point, I did not set up the publisher or publications or subscribers.
> Ok, so now I can go into the confiuration screen and set up the publisher to
> use the non-trusted SQL Server authentication using distributor_admin (also
> tried sa). When I specify a merge publication and click ok (only trying one
> table at this point) I get the 20028 error saying that the distributor is not
> configured correctly.
> In reading through multiple forums and asking questions, I'm told to use the
> sp_dropserver dropping the logins in the process of course and then the
> sp_addserver with the local param.
> This has not resolved the issue...There are 3 servers right now in the
> sysservers table. S13 is the local server name id=0, DALSQL is the
> distributor with id=2 and repl_distributor with id=3.
> Any suggestions or thoughts would be greatly appreciated!
> Thanks in advance,
> Brian
|||Here's the output I receive after disabling publishing and then enabling it.
From there I tried to configure publishing along with the publications and
subscriber. I am so lost and frustrated that I think if I can't resolve this
today then tomorrow morning I'm going to start an incident report with
Microsoft through my MSDN subscription option.
Here are the errors...
SQL Server Enterprise Manager could not enable 'ORDSQL01.SPAREBACKUP.COM as
a subscriber.
Error 14071: 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.
SQL Server Enterprise Manager could not enable database 'Affiliates' for
merge replication.
Error 20028: The Distributor has not been installed correctly. Could not
enable database for publishing. The Replication option of 'merge publish' of
database 'Affiliates' has been set to false.
**this error occurs for all databases in SEM**
SQL Server Enterprise Manager successfully enabled
'DALSQL01.SPAREBACKUP.COM' as the Distributor for 'DALSQL01.SPAREBACKUP.COM'.
S13
S13
01089S13SQL ServerSQLOLEDBS13NULLNULL2005-11-08
08:03:09.880NULLNULLNULLNULL00S13
010000100010NULL
11609repl_distributorSQL ServerSQLOLEDBS13NULLNULL2005-11-09
04:59:47.530NULLNULLNULLNULL00S13
010010100110NULL
21089ORDSQL01SQL ServerSQLOLEDBORDSQL01NULLNULL2005-11-08
05:26:16.060NULLNULLNULLNULL00ORDSQL01
010000100010NULL
31089DALSQL01.SPAREBACKUP.COMSQL
ServerSQLOLEDBDALSQL01.SPAREBACKUP.COMNULLNULL2005-11-08
05:41:31.450NULLNULLNULLNULL00DALSQL01.SPAREBACKUP.COM
010000100010NULL
"brianswestra" wrote:
> Hello,
> I am currently in the process of setting up merge replication and am
> encountering some errors that I can not resolve. I hope that I am able to
> provide enough information, however please ask for more detail if necessary.
> While using the Replication wizard, my first error encountered was the 18456
> - the original error message was sa login failed...while messing with the
> remote login mapping the error changed to distributor_admin login failed. I
> resolved this by using the sp_changedistributor_password and this then
> allowed me to run through the wizard to set up the distributor. At this
> point, I did not set up the publisher or publications or subscribers.
> Ok, so now I can go into the confiuration screen and set up the publisher to
> use the non-trusted SQL Server authentication using distributor_admin (also
> tried sa). When I specify a merge publication and click ok (only trying one
> table at this point) I get the 20028 error saying that the distributor is not
> configured correctly.
> In reading through multiple forums and asking questions, I'm told to use the
> sp_dropserver dropping the logins in the process of course and then the
> sp_addserver with the local param.
> This has not resolved the issue...There are 3 servers right now in the
> sysservers table. S13 is the local server name id=0, DALSQL is the
> distributor with id=2 and repl_distributor with id=3.
> Any suggestions or thoughts would be greatly appreciated!
> Thanks in advance,
> Brian
Subscribe to:
Posts (Atom)