Question

Good afternoon,

I have 3 databases; the SIDs are config, prod1 and prod2.

I am using Materialized Views to replicate data on 11 tables in the config database onto the other two databases. The Materialized Views are currently refreshing every five seconds but it would be ideal if they were updated on commit.

I came across this website that explains that when replicating from a remote database that on commit is not supported.

This is what I was expecting to work

CREATE MATERIALIZED VIEW "schema"."table" USING INDEX REFRESH FORCE ON COMMIT AS select column1 from schema.table@config;

The method "refresh fast on demand with primary key" is suggested in the link but obviously this is on demand. I am wondering what ideas anyone may have in order to get a refresh-on-commit environment running if possible?

Thanks

Was it helpful?

Solution

You can't create a materialized view refreshed on commit from a remote table. From the documentation:

Restrictions on Refreshing ON COMMIT

This clause is not supported for materialized views containing object types or Oracle-supplied types.

This clause is not supported for materialized views with remote tables.

The reason is that the database link is defined in the "child" database, not in the "parent" database. Therefore, the parent database can't possibly trigger or modify anything in the child database on its own.

If you want a 100% real-time copy of a table, I suggest a view.

If you want to replicate the data on commit, you could modify your DML procedures so that they update the children remote tables at the same time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top