接上一篇 ddl filter with ddl paramster
测试二:ddl 过滤操作ddl dml双向复制开启,所以测试用户可以在任意一个节点创建即可同步到对端
建测试用表同样也是可以同步到对端,建测试用表注意要有主键
此时node1,node2 执行
su- oracle
cd $GGHOME
ggsci
add schematrandata tiger
调整参数后重启。调整如下:
node1:
GGSCI (node1) 1> view params eddl1
extract eddl1
userid ogg@orcc1,password ogg
TRANLOGOPTIONS EXCLUDEUSER ogg
--userid ogg, password ogg
DDL INCLUDE ALLexclude optype drop objname tiger.*
ddloptions report
ddloptions addtrandata
ddloptions getreplicates
exttrail ./dirdat/aa
table student.*;
table tiger.*;
GGSCI (node1) 2> view params pddl1
extract pddl1
userid ogg, password ogg
rmthost node2, mgrport 7809
rmttrail ./dirdat/bb
table student.*;
table tiger.*;
GGSCI (node1) 3> view params rddl2
replicat rddl2
userid ogg,password ogg
ddl include allexclude optype drop objname tiger.*
ddloptions report
ddloptions updatemetadata
discardfile dirrpt\rddl.dsc, purge
map student.*, target student.*;
map tiger.*, target tiger.*;
GGSCI (node1) 4>
node2:
GGSCI (node2) 2> view params eddl2
extract eddl2
userid ogg,password ogg
TRANLOGOPTIONS EXCLUDEUSER ogg
DDL INCLUDE ALLexclude optype drop objname tiger.*
ddloptions report
ddloptions addtrandata
ddloptions getreplicates
exttrail ./dirdat/cc
table student.*;
table tiger.*;
GGSCI (node2) 3> view params pddl2
extractpddl2
userid ogg, password ogg
rmthost node1, mgrport 7809
rmttrail ./dirdat/dd
table student.*;
table tiger.*;
GGSCI (node2) 4> view params rddl1
replicat rddl1
userid ogg, password ogg
ddl include allexclude optype drop objname tiger.*
ddloptions report
ddloptions updatemetadata
discardfile dirrpt\rddl.dsc, purge
map student.*, target student.*;
map tiger.*, target tiger.*;
GGSCI (node2) 5>
node1上创建测试表,应为是ddl,dml双向复制,node2 自动同步
node1:
SQL> show user
USER is "TIGER"
SQL> select tname from tab;
no rows selected
SQL> create table test (id int primary key);
Table created.
SQL> c/test/tab
1* create table tab (id int primary key)
SQL> /
node2:
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
TEST
TAB
情景一:
node2 删除tab
SQL> drop table tab;
Table dropped.
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
TEST
node1 验证:
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
TEST
TAB
日志:
2017-04-01 11:05:51INFO OGG-01487Oracle GoldenGate Capture for Oracle, eddl2.prm:DDL found, operation , start SCN , commit SCN instance , DDL seqno , marker seqno .
2017-04-01 11:05:51INFO OGG-00488Oracle GoldenGate Capture for Oracle, eddl2.prm:DDL operation excluded , optype , objtype , objowner , objname .
2017-04-01 11:10:55INFO OGG-00987Oracle GoldenGate Command Interpreter for Oracle:GGSCI command (oracle): info all.
情景二:
node1 删除test:
SQL> /
TABLE_NAME
------------------------------
TEST
TAB
SQL> drop table test;
Table dropped.
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
TAB
node2 验证:
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
TEST
日志:
2017-04-01 11:07:57INFO OGG-01487Oracle GoldenGate Capture for Oracle, eddl1.prm:DDL found, operation , start SCN , commit SCN instance , DDL seqno , marker seqno .
2017-04-01 11:07:57INFO OGG-00488Oracle GoldenGate Capture for Oracle, eddl1.prm:DDL operation excluded , optype , objtype , objowner , objname .
情景三:
node1,node2任意一个节点建表测试,create 未在exclude范围内,应该正常复制
node1:
SQL> show user;
USER is "TIGER"
SQL> create table t1 (id int primary key);
node2:
SQL> show user;
USER is "TIGER"
SQL> create table t2 (id int primary key);
Table created.
node1:
SQL> select tname from tab;
TNAME
------------------------------
T1
T2
node2:
SQL> select tname from tab;
TNAME
------------------------------
T1
T2
页:
[1]