MANAGER RUNNING
3.3 配置SOURCE DB的复制队列
连接到数据库,测试连接:
GGSCI (redhat6) 5> dblogin userid ggate@hjj,password ggate
Successfully logged into database.
增加一个抽取extract:
GGSCI (redhat6) 6> add extract ext1,tranlog,begin now
EXTRACT added.
GGSCI (redhat6) 7> add exttrail /u01/ogg/dirdat/lt,extract ext1
EXTTRAIL added.
GGSCI (redhat6) 8> edit params ext1
extract ext1
userid ggate@hjj,password ggate
rmthost redhat6,mgrport 7809
rmttrail /u01/ogg/dirdat/lt
ddl include mapped objname source.*;
table source.*;
GGSCI (redhat6) 2> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXT1 00:00:00 00:00:10
3.4 配置TARGET DB的同步队列
GGSCI (redhat6) 2> edit params ./GLOBAL
GGSCHEMA ggate
CHECKPOINTTABLE ggate.checkpoint
GGSCI (redhat6) 3> dblogin userid ggate@hjj,password ggate
Successfully logged into database.
GGSCI (redhat6) 4> add checkpointtable ggate.checkpoint
Successfully created checkpoint table ggate.checkpoint.
创建同步队列
GGSCI (redhat6) 1> add replicat rep1,exttrail /u01/ogg/dirdat/lt,checkpointtable ggate.checkpoint
REPLICAT added.
GGSCI (redhat6) 5> edit params rep1
replicat rep1
ASSUMETARGETDEFS
userid ggate@hjj,password ggate
discardfile /u01/ogg/dirdat/rep1_discard.txt,append, megabytes 10
DDL
map source.*, target targer.*;
3.5 开启同步
(1)SOURCE端:
GGSCI (redhat6) 10> start extract ext1
Sending START request to MANAGER ...
EXTRACT EXT1 starting
GGSCI (redhat6) 11> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXT1 00:07:38 00:00:00
(2)TARGET端:
GGSCI (redhat6) 3> start replicat rep1
Sending START request to MANAGER ...
REPLICAT REP1 starting
GGSCI (redhat6) 4> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXT1 00:00:00 00:00:05
REPLICAT RUNNING REP1 00:00:00 00:00:01
3.6 测试数据复制
(1)SOURCE DB:
[oracle@redhat6 ogg]$ sqlplus source/oracle
SQL*Plus: Release 11.2.0.3.0 Production on Mon Dec 9 20:09:11 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create table hjj as select * from sys.all_users;
Table created.
(2)TARGET DB 查看数据同步情况:
[oracle@redhat6 ogg]$ sqlplus targer/oracle
SQL*Plus: Release 11.2.0.3.0 Production on Mon Dec 9 20:09:26 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select count(*) from hjj;
COUNT(*)
----------
12
在SOURCE端执行:
SQL> insert into hjj select * from sys.all_users;
12 rows created.
SQL> commit;
Commit complete.
在TARGET查看同步情况
SQL> select count(*) from hjj;
COUNT(*)
----------
24
Oracle到Oracle的单向复制配置完成。