Backing up/restoring a replication db as another name...

  • Hi there,

    Ran into an issue where I have a DB setup for merge replication to allow tablet pcs to synch up on our product.  The merge replication works fine, with up to 6-7 different tablets being able to connect,get selective data, etc.

    One of the OTHER features that we have allows for a 'test sales' database to be created dynamically off of criteria.  Basically what I do is backup the original database, restore it as a different name and then alter the data dependant upon their user criteria.

    The problem is that when I backup and restore the replication database, the new database that I created is ALSO setup for replication, which makes it impossible for me to delete the test database after the user is done with it, or if they need to recreate it.

    I've tried setting exec sp_replicationdboption to false for the test database, and also ran exec sp_dropmergepublication to try and get rid of its replication status but it wont go away.  The ONLY way I could delete it was to disable publications on the entire server, which of course removed the one that I need.

    It seems that because it was a restored database that somehow its replication job names(?!?) are identical.

    Any thoughts on how to get around this?

    thanks,

    Chris

     

  • Try sp_removedbreplication 'dbname'

    This will clear replication from the specified database, without affecting other publications.

  • heh, thanks

    Tried just about every option EXCEPT that one.

    EDIT:  Still having a problem though... the database is no longer marked for replication however ALL of the replication triggers seem to be in place still.  Anytime I now try to modify/add any data I get a whole host of nasty errors.

    Server: Msg 208, Level 16, State 1, Procedure ctsv_BBC7604F19884476BBC9CCE5AED31749, Line 2

    Invalid object name 'dbo.MSmerge_contents'.

    Server: Msg 208, Level 16, State 1, Procedure ctsv_BBC7604F19884476BBC9CCE5AED31749, Line 2

    Invalid object name 'dbo.MSmerge_contents'.

    Server: Msg 208, Level 16, State 1, Procedure ctsv_BBC7604F19884476BBC9CCE5AED31749, Line 2

    Invalid object name 'dbo.MSmerge_contents'.

    Server: Msg 208, Level 16, State 1, Procedure ctsv_BBC7604F19884476BBC9CCE5AED31749, Line 2

    Invalid object name 'dbo.MSmerge_contents'.

    Server: Msg 4413, Level 16, State 1, Procedure upd_BBC7604F19884476BBC9CCE5AED31749, Line 60

    Could not use view or function 'ctsv_BBC7604F19884476BBC9CCE5AED31749' because of binding errors.

    Server: Msg 4413, Level 16, State 1, Procedure upd_BBC7604F19884476BBC9CCE5AED31749, Line 60

    Could not use view or function 'ctsv_BBC7604F19884476BBC9CCE5AED31749' because of binding errors.

    Server: Msg 4413, Level 16, State 1, Procedure upd_BBC7604F19884476BBC9CCE5AED31749, Line 78

    Could not use view or function 'ctsv_BBC7604F19884476BBC9CCE5AED31749' because of binding errors.

    Server: Msg 4413, Level 16, State 1, Procedure upd_BBC7604F19884476BBC9CCE5AED31749, Line 78

    Could not use view or function 'ctsv_BBC7604F19884476BBC9CCE5AED31749' because of binding errors.

    And thats just one little proc.... going to try a few other options but if anyone has any thoughts, it would be appreciated

    Thanks,

    Chris

     

Viewing 3 posts - 1 through 2 (of 2 total)

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