如何进行数据同步

来源:互联网 发布:php java混合 编辑:程序博客网 时间:2024/05/16 09:50

创建数据库的链接

create database link dblink_test connect to 需要链接的数据库的名字 identified by "密码" using '这个链接的别名'

创建物化视图用于同步数据

create  materialized view test--test是同步过来的实体表的名字refresh force --如果可以快速刷新则进行快速刷新,否则完全刷新 on demand --按照指定方式刷新 start with to_date('23-10-2014 05:10:00', 'dd-mm-yyyy hh24:mi:ss') --开始同步时间next sysdate+1--同步时间间隔as select * from test@dblink_test;  --test是链接数据库中的表名

附录:删除物化视图

drop materialized view test


0 0