Switching Tables in Production
774875Mar 3 2011 — edited Mar 10 2011Hello,
I have got this table (let me call it tab1) that is referenced in a lot of stored objects in Production.
Tab1 gets refreshed everyday, and so everyday for about 30 minutes the data in this table would be off. Now, I'm thinking if there is a way to switch the table in the stored objects to a different one (maybe with a synonym).
This is what I'm thinking
1) I create a synonym 'S' and point it to Tab1.
2) Tab2 is created which would have the same data as Tab1.
Now, before the refresh of Tab1 S is changed to point to Tab2, and after the refresh S is changed to point back to Tab1, and then Tab2 is refresh of Tab1.
Now the issue with this approach is that the queries in the stored objects uses hints on indexes.
Can anyone help me implement this kind of switch?
Thanks,
CJM