这个快速刷新的视图定义有什么问题:它并不复杂和完整,但是ORA-12015被提升了

Cla*_*ude 1 oracle materialized-views oracle10g

Oracle 10.2中这种快速刷新的视图定义有什么问题:

create table A
(
  ID number(19,0) not null constraint A_PK primary key using index
, C number(9,0) not null
);

create table B
(
  ID number(19,0) not null constraint B_PK primary key using index
, A_ID number(19,0) not null constraint A_FK references A(ID) on delete cascade
, D number(9,0) not null
);

create index B_FK_IDX on B(A_ID);

create materialized view log on A 
  with primary key, rowid, sequence (C) including new values;
create materialized view log on B
  with primary key, rowid, sequence (A_ID, D) including new values;

 create materialized
   view X
        refresh fast with primary key
     as
 select A.ID as A_ID
      , A.ROWID as A_ROWID
      , B.ID as B_ID
      , B.ROWID as B_ROWID
      , A.C
      , B.D
   from A
  inner join
        B
          on B.A_ID = A.ID;
Run Code Online (Sandbox Code Playgroud)

当脚本执行时,我得到:

table A created.
table B created.
index B_FK_IDX created.
materialized view LOG created.
materialized view LOG created.
...[view definition and local error message left out]
SQL-Error: ORA-12015: cannot create a fast refresh materialized view from a complex query
12015. 00000 -  "cannot create a fast refresh materialized view from a complex query"
*Cause:    Neither ROWIDs and nor primary key constraints are supported for
           complex queries.
*Action:   Reissue the command with the REFRESH FORCE or REFRESH COMPLETE
           option or create a simple materialized view.
Run Code Online (Sandbox Code Playgroud)

我无法看到违反Oracle支持文档179466.1中定义的物化视图的任何限制.

Wer*_*eit 7

您不能使用ANSI连接语法,请使用旧的Oracle连接语法.这是Oracle中的一个错误.很久以前我为此开了一个案例,但Oracle认为这只是缺乏文档!