OGG 使用pump程序配置複製

2021-06-18 03:07:04 字數 4803 閱讀 5917

[root@source ~]# su - oracle

[oracle@source gg]$ ggsci

oracle goldengate command interpreter for oracle

version 11.2.1.0.1 oggcore_11.2.1.0.1_platforms_120423.0230_fbo

linux, x64, 64bit (optimized), oracle 11g on apr 23 2012 08:32:14

ggsci (source.up.com) 1> info all

program     status      group       lag at chkpt  time since chkpt

manager     stopped                                          

extract     stopped     ext1        00:00:00      03:38:31   

replicat    stopped     rep2        00:00:00      03:38:25   

ggsci (source.up.com) 2> start mgr

manager started.

ggsci (source.up.com) 3> add extract ext3,tranlog, begin now

extract added.

exttrail added.

ggsci (source.up.com) 5> edit params ext3

ggsci (source.up.com) 6> view params ext3

extract ext3

userid gg@source, password gg

table sender.test;

extract added.

rmttrail added.

ggsci (source.up.com) 9> edit params dpump

ggsci (source.up.com) 10> view params dpump

extract dpump

userid gg@source, password gg

rmthost target, mgrport 7809

passthru

table sender.test;

ggsci (source.up.com) 18> start ext3

sending start request to manager ...

extract ext3 starting

ggsci (source.up.com) 19> edit params ext3

ggsci (source.up.com) 20> start ext3

sending start request to manager ...

extract ext3 starting

ggsci (source.up.com) 21> info all

program     status      group       lag at chkpt  time since chkpt

manager     running                                          

extract     running     dpump       00:00:00      00:00:06   

extract     stopped     ext1        00:00:00      03:45:56   

extract     running     ext3        00:04:50      00:00:03   

replicat    stopped     rep2        00:00:00      03:45:50   

目標端配置:

如果以前沒有配置過gg,就需要執行以下步驟

edit params ./globals

ggschema ggate

checkpointtable ggate.checkpoint

dblogin userid gg@target , password gg

add checkpointtable gg.checkpoint

由於以前配置過雙向的複製,所以這及步驟已經配置好了

[oracle@target gg]$ ggsci

oracle goldengate command interpreter for oracle

version 11.2.1.0.1 oggcore_11.2.1.0.1_platforms_120423.0230_fbo

linux, x64, 64bit (optimized), oracle 11g on apr 23 2012 08:32:14

ggsci (target.up.com) 1> info all

program     status      group       lag at chkpt  time since chkpt

manager     stopped                                          

extract     stopped     ext2        00:00:00      03:38:28   

replicat    stopped     rep1        00:00:00      03:38:24   

ggsci (target.up.com) 2> start mgr

manager started.

ggsci (target.up.com) 3> info all

program     status      group       lag at chkpt  time since chkpt

manager     running                                          

extract     stopped     ext2        00:00:00      03:38:33   

replicat    stopped     rep1        00:00:00      03:38:29   

replicat added.

ggsci (target.up.com) 5> edit params rep3

ggsci (target.up.com) 6> view params rep3

replicat rep3

assumetargetdefs

userid gg@target ,password gg

--handlecollisions

map sender.test, target receiver.test;

ggsci (target.up.com) 7> start rep3

sending start request to manager ...

replicat rep3 starting

ggsci (target.up.com) 8> info all

program     status      group       lag at chkpt  time since chkpt

manager     running                                          

extract     stopped     ext2        00:00:00      03:47:01   

replicat    stopped     rep1        00:00:00      03:46:57   

replicat    running     rep3        00:00:00      00:00:03   

配置完畢,現在去做驗證:

先在兩邊分別建立test表

sql> conn sender/oracle

connected.

sql> create table test (id number);

table created.

sql> commit;

commit complete.

target端

sql> conn receiver/oracle

connected.

sql>  create table test (id number);

table created.

sql> commit

2  ;

commit complete.

回到source端操作:

sql> insert into test values (1);

1 row created.

sql> commit;

commit complete.

回到target檢視操作結果

sql> select * from test;

no rows selected

sql> /

no rows selected

sql> /

id ---------- 1

至此使用dpump配置結束

ogg 單向複製的基本配置

在目標資料庫,配置檢查點資訊到目標資料庫表中,ggsci edit params globals checkpointtable ogg.chkpt ggsci add checkpointtable ogg.chkpt配置mgr 源端和目標端都一樣 ggsci edit param mgr por...

OGG複製程序,報ORA 14300

ogg複製程序,報ora 14300 度娘告訴我 物件表為按天的自動分割槽表 partition by range start time interval numtodsinterval 1,day 原因為 當start time的值為null時,然後向分割槽物件表插入資料,資料庫不知道將該條記錄插...

TEMP表空間之Ogg複製程序占用

當日有個變更需求,需要提取資料到壓測環境下,在impdp匯入過程中發現.imported rcs t rcs mer day pmax 0 kb 0 rows processing object type table export table comment processing object ty...