快捷搜索:  as  2018  FtCWSyGV  С˵  test  xxx  Ψһ  w3viyKQx

188金宝搏亚洲体育与真人:Oracle批量刷新远程物化视图的实例



一、创建远程数据库连接

create database link MDM

connect to MDMidentified by mdm

using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = 172.17.11.1)(PORT = 1521))) (CONNEC188金宝搏亚洲体育与真人T_DATA = (SERVER = DEDICATED) (SID= MDM)))';

二、创建两个归天视图:

CREATE MATERIALIZED VIEW 188金宝搏亚洲体育与真人DEPARTMENT

TABLESPACE DAT_ICNFUSING INDEX

TABLESPACE IDX_ICNFREFRESH FORCE ON DEMAND

AS SELECT * FROM MDM.D188金宝搏亚洲体育与真人EPARTMENT@MDM WHERE TREELEVEL = 1 AND STATUS = '0';

CREATE MATERIALIZED VIEW EMPLOYEE

TABLESPACE DAT_ICNFUSING INDEX

TABLESPACE IDX_ICNFREFRESH FORCE ON DEMAND

AS S188金宝搏亚洲体育与真人ELECT * FROM MDM.EMPLOYEE@MDM WHERESTATUS = '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');188金宝搏亚洲体育与真人

--commit;

您可能还会对下面的文章感兴趣: