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

Tuesday, March 20, 2012

Reinitializing subscriptions not working

Hi,

I'm doing merge sync between SQL Compact on mobile devices and SQL Server 2005. I recently made a schema change on the server and noticed that it caused an error on the subscribers when syncing. I fixed the schema problem, and did a reinitialize all subscriptions with a new snapshot. On the mobile devices I forced a reinitialisation (upload changes first). I'm still getting the same error message, which relates to a schema change which is no longer relevant to the server db and snapshot. For some reason the subscriber dbs are trying to reapply the original problem schema change even though they're supposed to be reinitializing to a new snapshot. I've even tried dropping the affected tables from the publication, and reinitializing all subscriptions with a new snapshot, but still the same error on the subscribers. Does anyone know why the subscriber dbs are still trying to apply a now defunct schema change (on tables which no longer exist in the publication)? Is there any way to flush this from the subscribers so they correctly pick up the new snapshot?

Regards,

Greg McNamara

Some additional information on the above:

The "rogue" schema change appears to be coming from the publisher, and not cached on the subscriber. The basic problem is that I'm trying to reinitialize subscribers, but it's trying to make a schema change on the subscribers which was made before the current snapshot was created. My understanding of reinitialization was that it would upload subscriber changes and then basically rebuild the subscriber db from the snapshot. Instead it seems to be applying incremental, historical schema changes on the subscriber.

Hope someone can help me with this.

Regards,

Greg McNamara

|||

And more info:

The schema change causing the original problem was the addition of a foreign key constraint. Records in a table were deleted on the server db before adding the constraint but the subscriber dbs still contain records. The sync is failing because it's trying to apply a constraint against existing records and failing. Reinitializing the subscribers is not fixing the problem (as detailed above). I decided to try deleting the records on the subscriber db before re-syncing. I now get a different error message on sync:

"Either the cursor is not on a row or there are no rows left"

Apparently this is a SQL Compact engine internal error. The malfunctioning reinitialization function seems to have caused this. I tried a repair/compact on the db but still get the same error message on syncing.

Back to the reinitialize not using the current snapshot, is anyone aware of places I should look to see if an old snapshot is being cached and somehow used by the merge sync agent?

Regards,

Greg McNamara

Reinitializing SQL Server 2005 CE subscriber results in a hang

I'm having an issue when I'm using merge replication between SQL Server 2000
sp4 and .NET client using SQL Server 2005 Compact Edition (v3.1). The client
is based on the sample code from MSDN library listed on the
SQLCeReplication.BeginReplication page that fires events to show each stage
of replication that happens.
The inital snapshot is pulled down and the database is created successfully.
When I change data in the SQL Server 2000 database, subsequent replications
work ok and the client successfully pulls down the changes.
However, when the subscription is reinitialized (either at the server, or
client), the app hangs. I believe it may be to do with the size of the
database as it works fine with smaller subsets of the data.
In my case, the app successfully completes the inital conversation with SQL
Server 2000 (the OnSynchronization event reports that SyncProgres is 100%)
and the PublisherChanges property says that there are over 2,000,000 changes
to be made. With an empty database, the app goes on to download each
published table in turn. However, when the subscription is marked for
reinitialization, the app just seems to hang - CPU is up to 90-95% and the
local database grows by 50% but then it does not seem to go any further.
Is this a known limitation with SQL Server 2005 CE? Are there any
workarounds, eg so can I identify in advance whether my subscription has been
marked for reinialization, so that I can drop my existing subscription
(deleting the database) and recreate it again using the latest snapshot?
Thanks
Stuart
Hi,
From your description, I understand that after your subscription was
initialized your application hanged. You would like to know if this was a
known limitation with SQL Server 2005 CE or if you can know in advance that
your subscription is in re-initialization.
If I have misunderstood, please let me know.
From my research, there is not a known limitation regarding this issue. We
can query its status via the stored procedure sp_helpmergesubscription,
however it cannot be judged whether or not a subscription is in
reinitializing. You may check whether or not this issue also occurs on
other subscribers with other SQL Server 2005 Editions.
Anyway I will try to consult the product team on this issue to get further
suggestions. Also I appreciate your understanding that this issue seems was
performance related. To track the root cause and workaround this issue,
dump analysis may be required, however this work can only be done by
Microsoft Customer Support Services (CSS). If I could not get an effective
answer from product team, effectively and immediately I recommend that you
contact CSS via telephone so that a dedicated Support Professional can
assist you in a more efficient manner. Please be advised that contacting
phone support will be a charged call.
To obtain the phone numbers for specific technology request please take a
look at the web site listed below.
http://support.microsoft.com/default.aspx?scid=fh;EN-US;PHONENUMBERS
If you are outside the US please see http://support.microsoft.com for
regional support phone numbers.
Best regards,
Charles Wang
Microsoft Online Community Support
================================================== ====
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====
|||Hi Stuart,
This is a quick note to let you know that I have not got the response from
the product team. I will try to follow up them now. However since the
process may need a long time, I recommend that you leave me
(changliw_at_microsoft_dot_com) an email response so that I can timely
update you when I got the response. If this issue is urgent to your
business, I recommend that you contact CSS via telephone for the best
support.
Best regards,
Charles Wang
Microsoft Online Community Support
================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

Reinitialize with upload question

With merge replication, can I be guaranteed that when I reinitialize a
subscription with upload changes set to true that the changes with either be
uploaded or that an error will be thrown?
I have never had a problem with it.
If you have some other errors where someone merge is totally broken you
might have problems with the upload.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Scott Simons" <Scott.Simons.At.MealMagic.Com.Remove.This> wrote in message
news:33F9FDF9-09F0-44F6-B42D-136F49E6AD25@.microsoft.com...
> With merge replication, can I be guaranteed that when I reinitialize a
> subscription with upload changes set to true that the changes with either
be
> uploaded or that an error will be thrown?
|||I was having problems running into different bugs. Have you ever really had
a problem with bug #811611* or is that not really an issue? Bug 811611 is
there reinitialized subscribers may experience data loss.
*http://support.microsoft.com/default...b;en-us;811611
|||I was unaware we were talking about SQL CE.
I have never had this problem because
1) I carefully monitor my agents to avoid the expensiver reinitialization
2) I don't do a lot of SQL CE, although I do run it.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Scott Simons" <Scott.Simons.At.MealMagic.Com.Remove.This> wrote in message
news:92EC9DC3-8169-4D05-8F64-190011F10CAD@.microsoft.com...
> I was having problems running into different bugs. Have you ever really
had
> a problem with bug #811611* or is that not really an issue? Bug 811611 is
> there reinitialized subscribers may experience data loss.
>
> *http://support.microsoft.com/default...b;en-us;811611
|||This problem that is forcing me to reinitialize is actually coming up due to
other bugs with the merge replication. I don't think that the sql ce merge
replication was designed for anything other than simple replication (ie not
40-some tables with filters on most every table.)
|||I urge you to open a support incident with Microsoft PSS on this one.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Scott Simons" <Scott.Simons.At.MealMagic.Com.Remove.This> wrote in message
news:BD1F835C-F132-469C-ABDD-15B2C446DF44@.microsoft.com...
> This problem that is forcing me to reinitialize is actually coming up due
to
> other bugs with the merge replication. I don't think that the sql ce
merge
> replication was designed for anything other than simple replication (ie
not
> 40-some tables with filters on most every table.)

Reinitialize replication - Merge

I have a few databases that I replicate between NY and Greece. We utilize merge replication on all SQL 2000 servers. My question, is there a quick way to reinitialize replication besides pushing the initial snapshot? I would like to avoid the initial snapshot in the event of a failure due to the amount of time it takes to transfer over our 3mb ATM circuit.

Any help is greatly appreciated.

Thanks,
MichaelYou are kind of between a rock and a hard place (as you've probably noticed). The problem is that if you don't know what is "out of whack" in the replica, the only way to get it back in sync is to push a new snapshot. If you know what the problem is, replication prevents you from fixing it!

In the case where you don't know what is broken, the snapshot is your only safe answer. It may be ugly, but it saves everything that can be salvaged.

In the case where you know what needs to be fixed, you can drop the subscription, fix the problems, then resubscribe without pushing a new snapshot.

See the notes on this subject in MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/replsql/replimpl_7xbn.asp).

-PatP|||Usally you call ReinitializeSubscription when you want to recreate all the
tables on the subscriber and start from a "clean" state. Note that calling ReinitializeSubscription would not clean your subscribtion. This will happen on on the next sync.

Refer to books online for further information on merge replication topic.

reinitialize replication

Hi All,
I select the wrong database to do merge replication. Trying to delete the
replication I delete the suscription and the publication but still
replication folder in my database and all my tables have the extra columns.
How can I delete the replication from my database so I can start all over
this the right database?
Tks in advance, rgds.
Johnny
You will have to drop ROWGUID columns manually.
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"JFB" <jfb@.newSQL.com> wrote in message
news:%23JQqZY62EHA.4072@.TK2MSFTNGP10.phx.gbl...
> Hi All,
> I select the wrong database to do merge replication. Trying to delete the
> replication I delete the suscription and the publication but still
> replication folder in my database and all my tables have the extra
columns.
> How can I delete the replication from my database so I can start all over
> this the right database?
> Tks in advance, rgds.
> Johnny
>
|||Ok, what about the Publications folder inside the database, the extra system
tables and the blue hand in the enterprise manager.
Can I delete this?
Tks for you reply
Johnny
"Kestutis Adomavicius" <kicker.lt@.nospaamm_tut.by> wrote in message
news:eT5aEc62EHA.3452@.TK2MSFTNGP14.phx.gbl...
> You will have to drop ROWGUID columns manually.
> --
> Regards,
> Kestutis Adomavicius
> Consultant
> UAB "Baltic Software Solutions"
>
> "JFB" <jfb@.newSQL.com> wrote in message
> news:%23JQqZY62EHA.4072@.TK2MSFTNGP10.phx.gbl...
> columns.
>
|||run this script in the database.
http://groups-beta.google.com/group/...a?dmode=source
Hilary Cotter
Looking for a SQL Server replication book?
Now available for purchase at:
http://www.nwsu.com/0974973602.html
"JFB" <jfb@.newSQL.com> wrote in message
news:%23JQqZY62EHA.4072@.TK2MSFTNGP10.phx.gbl...
> Hi All,
> I select the wrong database to do merge replication. Trying to delete the
> replication I delete the suscription and the publication but still
> replication folder in my database and all my tables have the extra
> columns.
> How can I delete the replication from my database so I can start all over
> this the right database?
> Tks in advance, rgds.
> Johnny
>
|||Tks for you reply and help Hilary,
I run the script and I got this result with some errors: Can you help me to
fix this?
Rgds
Johnny
**********************************8
Server: Msg 208, Level 16, State 1, Line 3
Invalid object name 'syspublications'.
(0 row(s) affected)
(0 row(s) affected)
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'syssubscriptions'.
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'sysarticleupdates'.
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'systranschemas'.
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'sysarticles'.
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'sysschemaarticles'.
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'syspublications'.
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'MSpub_identity_range'.
(0 row(s) affected)
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'MSreplication_subscriptions'.
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'MSsubscription_agents'.
Server: Msg 259, Level 16, State 2, Line 2
Ad hoc updates to system catalogs are not enabled. The system administrator
must reconfigure SQL Server to allow this.
Server: Msg 259, Level 16, State 2, Line 1
Ad hoc updates to system catalogs are not enabled. The system administrator
must reconfigure SQL Server to allow this.
Server: Msg 3701, Level 11, State 5, Line 1
Cannot drop the view 'sysextendedarticlesview', because it does not exist in
the system catalog.
Server: Msg 259, Level 16, State 2, Line 1
Ad hoc updates to system catalogs are not enabled. The system administrator
must reconfigure SQL Server to allow this.
dropping rowguid constraints MSmerge_delete_conflicts
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:OYi$Rg82EHA.2112@.TK2MSFTNGP15.phx.gbl...
> run this script in the database.
> http://groups-beta.google.com/group/...a?dmode=source
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> Now available for purchase at:
> http://www.nwsu.com/0974973602.html
> "JFB" <jfb@.newSQL.com> wrote in message
> news:%23JQqZY62EHA.4072@.TK2MSFTNGP10.phx.gbl...
>

Reinitialize pull subscription

i am using merge replication for data sync. in the client i have utility
written in vb that use
merge object. Clients get the dynamic snapshots. My question is:
when i run the job and create a new snapshot for a user,
how can i force the client to use this new sanpshot instead of getting
incremental changes?
thanks so much
by the way i use anonymous pull subscription..
"prefect" <uykusuz@.uykusuz.com> wrote in message
news:efuOUegNGHA.3576@.TK2MSFTNGP15.phx.gbl...
> i am using merge replication for data sync. in the client i have utility
> written in vb that use
> merge object. Clients get the dynamic snapshots. My question is:
> when i run the job and create a new snapshot for a user,
> how can i force the client to use this new sanpshot instead of getting
> incremental changes?
> thanks so much
>
|||If you are referring to an existing client, you would have to reinitialize
the subscription. However I don't see why you would want to do this. Please
can you provide a bit more background info.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||for some clients , that do not synchronized for a long time, retention
period expired
therefore some data is lost. so i create a new snapshot with fresh data for
them and i want them to use this new snapshot.
as i said before , they are using a vb utility to synchronize (anonymous
pull subscription).
you know , this utility works like merge agent. i want to do something in
the publisher to make it get the new snapshot.
if the clients remove the utility which deletes the database and install
again , it is working fine. but i dont want them to do that.
thanks so much
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:ekMsamhNGHA.3284@.TK2MSFTNGP14.phx.gbl...
> If you are referring to an existing client, you would have to reinitialize
> the subscription. However I don't see why you would want to do this.
> Please can you provide a bit more background info.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||OK - please take a look at "sp_reinitmergepullsubscription".
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

reinitialize deleted data

hi
i have sql 2000 sp3 and a merge publication with a filter. additional i
have a client with msde also sp3 with is subscriber to the
server-publication.
the replication worked just fine for weeks. on one day i made a sync
with lots of data. while synchronizing the computer shutdown into
standby. after waking up i had a error message from the sql server that
he lost connection or something. til here no problem. so i just tried
again to synchronize. i received the error "merge process could not
initialize publisher XXX"
so i clicked on "reinitialize" on the subscriber. he said then that he
would do it when the merge agent starts the next time. so i synchronized
again and it worked very fast. a bit too fast because ALL data in the
table he should have synchronized has gone. obviously deleted...
can i restore this data again without backup :-)
is this the correct behavour of a reinitialize? if yes, what should i
have done else? if no, what happend then?
thanx for every hint
jazper
You should be able to restore the subscriber from the subscriber backup.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Jazper Manto" <ejazper@.hotmail.com> wrote in message
news:uy8gN83aFHA.2900@.TK2MSFTNGP15.phx.gbl...
> hi
> i have sql 2000 sp3 and a merge publication with a filter. additional i
> have a client with msde also sp3 with is subscriber to the
> server-publication.
> the replication worked just fine for weeks. on one day i made a sync
> with lots of data. while synchronizing the computer shutdown into
> standby. after waking up i had a error message from the sql server that
> he lost connection or something. til here no problem. so i just tried
> again to synchronize. i received the error "merge process could not
> initialize publisher XXX"
> so i clicked on "reinitialize" on the subscriber. he said then that he
> would do it when the merge agent starts the next time. so i synchronized
> again and it worked very fast. a bit too fast because ALL data in the
> table he should have synchronized has gone. obviously deleted...
> can i restore this data again without backup :-)
> is this the correct behavour of a reinitialize? if yes, what should i
> have done else? if no, what happend then?
> thanx for every hint
> jazper
|||hi hilary
what is a "subscriber backup"?
is this the correct behavour of a reinitialize?
jazper

reinitialization using option to bring back subsriber changes first

I have a merge replication setup. for simplicities sake lets say the
publication has 4 articles(tables). The publishing database has 6
articles(tables). All 6 tables exist both at the publisher and subscriber
from previous repl setups. I make the publcation with the 4 articles...
create the new subscription and initialize it... including schema. Then a
few days later I realize I need to add those other 2 tables to this
publication. Currently the 2 tables on the subscriber end have data in them
and the one on the publishers end has no data. I wanted to add the 2 new
articles but bring back the subscriber data into the emtpy publisher's
table. I did not even know if I could add articles to an existing merge
publication without first dropping subscriptions so I figured I would just
try and EM would tell me if I couldn't. So, it did let me add the articles.
I created a new snapshot containing the new articles and performed a
reinitialize choosing to 'upload the changes at the subscriber before
reinitializing'... expecting the data in the 2 new tables to come back. The
data did not come back. I had empty tables on both ends after the
reinitialization took place. I'm sure that was supposed to happen, I just
didn't know it.
So what I need is to fully understand what data can actually come back from
the subsciber using this option upon a reinitialization? requirements?
('upload the changes at the subscriber before reinitializing')
1) I believe what I had done did not work because those 2 new articles were
NOT a part of the original snapshot and therefore changes to them were not
being tracked... is that correct?
2) the only data that could be brought back from subscriber upon
reinitialization using the 'upload the changes at the subscriber before
reinitializing' option are changes to articles that were a part of the
snapshot that that subscriber was last initialized with? TRUE/FASLE?
3) continuing from 2)... and the purpose of this option is just to get data
from a subscriber that may have 'expired' do to a loss of connectivity to
the publisher for an extended period of time? TRUE/FALSE?
any info is greatly appreciated... thanks.
You are pretty much correct. The "Upload changes first..." option is for
uploading any changes at the Subscriber since the last synchronization.
When you choose to reinitialize the merge agent will first upload changes
since the last synch, then it will start applying the snapshot again. This
time since you've added that article to the publication (you should have to
make a new snapshot) the table at the subscriber side will be overwritten
with what is in the table at the publisher. When the article(table) is
added to the publication you also tell it what to do in the case of
reinitializing (drop, truncate, etc...).
If you are familiar with scripting you could use the sp_addscriptexec stored
procedure to make a script to be propagated to the subscriber in order to
upload the data that exists there to the publisher table. These scripts are
run before anything else I believe when a synch is performed. If you are
using sp_addmergearticle to add the article to the publisher there is a
parameter @.creation_script that you might be able to use to upload the data.
I haven't done this but maybe it gives you a few ideas.
hope it helps,
nate
"djc" <noone@.nowhere.com> wrote in message
news:eIskd73XEHA.1144@.TK2MSFTNGP10.phx.gbl...
> I have a merge replication setup. for simplicities sake lets say the
> publication has 4 articles(tables). The publishing database has 6
> articles(tables). All 6 tables exist both at the publisher and subscriber
> from previous repl setups. I make the publcation with the 4 articles...
> create the new subscription and initialize it... including schema. Then a
> few days later I realize I need to add those other 2 tables to this
> publication. Currently the 2 tables on the subscriber end have data in
them
> and the one on the publishers end has no data. I wanted to add the 2 new
> articles but bring back the subscriber data into the emtpy publisher's
> table. I did not even know if I could add articles to an existing merge
> publication without first dropping subscriptions so I figured I would just
> try and EM would tell me if I couldn't. So, it did let me add the
articles.
> I created a new snapshot containing the new articles and performed a
> reinitialize choosing to 'upload the changes at the subscriber before
> reinitializing'... expecting the data in the 2 new tables to come back.
The
> data did not come back. I had empty tables on both ends after the
> reinitialization took place. I'm sure that was supposed to happen, I just
> didn't know it.
> So what I need is to fully understand what data can actually come back
from
> the subsciber using this option upon a reinitialization? requirements?
> ('upload the changes at the subscriber before reinitializing')
> 1) I believe what I had done did not work because those 2 new articles
were
> NOT a part of the original snapshot and therefore changes to them were not
> being tracked... is that correct?
> 2) the only data that could be brought back from subscriber upon
> reinitialization using the 'upload the changes at the subscriber before
> reinitializing' option are changes to articles that were a part of the
> snapshot that that subscriber was last initialized with? TRUE/FASLE?
> 3) continuing from 2)... and the purpose of this option is just to get
data
> from a subscriber that may have 'expired' do to a loss of connectivity to
> the publisher for an extended period of time? TRUE/FALSE?
> any info is greatly appreciated... thanks.
>
|||yes, it does help. Thank you.
"nate axtell" <naxtell at progeny dot net> wrote in message
news:OVsFx0CYEHA.1684@.tk2msftngp13.phx.gbl...
> You are pretty much correct. The "Upload changes first..." option is for
> uploading any changes at the Subscriber since the last synchronization.
> When you choose to reinitialize the merge agent will first upload changes
> since the last synch, then it will start applying the snapshot again.
This
> time since you've added that article to the publication (you should have
to
> make a new snapshot) the table at the subscriber side will be overwritten
> with what is in the table at the publisher. When the article(table) is
> added to the publication you also tell it what to do in the case of
> reinitializing (drop, truncate, etc...).
> If you are familiar with scripting you could use the sp_addscriptexec
stored
> procedure to make a script to be propagated to the subscriber in order to
> upload the data that exists there to the publisher table. These scripts
are
> run before anything else I believe when a synch is performed. If you are
> using sp_addmergearticle to add the article to the publisher there is a
> parameter @.creation_script that you might be able to use to upload the
data.[vbcol=seagreen]
> I haven't done this but maybe it gives you a few ideas.
> hope it helps,
> nate
> "djc" <noone@.nowhere.com> wrote in message
> news:eIskd73XEHA.1144@.TK2MSFTNGP10.phx.gbl...
subscriber[vbcol=seagreen]
a[vbcol=seagreen]
> them
just[vbcol=seagreen]
> articles.
> The
just[vbcol=seagreen]
> from
> were
not[vbcol=seagreen]
> data
to
>