Friday, March 9, 2012

problem when applying a snapshot when tables have been updated during snapshot generation

Hi

I seem to have a strange problem when applying a snapshot when the tables in the publication have been updated while the snapshot was being generated.

Say for example there is a table called RMAReplacedItem in the publication. When the snapshot starts being applied to the subscriber, a stored procedure called sp_MSins_RMAReplacedItem_msrepl_css gets created that handles an insert if the row already exists (ie it updates the row rather than inserting it). However, after all the data has been loaded into the tables, instead of calling this procedure, it tries to call one called sp_MSins_RMAReplacedIte_msrepl_cssm - it takes the last letter of the table name and adds it to the end of the procedure name.

The worst part is that this causes the application of the snapshot to fail, but it doesnt report what the error is, and instead it just tries applying the snapshot again. The only way i have managed to find which call is failing is to run profiler against the subscriber while the snapshot is being applied and see what errors.

I have run sp_broswereplcmds and the data in there is what is applied to the subscriber - ie the wrong procedure name.

All the servers involved are running sql 2005 service pack 2. The publisher and subscriber were both upgraded from sql 2000, but the distribution server is a fresh install of sql 2005.

i've had a similar issue and this seems to happen when there is a lot of activity on the subscriber. for some reason we are insterting data into a subscriber and a lot of selects are going on blocking the index creation.

what we did for this table we set up to create on the PK and the clustered index. the non-clustered indexes we run a job manually to create them after the snapshot is complete

No comments:

Post a Comment