給物化檢視設定自動快速重新整理功能失敗

nathanzhn發表於2014-03-01

為什麼我把基表和物化檢視建在同一個庫上可以給物化檢視設定自動快速重新整理功能,但是如果基表在另一個庫上,物化檢視通過dblink連線基表,就不能設定自動快速重新整理功能,建立的時候報錯:
ERROR at line 1:
ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
資料庫是10.2.0.1,指令碼在下面,請大俠幫忙看看啊,謝謝哈!
成功指令碼是:
PROD1@PROD>create table t1 (x int,y int,z int);  
Table created.
PROD1@PROD>insert into t1 values (1,2,3);
1 row created.
PROD1@PROD>insert into t1 values (4,5,6);
1 row created.
PROD1@PROD>commit;
Commit complete.
PROD1@PROD>create materialized view log on t1 with sequence,rowid (x,y,z) including new values;
Materialized view log created.
PROD1@PROD>create materialized view mv_t1 build immediate refresh with rowid fast on commit enable query rewrite as select x,y from t1;
Materialized view created.
失敗指令碼是:
PROD2@PROD2>create table t1 (x int,y int,z int);  
PROD2@PROD2>insert into t1 values (1,2,3);
PROD2@PROD2>insert into t1 values (4,5,6);
PROD2@PROD2>commit;
PROD2@PROD2>select * from t1;
PROD2@PROD2>create materialized view log on t1 with sequence,rowid (x,y,z) including new values;
Materialized view log created.
PROD1@PROD>drop materialized view mv_t1;
Materialized view dropped.
PROD1@PROD>create materialized view mv_t1 build immediate refresh with rowid fast on commit enable query rewrite as select x,y from t1@dblink_prod2;
create materialized view mv_t1 build immediate refresh with rowid fast on commit enable query rewrite as select x,y from t1@dblink_prod2
*
ERROR at line 1:
ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view

 

網上有人說“on commit的一個前提就是物化檢視和基表必須處於一個資料庫中”。不知道這個說法對不對。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26521853/viewspace-1097819/,如需轉載,請註明出處,否則將追究法律責任。

相關文章