Professional Documents
Culture Documents
Materialized View Samples
Materialized View Samples
Materialized View Samples
SQL> /
Commit complete.
SQL> select count(*) from t5 where id=2;
COUNT(*)
---------1026
In client:
SQL> select count(*) from t5 @ test2_lnk where id=2;
COUNT(*)
---------1026
Commit: Once commit operation is done in server,then mv also updated or
commited automatically
Demand:Cant be updated automatically in MV.At the time of refresh,MV
will be updated.
Complete Refresh (On demand)
SQL> create materialized view t5_c1
2 tablespace tt
3 build immediate
4 refresh complete
5 on demand
6 start with sysdate next sysdate+1
7 with primary key
8 as select count(*) from t5 @ test2_lnk where id=2;
Materialized view created.
SQL>
SQL> select * from t5_c1;
COUNT(*)
---------1026
In server:
1538
SQL> exec dbms_mview.refresh('t5_mf','F');
PL/SQL procedure successfully completed.
SQL> select * from t5_mf;
COUNT(*)
---------2050
Because of on demand , view will be updated after the refresh.