Showing posts with label setting. Show all posts
Showing posts with label setting. Show all posts

Wednesday, March 28, 2012

Merge replication, Identity not for replication, identity range

Hi all,
When setting up a (merge) publication using the wizard, you can click
the three-dotted button in the "specify articles" and then setup the
identity range for publisher and subscribers.
While this is an interesting option, I see that the default is not
checked (yes, I have the identity column setup as not for replication).
Now my database only has about 50 tables but nevertheless, not my
favorit waste of time to call up each table one by one and adjust these
values one by one (tabbing to the correct tab, checking the option,
adjusting the range-values).
So, is there any way to get this checked by default (that would be one
step forward) and preferably also adjust the values while we're at it?
Many thanks in advance,
Ferry
Ferry,
there's no way that I'm aware of. One posibility is to script out the
publication and use a find and replace in notepad to make the alteration
then drop the original and recreate the publication using this script -
admittedly not nice but would save a lot of leg-work.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||From Paul Ibison :
> Ferry,
> there's no way that I'm aware of. One posibility is to script out the
> publication and use a find and replace in notepad to make the alteration then
> drop the original and recreate the publication using this script - admittedly
> not nice but would save a lot of leg-work.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
Thanks Paul. I guess I'll have a look and see if I can do either that
or perhaps find some 'backdoor'...
Ferry
|||From Ferry :
> From Paul Ibison :
> Thanks Paul. I guess I'll have a look and see if I can do either that or
> perhaps find some 'backdoor'...
> Ferry
Having said that, I started a more detailed search on Google and came
up with this one. Going to check this later:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
/*
'************************************************* **
' Purpose :Add Identity range to the user defined Tables under a given
publisher
' Inputs :Publisher Name and Identity Range
' Returns :None
' Author :Mahesh M Kodli
'************************************************* ***
CREATE PROCEDURE AddMergeArticle
@.pPublisherName VARCHAR(255),
@.pIdentityRange BIGINT
As
DECLARE @.tRV INT
DECLARE @.tArticle VARCHAR(255)
SET @.tRV = 0
DECLARE Merge_Article_Cursor CURSOR FOR
--Get all the user defined Tables for which to add Identity Range
SELECT TABLE_NAME TableName FROM INFORMATION_SCHEMA.TABLES WHERE
rtrim(ltrim(table_type))='BASE TABLE'
AND TABLE_NAME Not like 'Conflict%' AND TABLE_NAME Not like
'dtproperties'
AND TABLE_NAME Not like 'sys%' AND TABLE_NAME Not like 'MS%'
OPEN Merge_Article_Cursor
FETCH NEXT FROM Merge_Article_Cursor INTO @.tArticle
WHILE @.@.FETCH_STATUS = 0
BEGIN
--Check if the Table has identity column and accordingly set the Auto
--Identity Range to TRUE or FALSE Before adding Identity Range to the
--article
IF OBJECTPROPERTY ( OBJECT_ID(@.tArticle), 'TableHasIdentity') = 1
BEGIN
IF NOT EXISTS (SELECT * FROM sysmergeextendedarticlesview WHERE name
= @.tArticle AND pubid IN (select pubid FROM sysmergepublications WHERE
name like @.pPublisherName AND UPPER(publisher)=UPPER(@.@.servername) and
publisher_db=db_name()))
BEGIN
--Use the System stored procedure add merge article to add Identity
range for -- each article
EXECUTE sp_addmergearticle @.publication = @.pPublisherName, @.article =
@.tArticle, @.source_owner = N'dbo', @.source_object = @.tArticle, @.type =
N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause =
null, @.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'true', @.pub_identity_range = @.pIdentityRange,
@.identity_range = @.pIdentityRange, @.threshold = 80,
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions =
0,@.force_invalidate_snapshot=1
END
END
ELSE
BEGIN
IF NOT EXISTS (SELECT * FROM sysmergeextendedarticlesview WHERE name
= @.tArticle AND pubid IN (select pubid FROM sysmergepublications WHERE
name like @.pPublisherName AND UPPER(publisher)=UPPER(@.@.servername) and
publisher_db=db_name()))
BEGIN
EXECUTE sp_addmergearticle @.publication = @.pPublisherName, @.article
= @.tArticle, @.source_owner = N'dbo', @.source_object = @.tArticle, @.type
= N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause =
null, @.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'False', @.pub_identity_range = NULL,
@.identity_range = NULL, @.threshold = NULL, @.verify_resolver_signature =
0, @.allow_interactive_resolver = N'false', @.fast_multicol_updateproc =
N'true', @.check_permissions = 0,@.force_invalidate_snapshot=1
END
END
FETCH NEXT FROM Merge_Article_Cursor INTO @.tArticle
END
CLOSE Merge_Article_Cursor
DEALLOCATE Merge_Article_Cursor
IF (@.@.ERROR <> 0)
BEGIN
SELECT @.tRV = -95 --UnSuccessful
GOTO XIT
END
XIT:
RETURN @.tRV
|||Ferry,
thanks for the heads up. I've found the link
http://www.devarticles.com/c/a/SQL-S...2000-Part-2/3/
and will add it onto my site. The only problem with the proc above is that
it assumes you want to replicate all tables, so there's room for another
(simpler) version which takes a tablename as a third parameter.
To have this occur without any intervention such as using Mahesh's script
you would have to edit the stored procedure sp_addmergearticle itself to
hardcode the automatic range management. This is a posibility but which
obviously invalidates support agreements - depends on how confident you are
of getting it spot on
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

merge replication, help!

Hi,

I'm setting up a merge replication between one publisher(sql server 2005 standard sp2) and a couple of subscribers(sql server 2005 express sp2). They are connected with each other through VPN tunnels(1.5M adsl connections). I'm using pull replication, every 20 minutes. The initial snapshot replication was finished properly for each subscriber, but after several hours, the subscribers keep getting such kind of error message "Another merge agent for the subscription or subscriptions is running, or the server is working on a previous request by the same agent. (Source: MSSQLServer, Error number: 21036)". it looks like the vpn tunnel is not good sometimes, and the merge agent just sits there waiting. then another request comes in, it cannot get the handler of that agent which is held by the previous request. So how can i configure the server to release the agent when a new request comes in? or setup the timeout for each request?

Any idea would be appreciated.

Thank you very much!
Maybe you can consider -QueryTimeout parameter for the merge agent?|||thanks for reply.
but would u be able to tell me how to do that?
|||oh, sorry, i found it. the current timeout is 300, just 5 minutes. but i set the merge replication every 20 minutes. then how come this happens?
|||QueryTimeout is how long the merge agent will wait on a given query before timing out. The 20 minutes you specified sounds like the scheduled intervals at which the subscription will synchronize.sql

merge replication, help!

Hi,

I'm setting up a merge replication between one publisher(sql server 2005 standard sp2) and a couple of subscribers(sql server 2005 express sp2). They are connected with each other through VPN tunnels(1.5M adsl connections). I'm using pull replication, every 20 minutes. The initial snapshot replication was finished properly for each subscriber, but after several hours, the subscribers keep getting such kind of error message "Another merge agent for the subscription or subscriptions is running, or the server is working on a previous request by the same agent. (Source: MSSQLServer, Error number: 21036)". it looks like the vpn tunnel is not good sometimes, and the merge agent just sits there waiting. then another request comes in, it cannot get the handler of that agent which is held by the previous request. So how can i configure the server to release the agent when a new request comes in? or setup the timeout for each request?

Any idea would be appreciated.

Thank you very much!
Maybe you can consider -QueryTimeout parameter for the merge agent?|||thanks for reply.
but would u be able to tell me how to do that?
|||oh, sorry, i found it. the current timeout is 300, just 5 minutes. but i set the merge replication every 20 minutes. then how come this happens?
|||QueryTimeout is how long the merge agent will wait on a given query before timing out. The 20 minutes you specified sounds like the scheduled intervals at which the subscription will synchronize.

Monday, March 26, 2012

Merge Replication walkthrough

I am very new to replication, so I am looking for a great walk-through for setting up Merge Replication. Does anyone know of a good article/example that provides this information? I have been through BOL and I'm having trouble putting the pieces together.

Thanks...

Scott

Hello Scott,

Here's a link which describes SQL Server Merge Replication step by step. Although it is for SQL Server 2000, it is gonna give you an idea about it.

Merge Replication Setup, step by step:

http://www.databasejournal.com/features/mssql/article.php/1438231

Merge Replication Overview (BOL)

http://msdn2.microsoft.com/en-us/library/ms152746.aspx

Ekrem ?nsoy

|||

Thanks Ekrem,

I have gone through those, and i think i'm close but I am getting the following error(s):

"DEV-PUBLISHER-MergeTest-Publisher-pub_mergetest-LATI12-1 failed. The initial snapshot for publication 'pub_mergetest' is not yet available. Start the Snapshot Agent to generate the snapshot for this publication. If this snapshot is currently being generated, wait for the process to complete and restart the synchronization."

So, I right mouse click on the Publisher and select "View Snapshop Agent Status". When that dialog comes up, it shows the agent as stopped. When I click the Start button, I get the following error:

"Executed as user: dev-publisher\repl_Snapshot. The replication agent encountered a failure. See the previous job step history message or Replication Monitor for more information. The step failed."

I looked at the job steps and Replication Monitor and it basically tells me the same thing (that my initial snapshot does't exist). Any idea what I am missing or did wrong?

Thanks...

|||

I got it to work. I didn't have permissions set up correctly. I had to add the correct user accounts and permissions in SSMS and then set up the correct access permissions to the snapshot location directory. Works like a champ now.

Merge replication throwing very weird error messages

I've been setting up subscriptions to a merge publication for the past 3 days. All of a sudden, I'm getting a pile of very strange errors. Replication is configured. I have 16 subscribers to an existing publication configured and synchronizing changes without any issues. The script that I'm using to create all of the subscriptions is as follows:

use [PIC]

exec sp_addmergesubscription @.publication = N'PIC', @.subscriber = N'machinename\SQLEXPRESS',

@.subscriber_db = N'MyDatabase', @.subscription_type = N'Push', @.sync_type = N'Automatic',

@.subscriber_type = N'Global', @.subscription_priority = 75, @.description = N'', @.use_interactive_resolver = N'False'

exec sp_addmergepushsubscription_agent @.publication = N'PIC', @.subscriber = N'machinename\SQLEXPRESS',

@.subscriber_db = N'MyDatabase', @.job_login = null, @.job_password = null, @.subscriber_security_mode = 1,

@.publisher_security_mode = 1, @.frequency_type = 64, @.frequency_interval = 0, @.frequency_relative_interval = 0,

@.frequency_recurrence_factor = 0, @.frequency_subday = 0, @.frequency_subday_interval = 0, @.active_start_time_of_day = 0,

@.active_end_time_of_day = 235959, @.active_start_date = 0, @.active_end_date = 0

GO

The last one that I added #17, gives the following errors after successfully creating the subscription.

Command attempted:

{call sys.sp_MSmergesubscribedb ('true', 0) }

Error messages:

The merge process could not initialize the subscription. Ensure that the subscription registration exists at the publisher, and reregister the subscription if necessary. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201011)
Get help: http://help/MSSQL_REPL-2147201011

RegCreateKeyEx() returned error 5, 'Access is denied.' (Source: MSSQLServer, Error number: 22002)
Get help: http://help/22002

Could not add article resolver 'Microsoft SQL Server Additive Conflict Resolver' information to the registry (Source: MSSQLServer, Error number: 21713)
Get help: http://help/21713

Could not register article resolver: 'Microsoft SQL Server Additive Conflict Resolver'. (Source: MSSQLServer, Error number: 21715)
Get help: http://help/21715

The system tables for merge replication could not be created successfully. (Source: MSSQLServer, Error number: 20008)
Get help: http://help/20008

I've tried to manually create it using the GUI and get an even stranger error message as follows:

TITLE: New Subscription Wizard

Microsoft SQL Server Management Studio is unable to access replication components because replication is not installed on this instance of SQL Server. For information about installing replication, see the topic Installing Replication in SQL Server Books Online.

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=Microsoft.SqlServer.Management.UI.ReplUtilitiesErrorSR&EvtID=ReplicationNotInstalled&LinkId=20476


ADDITIONAL INFORMATION:

Replication components are not installed on this server. Run SQL Server Setup again and select the option to install replication. (Microsoft SQL Server, Error: 21028)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=21028&LinkId=20476


BUTTONS:

OK

I very obviously have replication installed by virtue of the fact that I have a publication and 16 subscriptions that are currently synchronizing. Any ideas?

Yes, I can connect to the subscriber from the server. That's how I created the subscription database in the first place, by connecting a query window to the subscriber and issuing a create database statement.|||

Is it the same account you are using to run this command as the other 16 subscriptions?

Did the sql server service account change between the success and this failure attempt?

Did you add sp_addmergesubscription_agent to those successful subscriptions too?

|||Same account was used to run these two commands for all of the other 16 subscriptions. No, the service account did not change. Yes, we successfully added sp_addmergesubscription_agent to the other 16.

Merge replication throwing very weird error messages

I've been setting up subscriptions to a merge publication for the past 3 days. All of a sudden, I'm getting a pile of very strange errors. Replication is configured. I have 16 subscribers to an existing publication configured and synchronizing changes without any issues. The script that I'm using to create all of the subscriptions is as follows:

use [PIC]

exec sp_addmergesubscription @.publication = N'PIC', @.subscriber = N'machinename\SQLEXPRESS',

@.subscriber_db = N'MyDatabase', @.subscription_type = N'Push', @.sync_type = N'Automatic',

@.subscriber_type = N'Global', @.subscription_priority = 75, @.description = N'', @.use_interactive_resolver = N'False'

exec sp_addmergepushsubscription_agent @.publication = N'PIC', @.subscriber = N'machinename\SQLEXPRESS',

@.subscriber_db = N'MyDatabase', @.job_login = null, @.job_password = null, @.subscriber_security_mode = 1,

@.publisher_security_mode = 1, @.frequency_type = 64, @.frequency_interval = 0, @.frequency_relative_interval = 0,

@.frequency_recurrence_factor = 0, @.frequency_subday = 0, @.frequency_subday_interval = 0, @.active_start_time_of_day = 0,

@.active_end_time_of_day = 235959, @.active_start_date = 0, @.active_end_date = 0

GO

The last one that I added #17, gives the following errors after successfully creating the subscription.

Command attempted:

{call sys.sp_MSmergesubscribedb ('true', 0) }

Error messages:

The merge process could not initialize the subscription. Ensure that the subscription registration exists at the publisher, and reregister the subscription if necessary. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201011)
Get help: http://help/MSSQL_REPL-2147201011

RegCreateKeyEx() returned error 5, 'Access is denied.' (Source: MSSQLServer, Error number: 22002)
Get help: http://help/22002

Could not add article resolver 'Microsoft SQL Server Additive Conflict Resolver' information to the registry (Source: MSSQLServer, Error number: 21713)
Get help: http://help/21713

Could not register article resolver: 'Microsoft SQL Server Additive Conflict Resolver'. (Source: MSSQLServer, Error number: 21715)
Get help: http://help/21715

The system tables for merge replication could not be created successfully. (Source: MSSQLServer, Error number: 20008)
Get help: http://help/20008

I've tried to manually create it using the GUI and get an even stranger error message as follows:

TITLE: New Subscription Wizard

Microsoft SQL Server Management Studio is unable to access replication components because replication is not installed on this instance of SQL Server. For information about installing replication, see the topic Installing Replication in SQL Server Books Online.

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=Microsoft.SqlServer.Management.UI.ReplUtilitiesErrorSR&EvtID=ReplicationNotInstalled&LinkId=20476


ADDITIONAL INFORMATION:

Replication components are not installed on this server. Run SQL Server Setup again and select the option to install replication. (Microsoft SQL Server, Error: 21028)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=21028&LinkId=20476


BUTTONS:

OK

I very obviously have replication installed by virtue of the fact that I have a publication and 16 subscriptions that are currently synchronizing. Any ideas?

Yes, I can connect to the subscriber from the server. That's how I created the subscription database in the first place, by connecting a query window to the subscriber and issuing a create database statement.|||

Is it the same account you are using to run this command as the other 16 subscriptions?

Did the sql server service account change between the success and this failure attempt?

Did you add sp_addmergesubscription_agent to those successful subscriptions too?

|||Same account was used to run these two commands for all of the other 16 subscriptions. No, the service account did not change. Yes, we successfully added sp_addmergesubscription_agent to the other 16.

Monday, March 19, 2012

Merge Replication on SQL Server 2000 -- too slow?

I'm setting up a Merge replication over a very high bandwidth line, and I'm
running into many performance problems.
1. I'm publishing the data one-way from the Publisher to one Subscriber at
this time. Once the data are synchronized, it's taking forever to push delta
data since the snapshot. I changed to high volume Merge profile, and it's
still way behind. Millions of transactions are waiting at the Publisher.
2. After the initial data synchronization, MSMerge_contents at the
Subscriber contains millions of rows. Why is that? There's no activity at
the Subscriber. Oddly enough, if I were to turn on two ways merge, I'd get
UPDATE data pushing back to the Publisher from the Subscriber. I don't know
why what needs to be updated? There's no application or query running at the
Subscriber. This scares me.
3. Because there's millions of entries in MSMerge_contents table, add/drop
articles from replication causes major problem. What's the best way to
handle this data? I'm replicating 200+ tables and some tables have 10+
millions rows.
Thanks,
Hung
Hi. if you have to do ONE way replication, go for transactional replication
instead; it's way faster than merge replication.
Since it's merge replication, the subscriber db's msmerge_contents table
would grow as every single dml would be recorded into it and would remain
depending upon the retention period u have specified.
Also schedule to defrag the msmerge_contents, msmerge_gen_history,
msmerge_tombstone tables as they are likely to get large.
"Hung" wrote:

> I'm setting up a Merge replication over a very high bandwidth line, and I'm
> running into many performance problems.
> 1. I'm publishing the data one-way from the Publisher to one Subscriber at
> this time. Once the data are synchronized, it's taking forever to push delta
> data since the snapshot. I changed to high volume Merge profile, and it's
> still way behind. Millions of transactions are waiting at the Publisher.
> 2. After the initial data synchronization, MSMerge_contents at the
> Subscriber contains millions of rows. Why is that? There's no activity at
> the Subscriber. Oddly enough, if I were to turn on two ways merge, I'd get
> UPDATE data pushing back to the Publisher from the Subscriber. I don't know
> why what needs to be updated? There's no application or query running at the
> Subscriber. This scares me.
> 3. Because there's millions of entries in MSMerge_contents table, add/drop
> articles from replication causes major problem. What's the best way to
> handle this data? I'm replicating 200+ tables and some tables have 10+
> millions rows.
> Thanks,
> Hung
>
>
|||well, my goal is to get Merge Repl to work. I'm doing a testbed right now by
pushing it one-way from Production server only. Are you saying that
MSMerge_Contents table at the Subscriber contains all rows from the intial
snapshot as well? If so, can I clear it after the intial snapshot synch
because data are pushing one-way right now from the Publisher? I don't want
or expect to see data merging back from the Subscriber at this point. The
one time I saw data propagating back from the Subscriber, I was scared at
the least and didn't understand why that would be possible.
After the inital data synching from the snapshot, ongoing data synching just
can't seem to keep up. We have a big pipe open between the two servers.
Another scare I had was that I got duplicated data at the Publisher itself.
I have an on Insert trigger on TableA to _move_ data from TableB to TableC.
For that one day, for every row from TableB, there were two identical rows
in TableC. How could this be possible? If the trigger fired on TableA fired
twice for some reason, data from TableB should already be cleared from the
first trigger fire. Merge Replication trigger doesn't move data from TableB
to TableC. I couldn't explain that behavior, and I'm scare to turn
replication back on now. Any idea?
Thanks,
Hung
"T" <T@.discussions.microsoft.com> wrote in message
news:18A1F015-179D-405D-B48A-A95F56C777B7@.microsoft.com...[vbcol=seagreen]
> Hi. if you have to do ONE way replication, go for transactional
> replication
> instead; it's way faster than merge replication.
> Since it's merge replication, the subscriber db's msmerge_contents table
> would grow as every single dml would be recorded into it and would remain
> depending upon the retention period u have specified.
> Also schedule to defrag the msmerge_contents, msmerge_gen_history,
> msmerge_tombstone tables as they are likely to get large.
> "Hung" wrote:
|||Hi.
The subscriber's msmerge_contents should not contain data from the snapshot
file, it contains transactions after the snapshot.
data being pushed back from subscriber is likely the case with merge
replication and u can't stop this beahvious.
for second prob., you would be getting duplicate records in TableC if it
were also published and trigger also exist at subscriber for TableA.
When record gets inserted in publisher tableC through TableA delete, same
event will fire at subscriber's TableA and will cause the trigger at
Subscriber also insert into TableC.
now when u replicate changes, publisher TableC record merges with
Subscriber's TableC record and you get two records at both sides.
Disable that trigger at subscriber, you will get TableC updated at
subscriber if it's included in replication.
"Hung" wrote:

> well, my goal is to get Merge Repl to work. I'm doing a testbed right now by
> pushing it one-way from Production server only. Are you saying that
> MSMerge_Contents table at the Subscriber contains all rows from the intial
> snapshot as well? If so, can I clear it after the intial snapshot synch
> because data are pushing one-way right now from the Publisher? I don't want
> or expect to see data merging back from the Subscriber at this point. The
> one time I saw data propagating back from the Subscriber, I was scared at
> the least and didn't understand why that would be possible.
> After the inital data synching from the snapshot, ongoing data synching just
> can't seem to keep up. We have a big pipe open between the two servers.
> Another scare I had was that I got duplicated data at the Publisher itself.
> I have an on Insert trigger on TableA to _move_ data from TableB to TableC.
> For that one day, for every row from TableB, there were two identical rows
> in TableC. How could this be possible? If the trigger fired on TableA fired
> twice for some reason, data from TableB should already be cleared from the
> first trigger fire. Merge Replication trigger doesn't move data from TableB
> to TableC. I couldn't explain that behavior, and I'm scare to turn
> replication back on now. Any idea?
> Thanks,
> Hung
> "T" <T@.discussions.microsoft.com> wrote in message
> news:18A1F015-179D-405D-B48A-A95F56C777B7@.microsoft.com...
>
>
|||"T" <T@.discussions.microsoft.com> wrote in message
news:0AAC406D-BD4B-4F8C-A034-3C454A22AFA5@.microsoft.com...
> Hi.
> The subscriber's msmerge_contents should not contain data from the
> snapshot
> file, it contains transactions after the snapshot.
> data being pushed back from subscriber is likely the case with merge
> replication and u can't stop this beahvious.
>
I'd expect the same thing that the subscriber's msmerge_contents table
should be empty since there's no activity at the Subscriber. But I do get
millions of rows in the Subscriber's msmerge_contents table after the first
initialization. I should have queried back to the source tables to figure
out where these rows in msmerge_contents belong.
I understand about data pushing back from the Subscriber is part of
Merge Replication. In my case, the Subscriber isn't taking any live traffic
from the web or query, so I don't expect the Subscriber to have any data
change to push back to the Publisher. Because after the initialization, the
Subscriber's msmerge_contents contains millions, those entries probably get
pushed back? Again, I don't understand why subscriber's msmerge_contents
would have data. I've tried to clear and reinitialize many times. The one
time where I allowed the Subscriber to push data back, it had millions
UPDATE to upload and with 100 entries batch, that seemed to be eternity.

> for second prob., you would be getting duplicate records in TableC if it
> were also published and trigger also exist at subscriber for TableA.
> When record gets inserted in publisher tableC through TableA delete, same
> event will fire at subscriber's TableA and will cause the trigger at
> Subscriber also insert into TableC.
> now when u replicate changes, publisher TableC record merges with
> Subscriber's TableC record and you get two records at both sides.
> Disable that trigger at subscriber, you will get TableC updated at
> subscriber if it's included in replication.
This is a logical explanation. I don't remember if I allowed Subscriber
to push data back during this time or not. I probably did. Otherwise, it
shouldn't happen. Disabling trigger at the Subscriber would create problem
when both Publisher and Subscriber are Live at the same time. For example,
there's web orders inserting into the Subscriber when it's in production,
then I do want to subscriber's trigger on TableA to move data from TableB to
TableC and upload all data to the Publisher. So, if I disable Subscriber's
trigger, this would create a problem. I thought Merge Replication are
triggers-aware and wouldn't fire twice? It knows that data are pushing from
the Publisher to the Subscriber, therefore, Subscriber's trigger won't fire?
or I misunderstand it. How do I avoid this without disabling Subscriber's
triggers because both servers might be in Production at the same time.
Thanks.
[vbcol=seagreen]
> "Hung" wrote:

Merge Replication of large database

Hi,
I am setting up a merge replication of a large database across internet
between two servers which are located in two geographically different
location and can connect to each other with a fast T1 Connection.
The purpose of it is to have a hot backup site available for the DB.
The problem i am facing is that the DB size before setting up replication is
2GB.
When I set up merge replication and selected snapshot to create , it grow
the DB size to 6GB. Most of the increase in Trasaction log.
Why?
I will apply the backup of these Snapshot generated DB to the subscriber
manually first and then set up the pull subscription on the subscriber.
Is this the right way to handle this situation?
How can I reduce the size of db after activating the replication?
I tried it with shrinkdatabase command but it does not shing the log file
much. What transactions are open that it does not shrink?
Please advice any better solution.
Sam
Backup the transaction log and then issue a shrink. This should correct the
problem if you are using the full recover model.
Also issue a dbcc opentran to see if there are any open transactions. Use
sp_who2 to evaluate whether the spid is orphaned and if you can kill it.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"sam" <sam@.discussions.microsoft.com> wrote in message
news:8D35DB00-6FF6-4B75-AE4B-3A6E4EF8322B@.microsoft.com...
> Hi,
> I am setting up a merge replication of a large database across internet
> between two servers which are located in two geographically different
> location and can connect to each other with a fast T1 Connection.
> The purpose of it is to have a hot backup site available for the DB.
> The problem i am facing is that the DB size before setting up replication
is
> 2GB.
> When I set up merge replication and selected snapshot to create , it grow
> the DB size to 6GB. Most of the increase in Trasaction log.
> Why?
> I will apply the backup of these Snapshot generated DB to the subscriber
> manually first and then set up the pull subscription on the subscriber.
> Is this the right way to handle this situation?
> How can I reduce the size of db after activating the replication?
> I tried it with shrinkdatabase command but it does not shing the log file
> much. What transactions are open that it does not shrink?
> Please advice any better solution.
> Sam
>

Friday, March 9, 2012

Merge Replication Filter does not work at Subscriber

I am setting up a SQL Server Database Filter based Merge Replication between
Publisher (on Server Global) & Subscriber (on Server Site) using
EXCHANGE_TYPE '1' (Data only needs to be merged from Subscriber(Site) to
Publisher(Global) - Upload). You can consider this as a Central Subscriber
model with multiple Publications based on Filter "Siteid" push Data to
Central Subscriber Global. I have created all the Publications in the Central
Publisher Database Global (Normally central subscriber model will have
Publications on each site but I did wanted to do that due to Maintenance &
security issues )
Also I have set up conflict resolver "SQL Server Subscriber always wins the
conflict" since I want my Subscriber changes to override changes done at
Publisher.
However, I am facing this issue:
Even if I add a row at subscriber Site that is not part of Filter (it goes
into the Publisher Global). I do not want the rows other than filter clause
to replicate to Central Hub.
Any assistance is highly appreciated!
Database : SQL Server 2000 SP3a
OS: Win2003 (No Service Pack)
Vikas,
you could use an instead-of trigger for this, and divert these rows to
another table.
Alternatively you could use partitioned tables (like federated database
servers but all on one database).
Another alternative is to edit the merge triggers to not record these rows
in the metadata tables.
Rgds,
Paul Ibison
"Vikas Kohli" <VikasKohli@.discussions.microsoft.com> wrote in message
news:ACFC59F9-7CE5-4869-83D3-7CB836E6E273@.microsoft.com...
>I am setting up a SQL Server Database Filter based Merge Replication
>between
> Publisher (on Server Global) & Subscriber (on Server Site) using
> EXCHANGE_TYPE '1' (Data only needs to be merged from Subscriber(Site) to
> Publisher(Global) - Upload). You can consider this as a Central Subscriber
> model with multiple Publications based on Filter "Siteid" push Data to
> Central Subscriber Global. I have created all the Publications in the
> Central
> Publisher Database Global (Normally central subscriber model will have
> Publications on each site but I did wanted to do that due to Maintenance &
> security issues )
> Also I have set up conflict resolver "SQL Server Subscriber always wins
> the
> conflict" since I want my Subscriber changes to override changes done at
> Publisher.
> However, I am facing this issue:
> Even if I add a row at subscriber Site that is not part of Filter (it goes
> into the Publisher Global). I do not want the rows other than filter
> clause
> to replicate to Central Hub.
> Any assistance is highly appreciated!
> Database : SQL Server 2000 SP3a
> OS: Win2003 (No Service Pack)
|||Thanks Paul,
I think the 1st and 2nd options is not feasible at this moment as it
requires a lot of schema changes that will effect almost all the stored procs
in the Application.
I can only try the third option:
I would like to know which merge trigger I have to modify. Is it at the
Publisher or at the Subscriber? I am pasting below the code of Insert
trigger for Merge Replication on an Article "Accrual" for both Subscriber &
Publisher. (for eg. Filter is Siteid=1 for site 1. I do not want rows other
than Siteid 1 to be pushed from Subscriber)
Subscriber Code:
create trigger ins_FD4915FBB5824998BA19B5709C120666 on [dbo].[Accrual] for
insert as
if sessionproperty('replication_agent') = 1 and (select
trigger_nestlevel()) = 1
return
/* Declare variables */
declare @.article_rows_inserted int
select @.article_rows_inserted = count(*) from inserted
declare @.tablenick int, @.nickname int
declare @.lineage varbinary(255), @.colv1 varbinary(2048)
declare @.ccols int, @.retcode smallint, @.version int, @.curversion int,
@.oldmaxversion int
set nocount on
set @.tablenick = 6753038
select @.ccols = 20
set @.lineage = 0x0
set @.retcode = 0
select @.oldmaxversion= maxversion_at_cleanup from dbo.sysmergearticles
where nickname = @.tablenick
execute dbo.sp_MSgetreplnick @.nickname = @.nickname output
if (@.@.error <> 0)
begin
goto FAILURE
end
set @.lineage = { fn UPDATELINEAGE (0x0, @.nickname, 1) }
set @.colv1 = { fn INITCOLVS(@.ccols, @.nickname) }
if (@.@.error <> 0)
begin
goto FAILURE
end
if exists (select ts.rowguid from tsvw_FD4915FBB5824998BA19B5709C120666
ts, inserted i where ts.tablenick = @.tablenick and ts.rowguid = i.rowguidcol)
begin
select @.version = max({fn GETMAXVERSION(lineage)}) from
tsvw_FD4915FBB5824998BA19B5709C120666 where
tablenick = @.tablenick and rowguid in (select rowguidcol from inserted)
if @.version is not null
begin
-- reset lineage and colv to higher version...
set @.curversion = 0
while (@.curversion <= @.version)
begin
set @.lineage = { fn UPDATELINEAGE (@.lineage, @.nickname,
@.oldmaxversion+1) }
set @.curversion = @.curversion + 1
end
if (@.colv1 IS NOT NULL)
set @.colv1 = { fn UPDATECOLVBM(@.colv1, @.nickname, 0x01, 0x00, { fn
GETMAXVERSION(@.lineage) }) }
delete from tsvw_FD4915FBB5824998BA19B5709C120666 where tablenick =
@.tablenick and rowguid in
(select rowguidcol from inserted)
end
end
if (@.article_rows_inserted = 1)
begin
if not exists (select ct.rowguid from
ctsv_FD4915FBB5824998BA19B5709C120666 ct, inserted i where ct.tablenick =
@.tablenick and ct.rowguid = i.rowguidcol)
begin
insert into ctsv_FD4915FBB5824998BA19B5709C120666 (tablenick, rowguid,
lineage, colv1, generation, joinchangegen) select
@.tablenick, rowguidcol, @.lineage, @.colv1, A.gen_cur, A.gen_cur from
inserted,
(select top 1 nickname, gen_cur = isnull(gen_cur, 0) from
dbo.sysmergearticles where nickname = @.tablenick) as A
end
end
else
begin
insert into ctsv_FD4915FBB5824998BA19B5709C120666 (tablenick, rowguid,
lineage, colv1, generation, joinchangegen) select
@.tablenick, rowguidcol, @.lineage, @.colv1, A.gen_cur, A.gen_cur from
inserted,
(select top 1 nickname, gen_cur = isnull(gen_cur, 0) from
dbo.sysmergearticles where nickname = @.tablenick) as A
where rowguidcol not in (select rowguid from
ctsv_FD4915FBB5824998BA19B5709C120666 where tablenick = @.tablenick)
end
if @.@.error <> 0
goto FAILURE
return
FAILURE:
if @.@.trancount > 0
rollback tran
raiserror (20041, 16, -1)
return
Publisher Code
create trigger ins_FD4915FBB5824998BA19B5709C120666 on [dbo].[Accrual] for
insert as
if sessionproperty('replication_agent') = 1 and (select
trigger_nestlevel()) = 1
return
/* Declare variables */
declare @.article_rows_inserted int
select @.article_rows_inserted = count(*) from inserted
declare @.tablenick int, @.nickname int
declare @.lineage varbinary(255), @.colv1 varbinary(2048)
declare @.ccols int, @.retcode smallint, @.version int, @.curversion int,
@.oldmaxversion int
set nocount on
set @.tablenick = 6753038
select @.ccols = 20
set @.lineage = 0x0
set @.retcode = 0
select @.oldmaxversion= maxversion_at_cleanup from dbo.sysmergearticles
where nickname = @.tablenick
execute dbo.sp_MSgetreplnick @.nickname = @.nickname output
if (@.@.error <> 0)
begin
goto FAILURE
end
set @.lineage = { fn UPDATELINEAGE (0x0, @.nickname, 1) }
set @.colv1 = { fn INITCOLVS(@.ccols, @.nickname) }
if (@.@.error <> 0)
begin
goto FAILURE
end
if exists (select ts.rowguid from tsvw_FD4915FBB5824998BA19B5709C120666
ts, inserted i where ts.tablenick = @.tablenick and ts.rowguid = i.rowguidcol)
begin
select @.version = max({fn GETMAXVERSION(lineage)}) from
tsvw_FD4915FBB5824998BA19B5709C120666 where
tablenick = @.tablenick and rowguid in (select rowguidcol from inserted)
if @.version is not null
begin
-- reset lineage and colv to higher version...
set @.curversion = 0
while (@.curversion <= @.version)
begin
set @.lineage = { fn UPDATELINEAGE (@.lineage, @.nickname,
@.oldmaxversion+1) }
set @.curversion = @.curversion + 1
end
if (@.colv1 IS NOT NULL)
set @.colv1 = { fn UPDATECOLVBM(@.colv1, @.nickname, 0x01, 0x00, { fn
GETMAXVERSION(@.lineage) }) }
delete from tsvw_FD4915FBB5824998BA19B5709C120666 where tablenick =
@.tablenick and rowguid in
(select rowguidcol from inserted)
end
end
if (@.article_rows_inserted = 1)
begin
if not exists (select ct.rowguid from
ctsv_FD4915FBB5824998BA19B5709C120666 ct, inserted i where ct.tablenick =
@.tablenick and ct.rowguid = i.rowguidcol)
begin
insert into ctsv_FD4915FBB5824998BA19B5709C120666 (tablenick, rowguid,
lineage, colv1, generation, joinchangegen) select
@.tablenick, rowguidcol, @.lineage, @.colv1, A.gen_cur, A.gen_cur from
inserted,
(select top 1 nickname, gen_cur = isnull(gen_cur, 0) from
dbo.sysmergearticles where nickname = @.tablenick) as A
end
end
else
begin
insert into ctsv_FD4915FBB5824998BA19B5709C120666 (tablenick, rowguid,
lineage, colv1, generation, joinchangegen) select
@.tablenick, rowguidcol, @.lineage, @.colv1, A.gen_cur, A.gen_cur from
inserted,
(select top 1 nickname, gen_cur = isnull(gen_cur, 0) from
dbo.sysmergearticles where nickname = @.tablenick) as A
where rowguidcol not in (select rowguid from
ctsv_FD4915FBB5824998BA19B5709C120666 where tablenick = @.tablenick)
end
if @.@.error <> 0
goto FAILURE
return
FAILURE:
if @.@.trancount > 0
rollback tran
raiserror (20041, 16, -1)
return
Also kindly let me know any problem that you can foresee if I use Central
Subscriber (Globall) using Merge Replication with Ppublisher as all the sites
with Filter Siteid. I am thinking of that option also although it is very
difficult to maintain.
With Regards,
Vikas Kohli
"Paul Ibison" wrote:

> Vikas,
> you could use an instead-of trigger for this, and divert these rows to
> another table.
> Alternatively you could use partitioned tables (like federated database
> servers but all on one database).
> Another alternative is to edit the merge triggers to not record these rows
> in the metadata tables.
> Rgds,
> Paul Ibison
> "Vikas Kohli" <VikasKohli@.discussions.microsoft.com> wrote in message
> news:ACFC59F9-7CE5-4869-83D3-7CB836E6E273@.microsoft.com...
>
>
|||You'll need to edit the subscriber trigger. Don't try to understand all the
code in it - just check at the start if the 'Deleted' table refers to a row
you don't want replicated ie wrap the whole code:
if not exists (select * from deleted where ...)
begin
trigger code
end
This works for single row changes. For multiple row changes, some of which
may violate your filtering, you could try removing the rows from the deleted
table - haven't done this before but might work. If not, you'll have to use
a cursor to iterate through the deleted rows and apply the supplied trigger
code only when the row is ok to be replicated. Remember that this is Very
proprietry solution, and on reinitialization, all this code will disappear.
Rgds,
Paul Ibison
|||Hi Paul,
I have actually used the following code in all the insert & update triggers
for the article in the beginning of trigger:
if exists (select siteid from inserted where siteid=1)
Begin
--Trigger original code--
end
else
Return
For delete trigger, I have used following:
if exists (select siteid from deleted where siteid=1)
Begin
--Trigger original code--
end
else
return
Looks like this code works for even multiple inserts and multiple deletes
Appreciate if you can advise me on this now:
1. Kindly let me know if there could be any issues with the above code.
2. One issue which I can see now is following. Please let me know how to
resolve it.
Although the replication is working fine now but When I run exec
spBrowseMergeChanges 'articlename', I get all the rows listed that were
updated,deleted or inserted at the subscriber. Currently I have to do a
dummyupdate for each rowid which is not possible everytime.
3. Also kindly let me know if I coonfigure a central subscriber in Merge
Replication where the subscriber pulls the data based on Siteid filter, do
you see any issues
With regards,
Vikas Kohli
"Paul Ibison" wrote:

> You'll need to edit the subscriber trigger. Don't try to understand all the
> code in it - just check at the start if the 'Deleted' table refers to a row
> you don't want replicated ie wrap the whole code:
> if not exists (select * from deleted where ...)
> begin
> trigger code
> end
> This works for single row changes. For multiple row changes, some of which
> may violate your filtering, you could try removing the rows from the deleted
> table - haven't done this before but might work. If not, you'll have to use
> a cursor to iterate through the deleted rows and apply the supplied trigger
> code only when the row is ok to be replicated. Remember that this is Very
> proprietry solution, and on reinitialization, all this code will disappear.
> Rgds,
> Paul Ibison
>
>
|||Vikas,
the problem with this approach is that rows where the siteid <> 1 will not
end up logged and replicated. You can make sure this doesn't happen by using
a cursor or by removing the rows from the deleted table (to be tested) and
this'll avoid the need for dummy updates. Am not too sure about (3) - can
you expand a little.
Rgds,
Paul Ibison
|||Hi Paul,
Thanks for reply & Apologies for late reply as the site was lnot loading on
my Browser yesterday.
I will expalain the 3rd option:
Table A & B needs to send data from each site to the Central Hub Server. The
Data that site needs to send is based on filter Siteid.
In my current design, I have a central Publisher that pulls data from Site
using Merge Replication from each site with Filter SiteID. I have used
exchanngetype parameter 1 and Dynamic filter. This approach has only one
problem which we have discussed and could be possibly resiolved by modifying
all the replication Triggers. This option is very good from maintenance point
of view as I have look into only one server and one publication.
The second approach can be Central subscriber as Global Hub. All the sites
can act as Publishers pushing Data through merge replication to the central
Subscriber based on filter condition siteid using exchangetype 2. Appreciate
if you can let me know about this approach. The one problem for me that I can
see is that I have to maintain a lot of publications globally.
With regards,
Vikas Kohli
"Paul Ibison" wrote:

> Vikas,
> the problem with this approach is that rows where the siteid <> 1 will not
> end up logged and replicated. You can make sure this doesn't happen by using
> a cursor or by removing the rows from the deleted table (to be tested) and
> this'll avoid the need for dummy updates. Am not too sure about (3) - can
> you expand a little.
> Rgds,
> Paul Ibison
>
>

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

Merge replication error -2147201019

I'm setting up a merge replication. Sql server 2000 Desktop engine is installed at subscriber site. Sql server 2000 enterprise is installed at the publisher site.

I setup the publisher fine. No errors.

I setup a subscriber to the publisher, and get this error:

"the subscription to publication 'xxxx' is invalid"

The error details are:

Last command: {call sp_MSgetreplicainfo(?,?,?,?,?,?)}
Category: Agent
Source: Merge Replication Provider
Number: -2147201019

This error shows up only after all tables have been copied to the subscriber. The last valid function before the error is:

Applied script 'CustBank_5.trg'

The above has nothing to do with the error. The scripts all apply, for every table selected. I've tested with publication of all tables, down to just a single table. The error always shows up after the last script is applied.

I've set this same thing up on computers in my office, and it works fine. Just can't get it working for the customer.

Any ideas?

Thanks!I'm also getting the following message listed as the "Full" error text:

"The remote server is not defined as a subscription server"

Doing my Google searches now:)|||I found the solution. Thanks GOOGLE and Brian!

http://www.cryer.co.uk/brian/sqlserver/sqlsvrtroubleshooting.htm

The above troubleshooting site, eventually pointed me to the following link, that resolved the problem.

http://www.cryer.co.uk/brian/sqlserver/ssem_cncd.htm

Gracias.

Saturday, February 25, 2012

merge replication and simple recovery model

Hi All,
Is it possible or okay for setting the publishing DB in a merge
replication setup to Simple recovery model instead of the current
Bulk-logged model?
Will this have an impact to the subscribers?
Thanks.
Aramid
Merge doesn't use the transaction log in the same way as transactional, but
even in this case it is a common misconception that FULL recovery mode is
necessary, so to answer your question 'Yes' - it has no effect as far as the
correct workings of replication are concerned.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Monday, February 20, 2012

Merge replication and long disconnections

We have a system that uses SQL2000 (SP2) with the main database in our main
location. We have been working on setting up replication to a secondary
location, and believe we have solved the relevant issues there. We have
just been asked (read told) to set up replication to another server that
will, by it's nature, be disconnected for extended periods of time (at least
weeks) with no possibility of getting an internet connection during that
time. Can we setup merge replication in this situation, what are the
"gotchas" that we need to design around? We must use merge replication
since some of our fields are text fields.
We are initially looking at setting up the client to be disconnected as a
pull subscription, while the secondary client is a push subscription from
the publisher at the main location. Does this make sense?
All input appreciated.
TIA
Ron L.
Ron,
the most striking thing to get right is @.retention. By default it'll be 14
days which isn't long enough in your case.
Push or Pull is your choice depending on who you want to be in control. If
you know when the remote client will be connected on a regular basis, then
push is still an option, but in your scenario I agree that pull seems more
reasonable.
Regards,
Paul Ibison
|||Paul
Thanks for the pointer. I'll take a look for @.retention.
Ron L.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:ecYZkfaFEHA.712@.tk2msftngp13.phx.gbl...
> Ron,
> the most striking thing to get right is @.retention. By default it'll be 14
> days which isn't long enough in your case.
> Push or Pull is your choice depending on who you want to be in control. If
> you know when the remote client will be connected on a regular basis, then
> push is still an option, but in your scenario I agree that pull seems more
> reasonable.
> Regards,
> Paul Ibison
>