请教一下关于Oracle物化视图刷新方式on commit 问题?

SQL> CREATE Materialized View q
2 REFRESH Force
3 on commit
4 NEXT SYSDATE + 5/(24*60)
5 AS
6 select nvl(a.n1,b.n1) as n1,nvl(a.n2,b.n2) as n2,nvl(n3,0) as n3,nvl(n4,0)a
s n4,(nvl(n4,0)-nvl(n3,0)) as n5 from a full join b on a.n1=b.n1 and a.n2=b.n2;

select nvl(a.n1,b.n1) as n1,nvl(a.n2,b.n2) as n2,nvl(n3,0) as n3,nvl(n4,0)as n4,
(nvl(n4,0)-nvl(n3,0)) as n5 from a full join b on a.n1=b.n1 and a.n2=b.n2

*
ERROR at line 6:
ORA-12051: ON COMMIT attribute is incompatible with other options
哦 谢谢 我是初学者 那你是上哪找的 是Oracle 官网吗 还是 Oracle 帮助 文档

胡子哥哥
浏览 591回答 2
2回答

LEATH

首先要确保你建的物化视图刷新方式是on demand,还是on commit;1、on demand 顾名思义,仅在该物化视图“需要”被刷新了,才进行刷新(REFRESH),即更新物化视图;这是需要手动刷新的。2、on commit 提交触发,一旦基表有了commit,即事务提交,则立刻刷新,立刻更新物化视图。
打开App,查看更多内容
随时随地看视频慕课网APP