I have a master table, and several remote read-only materialized views on pre-built tables that are being fast refreshed to keep in sync with the master table, using a dblink.
The table definitions (master and remotes) are currently identical. I want to add a column to the master table, and eventually have any changes propagate to the remote tables…without breaking anything 🙂
I don't have much experience with this, so I'm not 100% sure how to proceed.
My current plan is:
- Add column to master table
- Add column to remote tables
- Drop the materialized views on the remote tables
- Recreate the materialized views on the remote tables, but with the added column.
What I want advice on is whether this should work, or do I need to do something with the materialized view log on the master as well?
Best Answer
As long as you don't add data between the last refresh before the column add and after the column add, you should be fine. If you must allow for this then the easiest thing would be to do a complete refresh at the end of your plan. You shouldn't need to re-create the materialized view log.
Setup
Planned Column Add