一、创建远程数据库连接
create database link MDM connect to MDM identified by mdm using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = 172.17.11.1)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SID= MDM)))';
CREATE MATERIALIZED VIEW DEPARTMENT TABLESPACE DAT_ICNF USING INDEX TABLESPACE IDX_ICNF REFRESH FORCE ON DEMAND AS SELECT * FROM MDM.DEPARTMENT@MDM WHERE TREELEVEL = 1 AND STATUS = '0'; CREATE MATERIALIZED VIEW EMPLOYEE TABLESPACE DAT_ICNF USING INDEX TABLESPACE IDX_ICNF REFRESH FORCE ON DEMAND AS SELECT * FROM MDM.EMPLOYEE@MDM WHERE STATUS = '0';
execute DBMS_REFRESH.MAKE(NAME=>'MVTAG', LIST=>'DEPARTMENT,EMPLOYEE', NEXT_DATE=>SYSDATE, INTERVAL=>'/*24:HR*/ SYSDATE + 5/(60*24)'); commit;
--execute dbms_refresh.destroy('MVTAG'); --commit;
邀月注:本文版权由邀月和CSDN共同所有,转载请注明出处。
助人等于自助! [email protected]