on 2010 Jun 23 12:51 PM
Over the years, our SQL Remote setup has experienced several schema changes. Now there are some (empty) tables that aren't in use anymore (since a few years already). Note that they are not referenced by other tables.
So far, I have left them in the publications since they do not disturb and since dropping a table from a publication looks dangerously. However, I'd try to achieve this now as part of another schema change.
Preconditions:
As such I can guarantee no site is using these obsolete tables anymore. However, they are still referenced inside procedures, triggers and the like.
After studying some newsgroup threads, the important parts seems to be:
Question:
Do these steps and their order make sense, or do I have overseen something of importance?
(Of course these steps are going to be tested, tested, tested before production usage.)
Your plan sounds good Volker, particularly the part at the end where you say that the steps and going to be tested (three times).
Two comments :
I like the paranoia you exhibit in step 4. Even if remote databases don't have outstanding data in the tables you'll be dropping, if you remove the table from the consolidated, and then some un-informed user inserts a row into the table before it receives the passthrough session to drop it, then an insert will be sent to the consolidated database, which will cause an error, since the table no longer exists. Again, no big deal, UNLESS the insert on the non-existent table is in the same transaction as an operation that you want to keep. IMHO, there is no harm in keeping the table at the consolidate until such a time that the minimum confirm_sent value in the SYSREMOTEUSER table us higher than the log offset where you executed the passthrough session.
You talk in step 4 about "dropping the table" once the remotes have confirmed the schema change, but remember that you also will need to modify your stored procedures and triggers at the consolidated at this time as well. I think it's also important to convince yourself that the stored procedures and triggers are logically equivalent before and after your change, even though the reference to the tables is gone after wards.
Reg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sounds like SQL Remote schema changes and paranoia form a nice pair:) - Thanks for your comments, partiucularly the 2nd one. I have planned to run the 2nd step against both consolidated and remotes (and in my particular case this should work) but I see that the general (and more paranoid) approach would be to delay these actions for the consolidated until step 4. - Or to split it up: E.g. code with inserts/updates in the obsolete tables might be already removed in step 2 whereas code with FK checks or the like might have to be retained until step 4. (As you see, I'm just "brain-storming")
User | Count |
---|---|
71 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.