Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Manually Deleting Merge Meta Data tables

 
   Database Help (Home) -> Replication RSS
Next:  finding number range  
Author Message
Schwizzla

External


Since: Jun 20, 2008
Posts: 4



(Msg. 1) Posted: Mon Dec 29, 2008 7:18 am
Post subject: Manually Deleting Merge Meta Data tables
Archived from groups: microsoft>public>sqlserver>replication (more info?)

Scenario: SQL 2000 1 publisher (Merge and Trans), two subscribers.
Problem: Subscription expiration for Merge Publication set to 'never expire'
hence MSMerge_contents = 44million rows. MSmerge_genhistory = 9 million rows

When pushing out to new subscriber this is causing a)snapshot to fail b)in
the rare instance when snapshot works it is causing Merge push to fail as
Subscriber tran log blowing up or timeouts.

Resolution: Need to delete all data upto last 7 days in the metadata tables

Question: how? Sad

What i have been attempting is by gradully reducing the Subscription in
order for the automatic metadatretentioncleanup SP to do its thing (merge
agent set to run every minute). Only problem is that I am currently at day
710 and at this rate I will be hear until 2010. If I decrease by only 5 days
the whole thing takes ages casuing locking and other issues to end users who
directly hit the publisher.

I have investigted this option

http://talatnauman.blogspot.com/2008/06/purging-merge-replication-history.html

to manully delete the data in the two table bit by bit. Any opnions on this,
could it mess up replication?

Many thanks for your answers

 >> Stay informed about: Manually Deleting Merge Meta Data tables 
Back to top
Login to vote
Hilary Cotter3

External


Since: Aug 28, 2004
Posts: 458



(Msg. 2) Posted: Mon Dec 29, 2008 6:36 pm
Post subject: Re: Manually Deleting Merge Meta Data tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I've had to do this from time to time.

I normally do this

set rowcount 5000
GO
while (1=1)
begin
delete MSmerge_contents from MSmerge_contents a, MSmerge_genhistory b where
a.generation = b.generation and a.tablenick=b.art_nick and b.coldate <
@coldate and a.generation > 0
if @@rowcount<5000
break
delete MSmerge_genhistory where coldate < @coldate and pubid is not null
end
GO

On some servers you might want to bump or down up the rowcount

"Schwizzla" wrote in message

> Scenario: SQL 2000 1 publisher (Merge and Trans), two subscribers.
> Problem: Subscription expiration for Merge Publication set to 'never
> expire'
> hence MSMerge_contents = 44million rows. MSmerge_genhistory = 9 million
> rows
>
> When pushing out to new subscriber this is causing a)snapshot to fail b)in
> the rare instance when snapshot works it is causing Merge push to fail as
> Subscriber tran log blowing up or timeouts.
>
> Resolution: Need to delete all data upto last 7 days in the metadata
> tables
>
> Question: how? Sad
>
> What i have been attempting is by gradully reducing the Subscription in
> order for the automatic metadatretentioncleanup SP to do its thing (merge
> agent set to run every minute). Only problem is that I am currently at day
> 710 and at this rate I will be hear until 2010. If I decrease by only 5
> days
> the whole thing takes ages casuing locking and other issues to end users
> who
> directly hit the publisher.
>
> I have investigted this option
>
> http://talatnauman.blogspot.com/2008/06/purging-merge-replication-history.html
>
> to manully delete the data in the two table bit by bit. Any opnions on
> this,
> could it mess up replication?
>
> Many thanks for your answers
>
>
>

 >> Stay informed about: Manually Deleting Merge Meta Data tables 
Back to top
Login to vote
Paul Ibison

External


Since: Oct 03, 2008
Posts: 145



(Msg. 3) Posted: Tue Dec 30, 2008 1:14 am
Post subject: RE: Manually Deleting Merge Meta Data tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Just a heads-up - you'll also need to include MSMerge_tombstone in this type
of script.
Cheers,
Paul Ibison
 >> Stay informed about: Manually Deleting Merge Meta Data tables 
Back to top
Login to vote
Schwizzla

External


Since: Jun 20, 2008
Posts: 4



(Msg. 4) Posted: Tue Dec 30, 2008 2:37 am
Post subject: Re: Manually Deleting Merge Meta Data tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks Hilary and Paul,

just the guys I was hoping to get an answer from! Your responses to problems
are very gratefully recieved Smile

Hilary, do you agree that doing manual deletes should not mess up
replication? Also do you advise that I stop the Merge Agents from running
whilst doing the deletes?

Paul, can I safely exclude deleting from the msmerge_tombstone table if its
not too large. Also am I correct in saying that this holds only deleted data
so its safe to leave this out so long as I ensure its regularly indexed?

Thanks
S

"Hilary Cotter" wrote:

> I've had to do this from time to time.
>
> I normally do this
>
> set rowcount 5000
> GO
> while (1=1)
> begin
> delete MSmerge_contents from MSmerge_contents a, MSmerge_genhistory b where
> a.generation = b.generation and a.tablenick=b.art_nick and b.coldate <
> @coldate and a.generation > 0
> if @@rowcount<5000
> break
> delete MSmerge_genhistory where coldate < @coldate and pubid is not null
> end
> GO
>
> On some servers you might want to bump or down up the rowcount
>
> "Schwizzla" wrote in message
>
> > Scenario: SQL 2000 1 publisher (Merge and Trans), two subscribers.
> > Problem: Subscription expiration for Merge Publication set to 'never
> > expire'
> > hence MSMerge_contents = 44million rows. MSmerge_genhistory = 9 million
> > rows
> >
> > When pushing out to new subscriber this is causing a)snapshot to fail b)in
> > the rare instance when snapshot works it is causing Merge push to fail as
> > Subscriber tran log blowing up or timeouts.
> >
> > Resolution: Need to delete all data upto last 7 days in the metadata
> > tables
> >
> > Question: how? Sad
> >
> > What i have been attempting is by gradully reducing the Subscription in
> > order for the automatic metadatretentioncleanup SP to do its thing (merge
> > agent set to run every minute). Only problem is that I am currently at day
> > 710 and at this rate I will be hear until 2010. If I decrease by only 5
> > days
> > the whole thing takes ages casuing locking and other issues to end users
> > who
> > directly hit the publisher.
> >
> > I have investigted this option
> >
> > http://talatnauman.blogspot.com/2008/06/purging-merge-replication-history.html
> >
> > to manully delete the data in the two table bit by bit. Any opnions on
> > this,
> > could it mess up replication?
> >
> > Many thanks for your answers
> >
> >
> >
>
 >> Stay informed about: Manually Deleting Merge Meta Data tables 
Back to top
Login to vote
Hilary Cotter3

External


Since: Aug 28, 2004
Posts: 458



(Msg. 5) Posted: Tue Dec 30, 2008 10:56 am
Post subject: Re: Manually Deleting Merge Meta Data tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I have not had a problem with it. I would stop with a month old data.
"Schwizzla" wrote in message

> Thanks Hilary and Paul,
>
> just the guys I was hoping to get an answer from! Your responses to
> problems
> are very gratefully recieved Smile
>
> Hilary, do you agree that doing manual deletes should not mess up
> replication? Also do you advise that I stop the Merge Agents from running
> whilst doing the deletes?
>
> Paul, can I safely exclude deleting from the msmerge_tombstone table if
> its
> not too large. Also am I correct in saying that this holds only deleted
> data
> so its safe to leave this out so long as I ensure its regularly indexed?
>
> Thanks
> S
>
> "Hilary Cotter" wrote:
>
>> I've had to do this from time to time.
>>
>> I normally do this
>>
>> set rowcount 5000
>> GO
>> while (1=1)
>> begin
>> delete MSmerge_contents from MSmerge_contents a, MSmerge_genhistory b
>> where
>> a.generation = b.generation and a.tablenick=b.art_nick and b.coldate <
>> @coldate and a.generation > 0
>> if @@rowcount<5000
>> break
>> delete MSmerge_genhistory where coldate < @coldate and pubid is not null
>> end
>> GO
>>
>> On some servers you might want to bump or down up the rowcount
>>
>> "Schwizzla" wrote in message
>>
>> > Scenario: SQL 2000 1 publisher (Merge and Trans), two subscribers.
>> > Problem: Subscription expiration for Merge Publication set to 'never
>> > expire'
>> > hence MSMerge_contents = 44million rows. MSmerge_genhistory = 9 million
>> > rows
>> >
>> > When pushing out to new subscriber this is causing a)snapshot to fail
>> > b)in
>> > the rare instance when snapshot works it is causing Merge push to fail
>> > as
>> > Subscriber tran log blowing up or timeouts.
>> >
>> > Resolution: Need to delete all data upto last 7 days in the metadata
>> > tables
>> >
>> > Question: how? Sad
>> >
>> > What i have been attempting is by gradully reducing the Subscription in
>> > order for the automatic metadatretentioncleanup SP to do its thing
>> > (merge
>> > agent set to run every minute). Only problem is that I am currently at
>> > day
>> > 710 and at this rate I will be hear until 2010. If I decrease by only 5
>> > days
>> > the whole thing takes ages casuing locking and other issues to end
>> > users
>> > who
>> > directly hit the publisher.
>> >
>> > I have investigted this option
>> >
>> > http://talatnauman.blogspot.com/2008/06/purging-merge-replication-history.html
>> >
>> > to manully delete the data in the two table bit by bit. Any opnions on
>> > this,
>> > could it mess up replication?
>> >
>> > Many thanks for your answers
>> >
>> >
>> >
>>
 >> Stay informed about: Manually Deleting Merge Meta Data tables 
Back to top
Login to vote
Hilary Cotter3

External


Since: Aug 28, 2004
Posts: 458



(Msg. 6) Posted: Tue Dec 30, 2008 10:58 am
Post subject: Re: Manually Deleting Merge Meta Data tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

there u go again Paul, making me look bad! Thank u very much!!! I don't need
ur help with that;)

"Paul Ibison" wrote in
message
> Just a heads-up - you'll also need to include MSMerge_tombstone in this
> type
> of script.
> Cheers,
> Paul Ibison
>
 >> Stay informed about: Manually Deleting Merge Meta Data tables 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Merge Replication - Deleting Data - Hi all, I have a problem with data rows in a header table vanishing without a trace. The header record has related detail records with related FK constraints (not enforce relationship with replication) The header record also has a link to another detail...

Trying to use replication and merge 2 tables into 1 table. - I posted this earlier, but I think I posted it to the wrong section. So I didn't have a lot of answers. I have a production instance and a web instance. What I would like to do is take 3 tables from the production and merge them into 1 table for the we...

Adding a column to tables in merge replication. - Hi, we need to add a column to the table that is used as the subscriber table in a merge replication, will this break the replication. We also need to add a column to the table that is used as the publisher table in a merge replication, will this also...

Merge replication - missing data - Hi all, I've been using Merge replication with SQL Server 2000 for about 3 years now with little problem, but over the past month have noticed that some data records that have successfully replicated to all subscribers have gone missing from the..

Missing data problem with merge replication - Hi, The scenario I am running into is as follows: On Sunday the 13th, I attempted to move the publisher to a new server. Everything looked good except that data changes on the subscriber weren't be replicated back to the publisher. I undid the server..
   Database Help (Home) -> Replication All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]