Updatable Materialized View in same schema as Master
Okay, I know this is a really stupid solution, but there are multiple restrictions in place from the client.
So here is the nightly process (using a one-table example for simplicity)
Truncate a local table.
- Copy all the data from another system's database into my local table.
- I have a Writable Materialized View that points to this table.
(As the users make changes to this table, messages are sent off to the other system to implement the local changes there)
- I copy any 'new' rows (Rows that were not yet processed on the other system - defined via status fields, etc.) from the Materialized View into this local table.
- Do a refresh of the Materialized View from the local table.
This all works fine.
My problem is that the system is going to now be live during this 'refresh' process. That means that the user can still be making changes to the Writable Materialized View *after* I've copied off 'new' records and *before* the refresh is complete.
The only way I see to plug this hole is to make the Materialized View *Updatable* instead of just *Writable*.
This leads me to my actual problem:
In order to make an MV Updatable, I need to do all manner of stuff including calls to:
So, I can make the current schema a master site and I can create a master group and add my table to it. The problem comes when I try to make the same schema a child site as well. When I try to call DBMS_REPCAT.CREATE_MVIEW_REPGROUP, I need to use the same GNAME that was used in DBMS_REPCAT.CREATE_MASTER_REPGROUP, but the Oracle says
ORA-23374: object group x.y already exists.
So, the child's MView Group needs to be the same name as the parent's Master Group so it can properly link to it, but when it tries to make it, it says that it already exists (since the parent and child are the same schema in this case).
Anyone have any thoughts on this one?
Click Here to Expand Forum to Full Width