Cleanup of Merge Replication Objects

  • Is there a way to cleanup leftover merge replication objects? There's a bunch of triggers and conflict tables and the like which is no longer needed and is cluttering up the database. I would like to get rid of them.

    We previously were using both transactional and merge replication from our website database to our middle tier. The merge was used because a field needed to be updated at the subscriber. However, it was designed (poorly) so that tables with RI were split between the merge and transactional reps. We occassionally had problems of replication failing because the parent record hadn't been replicated yet. I want to fix this by making all of it into a single, immediate and queued transactional replication. That way I can also replicate the declared referential integrity.

    So I removed all the previous publications (3 transactional, 1 merge) and combined them into a single transactional publication. But the merge tables and triggers are still on the subscriber. I can live with the tables but I'm concerned about the triggers. I'm not sure if they will hurt performance or simply break because of the updatable subscriber. So that's why I want to ditch the triggers.

    Any help would be wonderful!

  • when you restore a backup of a database in a server that has nothing replicating all replication metadata is supposed to be removed. I know this may not be what you wanted to hear but I  believe this is the safest way to do it.

    There is an sp sp_cleanupdbreplication (undocummented) which goes a long way in the process but again, you are on your own with it

    hth


    * Noel

  • The only official way that I could think of is to remove replication entirely for that object.  You know, deleting the subscribers, dropping the publication, and then going into the replication configuration wizard and disabling that database as a publisher.  That has always worked for me.

  • Really?  I could have sworn that last time I followed those steps, all of the tables added by merge replication in the database I was modifying were gone.  Of course, there's probably still data left in distribution that's left behind.  *shrug*

  • I don't know what happened but I believe I deleted somehow my previous post.

    Anyways the Deal is that I depends on how is the setup done. If Remote Agent activation is used in the process you will have to take care not only of the publisher but also the subscriber

    I am pretty sure EM Prompts you if you want to cleanup the replicated data also on the subscriber I have always answered no to that one, but maybe if you say yes then it may *work*

    hth

     


    * Noel

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply