目标:
主库的 hr.t1 表同步到备库 scott.t1_mv_bak 表
准备工作:
提前编辑备库的 tnsnames.ora,添加 pdbprod1 连接服务名
主库
conn system
create table hr.t1 as select * from dba_objects;
conn hr
备库
grant create public database link ,drop public database link to scott;
conn scott
create public database link pdbprod1_hr connect to hr identified by hr using
'pdbprod1';
测试 dblink 是否创建成功
select * from t1@pdbprod1_hr;
conn system
grant create materialized view to scott;
conn scott
create materialized view mv_hr_t1 refresh force on demand start with sysdate
next sysdate+1/1440 with rowid enable query rewrite as select * from
t1@pdbprod1_hr;
评论