如何确保将 Oracle 物化视图创建为“可写”物化视图而不是“可更新”物化视图?我从不希望这些视图将数据推送回源,我希望完全刷新以覆盖我更改的任何内容。
根源问题是其中一个远程数据库不支持物化视图日志,但表有最后修改的时间戳列。因此,我想尝试通过在该列上过滤 Merge 语句使它们保持最新,然后如果出现任何问题,偶尔会进行正常的复制刷新。
我试过了CREATE MATERIALIZED VIEW Test.SomeTable_MVW TABLESPACE SOME_DATA BUILD DEFERRED REFRESH COMPLETE FOR UPDATE AS (SELECT ... FROM SomeTable@OverThere);
但我得到了错误:
12013. 00000 - "updatable materialized view must be simple enough and have a materialized view log on its master table to do fast refresh"
*Cause: The updatable materialized view query contained a JOIN, SUBQUERY,
UNION, CONNECT BY, ORDER BY, or GROUP BY clause, or the master
table did not have a materialized view log.
*Action: Make the materialized view simpler. If a join is really needed,
make multiple simple materialized views then put a view on top of
them. Make sure a materialized view log is created for the master
table.
只有一张远程桌子。我不明白为什么甚至包含此错误,or the master table did not have a materialized view log
因为这就是您获得可写物化视图的方式。太糟糕了,当您知道不想将数据推回时,没有“FOR WRITEABLE”子句。并且 REFRESH COMPLETE 应该提示我不想将数据推回。