http://tech.ddvip.com/2008-09/122180687967473.html Oracle物化视图:创建最简单物化视图
--表1:allactive;
connect
pubr/bitservice@datasource
;
drop materialized view log on pubr.allactive;
create materialized view log
on pubr.allactive tablespace logts with primary key;
connect
archive/bitservice@datasource
;
drop materialized view log on archive.allactive;
create materialized view log
on archive.allactive tablespace logts with primary key;
connect ttowb/bitservice;
drop materialized view allactive_tt;
create materialized view allactive_tt
refresh fast
as select ID,CATEGORY,FLOWID,MASTATUS,BASTATUS,APPLYDATETIME,CREATEDATETIME,COMMITDATETIME,BITSPNO,ARCHIVETIME,
DESCRIPTION,OPERTYPE,ISVALID,INVALIDREASON,INVALIDDATETIME,INVALIDPNO,ACTIVETABLENAME,PARENTID,STANID,REALTYPEID,
CORRECTID,to_date('1900-01-01') allactive_rtime from
pubr.allactive@pubrowb
;
drop materialized view allactive_archive;
create materialized view allactive_archive
refresh fast
as select ID,CATEGORY,FLOWID,MASTATUS,BASTATUS,APPLYDATETIME,CREATEDATETIME,COMMITDATETIME,BITSPNO,ARCHIVETIME,
DESCRIPTION,OPERTYPE,ISVALID,INVALIDREASON,INVALIDDATETIME,INVALIDPNO,ACTIVETABLENAME,PARENTID,STANID,REALTYPEID,
CORRECTID,to_date('1900-01-01') allactive_rtime from
archive.allactive@archiveowb
;