针对某个表使用高级复制进行数据同步示例(三)

2014-11-24 15:14:08 · 作者: · 浏览: 3
---- ---------- - -
REP BYS1 Y Y
REP BYS2 N Y
REPADMIN@bys2>col gname for a10
REPADMIN@bys2>col dblink for a10
REPADMIN@bys2> select gname ,dblink ,masterdef ,master from dba_repsites where gname='REP';
GNAME DBLINK MA MA
---------- ---------- -- --
REP BYS1 Y Y
REP BYS2 N Y
在源端启动复制
REPADMIN@bys1>execute dbms_repcat.resume_master_activity('rep' ,true);
PL/SQL procedure successfully completed.
################################
6.进行数据同步测试:
DML操作可以同步:
源端:
13:51:48 GP@bys1>select * from test;
no rows selected
13:51:57 GP@bys1>insert into test values(2);
1 row created.
13:52:02 GP@bys1>commit;
Commit complete.
13:52:06 GP@bys1>
select * from test;
X
----------
2
目标端:
13:51:19 GP@bys2>select * from test;
no rows selected
13:51:22 GP@bys2>select * from test;
no rows selected
13:51:52 GP@bys2>select * from test;
X
----------
2
13:52:13 GP@bys2>
DDL操作不能同步:
源端:
13:52:08 GP@bys1>truncate table test;
Table truncated.
13:52:21 GP@bys1>select * from test;
no rows selected
目标端:
13:52:27 GP@bys2>select * from test;
X
----------
2
13:52:28 GP@bys2>select * from test;
X
----------
2