Materialized View

zhouwf0726發表於2019-02-14
Materialized View

--fc1cn
create materialized view log on FC_BJ_PROD_USER.BIN_ITEMS tablespace ADMINISTRATOR;


--create materialized view on fcdw1cn
CREATE SNAPSHOT FC_BJ_PROD_USER.BIN_ITEMS_BAK REFRESH FAST AS SELECT * FROM FC_BJ_PROD_USER.BIN_ITEMS@FC1CN.AMAZON

--create materialized view on fcdw1cn
--exec dbtools_run_as('BOOKER','select * from v$database');

exec dbms_snapshot.refresh(list=>'FC_BJ_PROD_USER.BIN_ITEMS_BAK', method=>'f');


EXEC dbms_refresh.make(name=>'REPADMIN.SNAP_FC1CN',list=>NULL,next_date=>SYSDATE,interval=>'SYSDATE+(2/(24 * 60))',lax=>TRUE);


EXEC dbms_refresh.add (name=>'REPADMIN.SNAP_FC1CN', list=>'FC_BJ_PROD_USER.BIN_ITEMS_BAK', lax => TRUE);


EXEC DBMS_REFRESH.REFRESH('REPADMIN.SNAP_FC1CN');


exec dbms_job.run(...);

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/756652/viewspace-242507/,如需轉載,請註明出處,否則將追究法律責任。

相關文章