做oracle的同構的ogg實驗

2021-06-19 22:26:07 字數 4826 閱讀 3215

oracle同構 ogg實驗

源端:[oracle@ora11ogg1 11.2.0]$ ./ggsci

oracle goldengate command interpreter for oracle

version 11.2.1.0.1 oggcore_11.2.1.0.1_platforms_120423.0230_fbo

linux, x86, 32bit (optimized), oracle 11g on apr 23 2012 08:09:25

ggsci (ora11ogg1) 1> info all

program     status      group       lag at chkpt  time since chkpt

manager     stopped                                           

extract     stopped     einiss      00:00:00      22:32:54    

ggsci (ora11ogg1) 2> start mgr

manager started.

ggsci (ora11ogg1) 3> start extract *

sending start request to manager ...

extract einiss starting

ggsci (ora11ogg1) 4> view params mgr

port 7809

ggsci (ora11ogg1) 5> view params einiss

extract einiss

setenv(oracle_sid=orcl1,nls_lang=american_america.zhs16gbk)

userid ogg,password ogg

rmthost 192.168.56.122,mgrport 7809

rmttrail /u01/ggs/11.2.0/dirdat/lt

table scott.test1;

ggsci (ora11ogg1) 6> 

目標端:

last login: thu dec 26 19:21:10 2013 from 192.168.56.1

[root@ora11ogg2 ~]# su - oracle

[oracle@ora11ogg2 ~]$ cd /u01/ggs/11.2.0/

[oracle@ora11ogg2 11.2.0]$ ./ggsci

oracle goldengate command interpreter for oracle

version 11.2.1.0.1 oggcore_11.2.1.0.1_platforms_120423.0230_fbo

linux, x86, 32bit (optimized), oracle 11g on apr 23 2012 08:09:25

ggsci (ora11ogg2) 1> info all

program     status      group       lag at chkpt  time since chkpt

manager     stopped                                           

replicat    stopped     rep1        00:00:00      22:43:09    

ggsci (ora11ogg2) 2> start mgr

manager started.

ggsci (ora11ogg2) 3> start replicat rep1

sending start request to manager ...

replicat rep1 starting

ggsci (ora11ogg2) 4> view params mgr

port 7809

ggsci (ora11ogg2) 5> view params rep1

replicat rep1

setenv(oracle_sid=orcl1,nls_lang=american_america.zhs16gbk)

userid ogg,password ogg

handlecollisions

assumetargetdefs

map scott.test1, target scott.test1;

在源端資料庫上insert 

last login: wed dec 25 20:00:27 2013 from 192.168.56.1

[root@ora11ogg1 ~]# su - oracle

[oracle@ora11ogg1 ~]$ sqlplus / as sysdba

sql*plus: release 11.2.0.1.0 production on thu dec 26 19:17:22 2013

connected to an idle instance.

sql> startup

oracle instance started.

total system global area  422670336 bytes

fixed size                  1336960 bytes

variable size             301992320 bytes

database buffers          113246208 bytes

redo buffers                6094848 bytes

database mounted.

database opened.

sql> 

conn 

enter user-name: 

error:

ora-01017: invalid username/password; logon denied

warning: you are no longer connected to oracle.

sql> conn scott/tiger

connected.

sql> select count(*) from test1;

count(*)

----------

27sql> insert into test1(empno,ename) values(100,'test1');

1 row created.

sql> commit;

commit complete.

sql> !

[oracle@ora11ogg1 ~]$ echo $oracle_sid

orcl1

[oracle@ora11ogg1 ~]$ hostname

ora11ogg1

[oracle@ora11ogg1 ~]$ 

目標端實現了資料的複製:

[oracle@ora11ogg2 ~]$ 

[oracle@ora11ogg2 ~]$ sqlplus / as sysdba

sql*plus: release 11.2.0.1.0 production on thu dec 26 19:42:18 2013

connected to:

oracle database 11g enterprise edition release 11.2.0.1.0 - production

sql> conn scott/tiger

connected.

sql> select count(*) from test1;

count(*)

----------

27sql> select count(*) from test1;

count(*)

----------

28sql> select empno,ename from test1;

empno ename

---------- ----------

1121 11

109 df

126 oggok

100 test1

7369 smith

7499 allen

7521 ward

7566 jones

7654 martin

7698 blake

7782 clark

empno ename

---------- ----------

7788 scott

7839 king

7844 turner

7876 adams

7900 james

7902 ford

7934 miller

110 fffi121

8 fffi121

1008 fffi121

1 firsto

empno ename

---------- ----------

101 firsto

11 sdfsd

1212 dfdeee

1001 sdfdf

211 dfd

112 121

28 rows selected.

sql> !

[oracle@ora11ogg2 ~]$ echo $oracle_sid

ogg2

[oracle@ora11ogg2 ~]$ hostname

ora11ogg2

[oracle@ora11ogg2 ~]$ 

通過本次實驗,達到了ogg資料複製的功能,當然這只是最簡單的功能,下次進行複雜些的實驗。以上!

ORACLE 之間的OGG配置

ogg source和target環境 souce source端 作業系統版本 linux 2.6.9 89.el x86 64 hostname dg1 資料庫版本 10.2.0.1 64bit ogg版本 fbo ggs linux x64 ora10g 64bit.tar rac資料庫名 w...

ogg mysql的原理 OGG原理

ogg的資料整合技術實施主要含3程序 資料抽取程序 傳輸程序 應用程序 2個檔案 源資料庫 目標資料庫 1.出庫 投遞 入庫 啟動ogg程序 2.資料庫啟動歸檔模式sqlplus assysdbaarchiveloglist 3.建立gg使用者 4.oracle配置增量日誌 alterdatabas...

OGG中add trandata的含義

在配置ogg時,需要給同步的表新增補充日誌,在ggsci命令列執行 add trandata user.table 該命令實際上包含兩層含義 1 table有pk或uk 則目標端能準確依據pk或uk找到源端dml更新的資料,從而在目標端同步。2 table沒有pk和uk,則目標端只能依據該table...