Wednesday, March 21, 2012

msmerge_contents doesn't get deleted

Hi all,
I'm having a problem with my sql server. I've an application where
several subscribers synchronize with a sql server publisher for some
tables of a database and a batch process also interacts with those
tables (basically updates data as a batch process from a SAP)
The problem I have is that data of actualizations made to the table
from the batch process (in msmerge_contents) is never cleaned up and
the table keeps growing without limit. In a couple of weeks the
synchronization process gives timeout errors to devices.
I've the property -MetaDataRetentionCleanUp set to 1 and data from
subscriber's synchronization gets cleaned up after retention period
expires. This aparently works well but how is data actualizations
coming from the batch process supposed to get deleted if it doesn't
have a Merge Agent ?
Actually I'm running the stored procedure sp_mergecleanupmetadata
after some days to clean up the merge tables but this is giving a lot
of synchronization problems with subscribers.
Could anybody give an advice on how should this problem be solved ?
any help will be appreciated.
thx in advance,
ori
Ok, I've accepted that this behaviour is by design. If you have an
external source updating a publicated table, that will generate
tracking rows in the msmerge_contents table and that rows will never
be cleaned up because there's no Merge Agent associated with the
source.
Now, what I'd like to do is to find a way to remove manually that
rows. I thought it would be possible to generate a script that would
delete all the rows inserted by the external source in the table
msmerge_contents with a date prior to two times the retention date set
on the publication. This way, I can assure that all the subscribers
are synchronizated or will be marked for reinitialization so they'll
be up to date.
Could anybody help me with that script ? Is it a good solution ? can
it be done ?
Any help will be appreciated, thx in advance.
ori

No comments:

Post a Comment