1.一般view 是一堆sql的別名, 但MATERIALIZED VIEW可以創造實體化的view
2.sample:
CREATE MATERIALIZED VIEW test_dept
NOCACHE
LOGGING
NOCOMPRESS
NOPARALLEL
BUILD IMMEDIATE
三種refresh 方式
1.強制refresh
REFRESH FORCE ON DEMAND
2.完整refresh
REFRESH COMPLETE
3.快速refresh
REFRESH FAST ON COMMIT
WITH ROWID AS
SELECT * FROM dept;
限制:
不可以有sysdate,rownum,raw,long, group by 等語法
3.create materialized view log
一.sample:
create materialized view log on dept
with sequence,rowid
including new values
二.建立create materialized view log, 資料修改記錄會另存table
可用下列sql 查詢table名稱
select owner, table_name from dba_tables where table_name like 'MLOG%'
以這個例子為例.
資料修改記錄會另存table MLOG$_DEPT
select * from MLOG$_DEPT
沒有留言:
張貼留言