--给用户授权GRANT CREATE MATERIALIZED VIEW TO CDR;--创建物化视图的表日志(具体到某个表,物化视图中用到几个表就需要建立几个日志);当用FAST选项创建物化视图,必须创建基于主表的视图日志,如下:CREATE MATERIALIZED VIEW LOG ON aTABLESPACE CDRWITH ROWID;--查询物化视图日志SELECT * FROM MLOG$_A--创建物化视图CREATE MATERIALIZED VIEW VIEW_ABUILD IMMEDIATE REFRESH FORCE--/FAST/COMPLETEON DEMAND--/COMMITWITH ROWID AS SELECT * FROM A;--查询物化视图SELECT * FROM VIEW_A--刷新物化视图,命令窗口执行EXEC DBMS_MVIEW.REFRESH('VIEW_A','C');--完全刷新EXEC DBMS_MVIEW.REFRESH('VIEW_A','F'); --快速刷新--删除物化视图日志DROP MATERIALIZED VIEW LOG ON A;--删除物化视图DROP MATERIALIZED VIEW VIEW_A;