on 2020 Mar 11 10:32 AM
Is there a way to update the subscribe_by column in table SYSSUBSCRIPTION/S?
We are doing some changes in the infrastructure naming, so that I need to update the subscribe-by value for each remote on the Cons.
I could not find a statement like alter subscription in the docs.
If this is not possible, should I then use drop subscription + create subscription statements instead? I just wanted to make sure, that after these two statements the SQL-Remote offsets will stay healthy (I mean no side effects on SYSREMOTEUSERS)
Request clarification before answering.
There is no ALTER SUBSCRIPTION command. You would need to DROP, CREATE and START the subscription in question to change the subscribe by value. DO NOT STOP READING NOW.
These statements will have no effect on the rows in the SYSREMOTEUSER table, so you will likely be able to run dbremote again after executing these commands, and you will not likely get any errors about log offsets, BUT THAT IS 100% IRRELEVANT.
By executing these commands, and in particular changing the subscribe by value to a publication for a given subscription, you have created MASSIVELY CATASTROPHIC issues in the data integrity between the consolidated and the remote database.
The FIRST thing you need to do after executing the DROP/CREATE/START SUBSCRIPTIONS commands is to either re-extract the remote user in question or execute a SYNCHRONIZE SUBSCRIPTION command (which isn't currently working for you) to make sure that the data between the consolidated and remote database are in synch.
These types of things you are asking about are things that should be verified in your test environment before being applied to your production environment.
Reg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you for the clear and detailed answer.
Yes, the remote database should have now different subset of data, and this is the reason, why I wanted to change the subscribe_by value on Cons.
Thanks for the hint. But as long as I issue SYNCHRONIZE SUBSCRIPTION Command, then this will not be a problem, because it will delete the tables in question on each remote, and then will fill those tables on each remote with the correct subset of data (the new subscribe_by values will decide the subset for each romte).
After following the steps (drop, create, start, synchronize subscription) I got not 100% correct results as expected.
The problem is that each remote has now double data rows as expected (i.e. the datarows from old subscribe_by value AND the datarows from the new subscribe_by value, here in my case the subscribe_by is ZIP)!!
This is because the SYNCHRONIZE SUBSCRIPTION statement on Cons. does the following on Remote:
The problem here is with number 1 above, since here the delete statement is conditioned (delete from myprices where zip = 'new_zip_value').
Anyway, I solved it later as I delete all prices not belonging to current zip on each remote (delete from myprices where zip <> 'new_zip_value');
I delete all prices not belonging to current zip on each remote
And that DELETE does not get replicated back to the cons...?
No, the table myprices has one directional replication (only cons. -> remote)
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.