orcale materialized views

1. Create a simple materialized views

create materialized view mo_data refresh force on demand as select * from data;

Table names create materialized view created refresh force refresh mode as query;

2.

Refresh materialized view (Refresh): means that when the base table DML operation occurred, materialized views and which way when the base tables are synchronized. Refresh mode, there are two: ON DEMAND and ON COMMIT.

ON DEMAND difference ON COMMIT materialized views and different methods of their refreshing, refers ON DEMAND materialized view refresh when the user needs can be refreshed manually by DBMS_MVIEW.REFRESH the like, may be performed by the refresh timer JOB, i.e. update materialized views, and to ensure consistency of data base table; and ON COMMIT is to say, once the base table with the COMMIT, namely the transaction commits, then immediately refresh immediately update materialized views, and base tables so that the data is consistent.

Base table, can be completed in the usual COMMIT 0.01 seconds, but with the ON COMMIT view, actually to 6 seconds. Reduce speed many times. Effect ON COMMIT view of the base table can be seen.

3. Delete materialized views

drop materialized view mo_data;

drop materialized view table names;

Guess you like

Origin www.cnblogs.com/ww5566/p/11230518.html