1、创建物化视图:
例如:
create materialized view all_srm_V
select a.pmdnent,a.pmdnsite,a.pmdndocno,a.pmdnseq,a.pmdn040
from pmdn_t a
inner join pmdp_t b on a.pmdnent = b.pmdpent and a.pmdnsite=b.pmdpsite and a.pmdndocno = b.pmdpdocno and a.pmdnseq=b.pmdpseq
where b.pmdp010 is not null ;
2、在实体表中插入数据
insert into pmdn_t values (......);
insert into pmdp_t values (......);
3、手动刷新物化视图的数据
begin
dbms_mview.refresh('all_srm_V','C')
end;
4、查询物化视图中的数据
select * from all_srm_V ;