我需要将作为主键一部分的列的唯一值从表中提取到物化视图中。如果使用“刷新完成”,我可以创建物化视图,但在尝试使用“提交时快速刷新”时却没有运气。谁能指出我是否错过了什么或者Oracle不支持这样的操作。
下面列出了示例输出。谢谢。
SQL> create table TEST( col1 number, col2 number, col3 varchar(32), CONSTRAINT test_pk Primary Key (col1, col2));
Table created.
SQL> create materialized view test_mv build immediate refresh fast on commit as select distinct col2 from test;
create materialized view test_mv build immediate refresh fast on commit as select distinct col2 from test
*
ERROR at line 1:
ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
SQL> create materialized view test_mv build immediate refresh complete as …
Run Code Online (Sandbox Code Playgroud)