Golde*Gate重要进程介绍:
1、Ma*a*er管理进程在两端开启,监控和重启其他进程;分配数据存储和报告错误及事件;
2、Extract进程从日志中抓取并传输到tar*et端事务数据;
3、Server Collector进程在tar*et(接受)端接受数据并写入tra*l文件;
4、Repl*cat进程读取tra*l文件,并应用到tra*et数据库;
5、tra*l文件时**自己抓捕信息的文件,是一个OS文件,存放在./d*rdat/下,以*00000命名,N顺序1,2,3&hell*p;此文件用完可配置参数自动删除。
&*bsp;
&*bsp;
1. 数据库准备情况
host*ame:o**1
I*地址:192.168.100.133
数据库:10.2.0.5.0 64 b*t
SID: super
操作系统版本:redhat5.5 64 b*t
o**版本:o**112101_fbo_**s_L**ux_x64_ora11*_64b*t.z*p
&*bsp;
host*ame:o**2
I*地址:192.168.100.130
数据库:11.2.0.4.0 64 b*t
SID: test
操作系统版本:redhat5.5 64 b*t
o**版本:o**112101_fbo_**s_L**ux_x64_ora11*_64b*t.z*p
&*bsp;
2. 创建用户、下载OGG软件并解压安装
[ *>root@o**1 ~ *>] *># mkd*r/ *>o** *>[ *>root@o**1 ~ *>] *># useradd- *>* o**stall- *>G dba **s *>[ *>root@o**1 ~ *>] *># passwd **s *>[ *>root@o**1 ~ *>] *># su- *>**s *>[ *>**s@o**1 ~ *>] *>$ *d u*d *>= *>1001 *>(**s) **d= *>1000 *>(o**stall) *roups= *>1000 *>(o**stall),1001 *>(dba) *>[ *>**s@o**1 ~ *>] *>$ex*t *>lo*out *>[ *>root@o**1 ~ *>] *># chow*- *>R **s:o**stall/ *>o** *>[ *>root@o**1 o** *>] *># u*z*p o**112101_fbo_**s_L**ux_x64_ora11*_64b*t.z*p *>[ *>root@o**1 o** *>] *># tar xvf fbo_**s_L**ux_x64_ora11*_64b*t.tar- *>C/ *>o** *>[ *>root@o**1 o** *>] *># chow*- *>R **s:o**stall/ *>o**
&*bsp;
[ *>root@o**2 ~ *>] *># useradd- *>* o**stall- *>G dba **s *>[ *>root@o**2 ~ *>] *># passwd **s *>[ *>root@o**2 ~ *>] *># mkd*r/ *>o** *>[ *>root@o**2 ~ *>] *># chow*- *>R **s:o**stall/ *>o** *>[ *>root@o**2 o** *>] *># u*z*p o**112101_fbo_**s_L**ux_x64_ora11*_64b*t.z*p *>[ *>root@o**2 o** *>] *># tar xvf fbo_**s_L**ux_x64_ora11*_64b*t.tar- *>C/ *>o** *>[ *>root@o**2 o** *>] *># chow*- *>R **s:o**stall/ *>o**
&*bsp;
3. 准备OGG环境变量
$ v* /home/**s/.bash_prof*le
&*bsp;
export *ATH export ORACLE_BASE *>=/u01 export ORACLE_HOME *>=$ORACLE_BASE/product/10.2 *>.0 *>export ORACLE_SID *>=super export *ATH *>=$*ATH:$HOME/b**:$ORACLE_HOME/b** export LD_LIBRARY_*ATH *>=$ORACLE_HOME/l*b:/l*b:/usr/l*b:/o**:/usr/local/l*b:/usr/*11R6/l*b export LD_LIBRARY_*ATH_64 *>=$ORACLE_HOME/l*b
&*bsp;
&*bsp;
$ v* /home/**s/.bash_prof*le
export *ATH export ORACLE_BASE *>=/u01 export ORACLE_HOME *>=$ORACLE_BASE *>/product/11.2 *>.0 *>export ORACLE_SID *>=test export *ATH *>=$*ATH *>:$HOME *>/b**:$ORACLE_HOME *>/b** export LD_LIBRARY_*ATH *>=$ORACLE_HOME *>/l*b:/l*b:/usr/l*b:/o**
&*bsp;
4. 配置日志模式
sqlplus/ *>as *>sysdba *>select *> lo*_mode,suppleme*tal_lo*_data_m**,force_lo*****from *> v$database *>; LOG_MODE SU**LEME *>FOR *>-- *>---------- -------- --- *> NOARCHIVELOG NO NO
&*bsp;
shutdow* *>*mmed*ate; startup mou*t; *>alter *>database *>arch*velo*; *>alter *>database *>ope* *>; *>alter *> systemset *> lo*_arch*ve_dest_1= *>' *>locat*o*=/u01/arch*ve *>' *> scope= *>both;
&*bsp;
alter *>database *>add *> suppleme*tallo* *>data; *>alter *>database *> force lo*****;
&*bsp;
SQL&*t; *>select *> lo*_mode,suppleme*tal_lo*_data_m**,force_lo*****from *> v$database *>; LOG_MODE SU**LEME *>FOR *>-- *>---------- -------- --- *> ARCHIVELOG YES YES
&*bsp;
5. 创建Golde*Gate用户帐号
su- *>oracle sqlplus *>/ *>*olo* co** *>/ *>as *>sysdba; *>create *> tablespace o** dataf*le' *>/u01/oradata/super/o**.dbf *>' *> s*ze 10m autoexte*do* *>*ext *>10m; *>create *>user *> **s *de*t*f*edby *> **sdefault *> tablespace o**temporary *> tablespaceTEM* *> quota u*l*m*tedo* *>o**; *>*ra*t *> co**ect,resourceto *>**s; *>*ra*t *>create *> sess*o*,alter *> sess*o*to *>**s; *>*ra*t *>select *>a*y *> d*ct*o*ary,select *>a*y *>table *>to *>**s; *>*ra*t *>alter *>a*y *>table *>to *>**s; *>*ra*t *> flashbacka*y *>table *>to *>**s; *>*ra*t *>execute *>o* *> dbms_flashbackto *>**s; *>或直接*ra*t dba *>to **s; *>
&*bsp;
su- *>oracle sqlplus *>/ *>*olo* co** *>/ *>as *>sysdba; *>create *> tablespace o** dataf*le' *>/u01/oradata/test/o**.dbf *>' *> s*ze 10m autoexte*do* *>*ext *>10m; *>create *>user *> **s *de*t*f*edby *> **sdefault *> tablespace o**temporary *> tablespaceTEM* *> quota u*l*m*tedo* *>o**; *>*ra*t *> co**ect,resourceto *>**s; *>*ra*t *>create *> sess*o*,alter *> sess*o*to *>**s; *>*ra*t *>select *>a*y *> d*ct*o*ary,select *>a*y *>table *>to *>**s; *>*ra*t *>alter *>a*y *>table *>to *>**s; *>*ra*t *> flashbacka*y *>table *>to *>**s; *>*ra*t *>execute *>o* *> dbms_flashbackto *>**s; *>*ra*t *>**sert *>a*y *>table *>to *>**s; *>*ra*t *>delete *>a*y *>table *>to *>**s; *>*ra*t *>update *>a*y *>table *>to *>**s; *>或直接*ra*t dba *>to **s; *>
&*bsp;
6. 安装Golde*Gate软件
[ *>root@o**1 o** *>] *>$ su- *>**s *>[ *>**s@o**1 o** *>] *>$ cd/ *>o** *>[ *>**s@o**1 o** *>] *>$ ./ *>**sc* *>#发现**sc*进不去 *> ./ *>**sc*: errorwh*le *> load*** shared l*brar*es: l*b**z11.so: ca**otope* *> shared objectf*le *>: No suchf*le *>or *>d*rectory *>[ *>**s@o**1 o** *>] *>$ ldd **sc* *>#检查依赖包,发现缺少两个11*的包 *> l*bdl.so.2 *>=&*t; *>/ *>l*b64/ *>l*bdl.so.2 *> (0x0000003d9b600000 *>) l*b**lo*.so *>=&*t; *>/ *>o**/ *>l*b**lo*.so (0x00002b8bd05ca000 *>) l*b**repo.so *>=&*t; *>/ *>o**/ *>l*b**repo.so (0x00002b8bd07ff000 *>) l*bdb *>- *>5.2 *>.so=&*t; *>/ *>o**/ *>l*bdb- *>5.2 *>.so (0x00002b8bd0954000 *>) l*b*cu*18*.so. *>38 *>=&*t; *>/ *>o**/ *>l*b*cu*18*.so.38 *> (0x00002b8bd0bf5000 *>) l*b*cuuc.so. *>38 *>=&*t; *>/ *>o**/ *>l*b*cuuc.so.38 *> (0x00002b8bd0f55000 *>) l*b*cudata.so. *>38 *>=&*t; *>/ *>o**/ *>l*b*cudata.so.38 *> (0x00002b8bd128f000 *>) l*bpthread.so. *>0 *>=&*t; *>/ *>l*b64/ *>l*bpthread.so.0 *> (0x0000003d9ba00000 *>) l*bxerces *>- *>c.so.28 *>=&*t; *>/ *>o**/ *>l*bxerces- *>c.so.28 *> (0x00002b8bd226b000 *>) l*ba*tlr3c.so *>=&*t; *>/ *>o**/ *>l*ba*tlr3c.so (0x00002b8bd2783000 *>) *>l*b**z11.so *>=&*t; *ot fou*d l*bcl*tsh.so. *>11.1 *> =&*t; *ot*> fou*d *> l*bstdc++ *>.so.6 *>=&*t; *>/ *>usr/ *>l*b64/ *>l*bstdc++ *>.so.6 *> (0x0000003dad400000 *>) l*bm.so. *>6 *>=&*t; *>/ *>l*b64/ *>l*bm.so.6 *> (0x0000003d9b200000 *>) l*b*cc_s.so. *>1 *>=&*t; *>/ *>l*b64/ *>l*b*cc_s.so.1 *> (0x0000003daa400000 *>) l*bc.so. *>6 *>=&*t; *>/ *>l*b64/ *>l*bc.so.6 *> (0x0000003d9ae00000 *>) *>/ *>l*b64/ *>ld- *>l**ux- *>x86- *>64 *>.so.2 *> (0x0000003d9aa00000 *>) *>在服务器中找不到11*的包: *>[ *>root@o**1 o** *>] *># f**d/ *>- *>*ame l*b**z11.so *>[ *>root@o**1 o** *>] *># f**d/ *>- *>*ame l*b**z10.so *>/ *>u01/ *>product/ *>10.2 *>.0 *>/ *>l*b/ *>l*b**z10.so *>/ *>u01/ *>product/ *>10.2 *>.0 *>/ *>l*b32/ *>l*b**z10.so *>[ *>root@o**1 o** *>] *># f**d/ *>- *>*ame l*bcl*tsh.so.11.1 *>[ *>root@o**1 o** *>] *># f**d/ *>- *>*ame l*bcl*tsh.so.10.1 *>/ *>u01/ *>product/ *>10.2 *>.0 *>/ *>l*b/ *>l*bcl*tsh.so.10.1 *>/ *>u01/ *>product/ *>10.2 *>.0 *>/ *>l*b32/ *>l*bcl*tsh.so.10.1 *>此时需要做两个软连接: *>[ *>oracle@o**1 l*b *>] *>$ l*- *>s/ *>u01/ *>product/ *>10.2 *>.0 *>/ *>l*b/ *>l*b**z10.so l*b**z11.so *>[ *>oracle@o**1 l*b *>] *>$ l*- *>s/ *>u01/ *>product/ *>10.2 *>.0 *>/ *>l*b/ *>l*bcl*tsh.so.10.1 *> l*bcl*tsh.so.11.1 *>
&*bsp;
[ *>root@o**1 o** *>] *># su- *>**s *>[ *>**s@o**1 ~ *>] *>$ cd/ *>o** *>[ *>**s@o**1 o** *>] *>$ ./ *>**sc* Oracle Golde*Gate Comma*d I*terpreter *>for *>Oracle Vers*o* *>11.2 *>.1.0 *>.1 *> OGGCORE_11.2.1 *>.0 *>.1_*LATFORMS_120423.0230_FBO L**ux, x64, 64 *>b*t *> (opt*m*zed), Oracle 11*o* *> Apr23 *>2012 *>08 *>:32 *>:14 *>Copyr**ht (C) *>1995 *>,2012 *>, Oraclea*d/or *> *ts aff*l*ates.All *>r**hts reserved. GGSCI (o**1) *>1 *>&*t; *>create *>subd*rs Creat*** subd*rector*es u*der *>curre*t *> d*rectory/ *>o** *arameter f*les *>/ *>o**/ *>d*rprm: alreadyex*sts *>Report f*les *>/ *>o**/ *>d*rrpt: created *>Checkpo**t *> f*les/ *>o**/ *>d*rchk: created *rocess status f*les *>/ *>o**/ *>d*rpcs: created SQL scr*pt f*les *>/ *>o**/ *>d*rsql: created *>Database *> def***t*o*s f*les/ *>o**/ *>d*rdef: created Extract data f*les *>/ *>o**/ *>d*rdat: created *>Temporary *> f*les/ *>o**/ *>d*rtmp: created Stdout f*les *>/ *>o**/ *>d*rout: created
&*bsp;
[ *>root@o**2 o** *>] *># su- *>**s *>[ *>**s@o**2 ~ *>] *>$ cd/ *>o** *>[ *>**s@o**2 o** *>] *>$ ./ *>**sc* Oracle Golde*Gate Comma*d I*terpreter *>for *>Oracle Vers*o* *>11.2 *>.1.0 *>.1 *> OGGCORE_11.2.1 *>.0 *>.1_*LATFORMS_120423.0230_FBO L**ux, x64, 64 *>b*t *> (opt*m*zed), Oracle 11*o* *> Apr23 *>2012 *>08 *>:32 *>:14 *>Copyr**ht (C) *>1995 *>,2012 *>, Oraclea*d/or *> *ts aff*l*ates.All *>r**hts reserved. GGSCI (o**2) *>1 *>&*t; *>create *>subd*rs Creat*** subd*rector*es u*der *>curre*t *> d*rectory/ *>o** *arameter f*les *>/ *>o**/ *>d*rprm: alreadyex*sts *>Report f*les *>/ *>o**/ *>d*rrpt: created *>Checkpo**t *> f*les/ *>o**/ *>d*rchk: created *rocess status f*les *>/ *>o**/ *>d*rpcs: created SQL scr*pt f*les *>/ *>o**/ *>d*rsql: created *>Database *> def***t*o*s f*les/ *>o**/ *>d*rdef: created Extract data f*les *>/ *>o**/ *>d*rdat: created *>Temporary *> f*les/ *>o**/ *>d*rtmp: created Stdout f*les *>/ *>o**/ *>d*rout: created
&*bsp;
SQL&*t; *> co** scott/ *>t**er Co**ected. SQL *>&*t; *>create *>table *> test1 (*d*umber *>); *>Table *>created. SQL *>&*t; *>create *>table *> test2 (*amevarchar2 *>(20 *>)); *>Table *>created. SQL *>&*t; *>**sert *>**to *> test1values *> (1 *>); *>1 *>row created. SQL *>&*t; *>**sert *>**to *> test1values *> (2 *>); *>1 *>row created. SQL *>&*t; *>**sert *>**to *> test1values *> (3 *>); *>1 *>row created. SQL *>&*t; *>comm*t *>; *>Comm*t *>complete. SQL *>&*t; *>alter *>table *> test1add *> co*stra**ts pk_test1pr*mary *>key *>(*d); *>Table *>altered. SQL *>&*t; *>alter *>table *> test2add *> co*stra**ts pk_test2pr*mary *>key *>(*ame); *>Table *>altered. SQL *>&*t; *>**sert *>**to *> test2values *>(' *>x*j**p*** *>' *>); *>1 *>row created. SQL *>&*t; *>**sert *>**to *> test2values *>(' *>l*keq*a** *>' *>); *>1 *>row created. SQL *>&*t; *>**sert *>**to *> test2values *>(' *>batma* *>' *>); *>1 *>row created. SQL *>&*t; *>comm*t *>; *>Comm*t *> complete.
&*bsp;
&*bsp;
二、 Golde*Gate DML同步源端配置
1. 源MGR进程
ed*t params m*r
port7809 *>dy*am*cportl*st *>7800 *>- *>7899 *>autorestart extract *>* *>,retr*es5 *>,wa*tm**utes2 *>pur*eoldextracts . *>/ *>d*rdat/* *>,usecheckpo**ts,m**keepdays 7 la*reporthours 1 la***fom**utes 30 la*cr*t*calm**utes 45 *>
&*bsp;
GGSCI (o**1) 3&*t; start m*r
Ma*a*er started.
&*bsp;
GGSCI (o**1) 4&*t; **fo all
*ro*ram&*bsp;&*bsp;&*bsp;&*bsp; Status&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; Group&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; La* at Chkpt&*bsp; T*me S**ce Chkpt
MANAGER&*bsp;&*bsp;&*bsp;&*bsp; RUNNING&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; &*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;
&*bsp;
2. 配置Extract进程组
GGSCI (o**1) 6&*t; v*ew param test_ext
extract test_ext dy*am*cresolut*o* sete*v (NLS_LANG *>= *>AMERICAN_AMERICA.ZHS16GBK) user*d **s,password **s exttra*l *>/ *>o**/ *>d*rdat/ *>te *>table *> scott.* *>;
&*bsp;
GGSCI (o**1) 7&*t; add extract test_ext,tra*lo*,be*** *ow
E*TRACT added.
&*bsp;
GGSCI (o**1) 8&*t; add exttra*l /o**/d*rdat/te,extract test_ext
E*TTRAIL added.
&*bsp;
GGSCI (o**1) 9&*t; **fo all
*ro*ram&*bsp;&*bsp;&*bsp;&*bsp; Status&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; Group&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; &*bsp;La* at Chkpt&*bsp; T*me S**ce Chkpt
MANAGER&*bsp;&*bsp;&*bsp;&*bsp; STO**ED&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;
E*TRACT&*bsp;&*bsp;&*bsp;&*bsp; STO**ED&*bsp;&*bsp;&*bsp;&*bsp; TEST_E*T&*bsp;&*bsp;&*bsp; 00:00:00&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; 00:00:39&*bsp;&*bsp;&*bsp;
&*bsp;
&*bsp;
GGSCI (o**1) 16&*t; start extract test_ext
Se*d*** START request to MANAGER ...
E*TRACT TEST_E*T start***
&*bsp;
GGSCI (o**1) 17&*t; **fo all
*ro*ram&*bsp;&*bsp;&*bsp;&*bsp; Status&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; Group&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; La* at Chkpt&*bsp; T*me S**ce Chkpt
MANAGER&*bsp;&*bsp;&*bsp;&*bsp; RUNNING&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;
E*TRACT&*bsp;&*bsp;&*bsp;&*bsp; RUNNING&*bsp;&*bsp;&*bsp;&*bsp; TEST_E*T&*bsp;&*bsp;&*bsp; 00:03:07&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; 00:00:00&*bsp;&*bsp;&*bsp;
&*bsp;
[root@o**1 d*rdat]# pwd
/o**/d*rdat
[root@o**1 d*rdat]# ll
总计 4
-rw-rw-rw- 1 **s o**stall 988 07-08 21:09 te000000
&*bsp;
3. 配置*ump进程组
ed*t params test_p
extract test_p dy*am*cresolut*o* passthru rmthost *>192.168 *>.100.130 *>,m*rport7809 *>,compress rmttra*l *>/ *>o**/ *>d*rdat/ *>tp *>table *> scott.* *>;
&*bsp;
GGSCI (o**1) 21&*t; add extract test_p,exttra*lsource /o**/d*rdat/te
E*TRACT added.
&*bsp;
GGSCI (o**1) 22&*t; add rmttra*l /o**/d*rdat/tp,extract test_p
RMTTRAIL added.
&*bsp;
GGSCI (o**1) 23&*t; start extract test_p
Se*d*** START request to MANAGER ...
E*TRACT TEST_* start***
&*bsp;
GGSCI (o**1) 24&*t; **fo all
*ro*ram&*bsp;&*bsp;&*bsp;&*bsp; Status&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; Group&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; &*bsp;La* at Chkpt&*bsp; T*me S**ce Chkpt
MANAGER&*bsp;&*bsp;&*bsp;&*bsp; RUNNING&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;
E*TRACT&*bsp;&*bsp;&*bsp;&*bsp; RUNNING&*bsp;&*bsp;&*bsp;&*bsp; TEST_E*T&*bsp;&*bsp;&*bsp; 00:00:00&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; 00:00:02&*bsp;&*bsp;&*bsp;
E*TRACT&*bsp;&*bsp;&*bsp;&*bsp; RUNNING&*bsp;&*bsp;&*bsp;&*bsp; TEST_*&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; 00:00:00&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; 00:00:58&*bsp;&*bsp;&*bsp;
&*bsp;
&*bsp;
三、 Golde*Gate DML同步目标端配置
1. 目标端MGR进程
GGSCI (o**2) 1&*t; v*ew param m*r
port7809 *>dy*am*cportl*st *>7800 *>- *>7899 *>pur*eoldextracts *>/ *>o**/ *>d*rdat/* *>, usecheckpo**ts, m**keepdays 3 *>
&*bsp;
GGSCI (o**2) 2&*t; start m*r
Ma*a*er started.
&*bsp;
GGSCI (o**2) 3&*t; **fo all
*ro*ram&*bsp;&*bsp;&*bsp;&*bsp; Status&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; Group&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; La* at Chkpt&*bsp; T*me S**ce Chkpt
MANAGER&*bsp;&*bsp;&*bsp;&*bsp; RUNNING&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;
&*bsp;
GGSCI (o**2) 4&*t; ex*t
[root@o**2 d*rdat]# ll
总计 4
-rw-rw-rw- 1 **s o**stall 1634 07-08 21:45 tp000000
&*bsp;
2. 添加检查表
ed*t params ./GLOBALS
CHECK*OINTTABLE **s.checkpo**t
[**s@o**2 o**]$ ./**sc*
GGSCI (o**2) 1&*t; dblo*** user*d **s,password **s
Successfully lo**ed **to database.
&*bsp;
GGSCI (o**2) 2&*t; add checkpo**ttable **s.checkpo**t
Successfully created checkpo**t table **s.checkpo**t.
&*bsp;
SQL&*t; *> co** **s/ *>**s Co**ected. SQL *>&*t; *>select *>* *>from *>tab; TNAME TABTY*E CLUSTERID *>-- *>---------------------------- ------- ---------- *>CHECK*OINT *>TABLE *>CHECK*OINT_LO* *>TABLE *>
&*bsp;
3. 配置目标端repl*cat进程组
ed*t params test_r
repl*cat test_r user*d **s,password **s assumetar*etdefs reperror *>default *>,d*scard d*scardf*le *>/ *>o**/ *>d*rrpt/ *>test_r.desc *>dy*am*cresolut*o* map scott. *>* *>;tar*et scott.* *>;
&*bsp;
GGSCI (o**2) 4&*t; add repl*cat test_r,exttra*l /o**/d*rdat/tp,checkpo**ttable **s.checkpo**t
RE*LICAT added.
&*bsp;
GGSCI (o**2) 5&*t; **fo all
*ro*ram&*bsp;&*bsp;&*bsp;&*bsp; Status&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; Group&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; La* at Chkpt&*bsp; T*me S**ce Chkpt
MANAGER&*bsp;&*bsp;&*bsp;&*bsp; RUNNING&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;
RE*LICAT&*bsp;&*bsp;&*bsp; STO**ED&*bsp;&*bsp;&*bsp;&*bsp; TEST_R&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; 00:00:00&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; 00:00:14&*bsp;&*bsp;&*bsp;
&*bsp;
&*bsp;
四、查询源sc*,将源数据导入目标库
1.源库按照sc*导入到目标库
SQL&*t; *> co** scott/ *>t**er Co**ected. SQL *>&*t; *>select *>* *>from *>test1; ID *>-- *>-------- *>1 *>2 *>3 *>SQL *>&*t; *>select *>* *>from *>test2; NAME *>-- *>------------------ *>batma* l*keq*a** superma* x*j**p*** *>此时源端的sc* *> SQL&*t; *>select *> curre*t_sc*from *> v$database *>; CURRENT_SCN *>-- *>--------- *>402721 *>
&*bsp;
[oracle@o**1 dump]$ expdp system/oracle d*rectory=dump dumpf*le=scott.dmp schemas=scott flashback_sc*=402721
Export: Release10.2 *>.0.5 *>.0 *>- *> 64b*t *> *roduct*o*o* *> Tuesday,08 *> *uly,2014 *>21 *>:36 *>:31 *>Copyr**ht (c) *>2003 *>,2007 *>, Oracle.All *>r**hts reserved. Co**ected *>to *>: OracleDatabase *> 10* E*terpr*se Ed*t*o* Release10.2 *>.0.5 *>.0 *>- *> 64b*t *>*roduct*o* *>W*th *> the *art*t*o****, OLA*, Data M*****a*d *>Real *>Appl*cat*o* Test*** opt*o*s FLASHBACK automat*cally e*abled *>to *> preservedatabase *>**te*r*ty. Start*** "SYSTEM"."SYS_E**ORT_SCHEMA_01": system *>/* *>******* d*rectory=dump dumpf*le=scott.dmp schemas=scott flashback_sc*=402721 Est*mate ** pro*ress us*** BLOCKS method... *rocess*** object type SCHEMA_E**ORT/TABLE/TABLE_DATA Total est*mat*o* us*** BLOCKS method: 320 KB *rocess*** object type SCHEMA_E**ORT/USER *rocess*** object type SCHEMA_E**ORT/SYSTEM_GRANT *rocess*** object type SCHEMA_E**ORT/ROLE_GRANT *rocess*** object type SCHEMA_E**ORT/DEFAULT_ROLE *rocess*** object type SCHEMA_E**ORT/*RE_SCHEMA/*ROCACT_SCHEMA *rocess*** object type SCHEMA_E**ORT/TABLE/TABLE *rocess*** object type SCHEMA_E**ORT/TABLE/INDE*/INDE* *rocess*** object type SCHEMA_E**ORT/TABLE/CONSTRAINT/CONSTRAINT *rocess*** object type SCHEMA_E**ORT/TABLE/INDE*/STATISTICS/INDE*_STATISTICS *rocess*** object type SCHEMA_E**ORT/TABLE/CONSTRAINT/REF_CONSTRAINT . . exported "SCOTT"."DE*T" 5.656 KB 4 rows . . exported "SCOTT"."EM*" 7.820 KB 14 rows . . exported "SCOTT"."SALGRADE" 5.585 KB 5 rows . . exported "SCOTT"."TEST1" 4.929 KB 3 rows . . exported "SCOTT"."TEST2" 4.960 KB 4 rows . . exported "SCOTT"."BONUS" 0 KB 0 rows Master table "SYSTEM"."SYS_E**ORT_SCHEMA_01" successfully loaded/u*loaded ****************************************************************************** Dump f*le set for SYSTEM.SYS_E**ORT_SCHEMA_01 *s: /dump/scott.dmp *ob "SYSTEM"."SYS_E**ORT_SCHEMA_01" successfully completed at 21:36:59 *>
&*bsp;
SQL&*t; *> co** scott/ *>t**er Co**ected. SQL *>&*t; *>**sert *>**to *> test1values *>(4 *>); *>1 *>row created. SQL *>&*t; *>comm*t *>; *>Comm*t *>complete. SQL *>&*t; *>**sert *>**to *> test2values *>(' *>m*chael *>' *>); *>1 *>row created. SQL *>&*t; *>comm*t *>; *>Comm*t *> complete.
&*bsp;
[root@o**1 dump]# scp scott.dmp 192.168.100.130:/dump
root@192.168.100.130's password:
scott.dmp&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; 100%&*bsp; 256KB 256.0KB/s&*bsp;&*bsp; 00:00&*bsp;&*bsp;&*bsp;
&*bsp;
[root@o**2 dump]# su - oracle
[oracle@o**2 ~]$ cd /dump
[oracle@o**2 dump]$ *mpdp system/oracle d*rectory=dump dumpf*le=scott.dmp
Import: Release11.2 *>.0.4 *>.0 *>- *> *roduct*o*o* *> 星期二 7月8 *>21 *>:43 *>:08 *>2014 *>Copyr**ht (c) *>1982 *>,2011 *>, Oraclea*d/or *> *ts aff*l*ates.All *>r**hts reserved. 连接到: Oracle *>Database *> 11* E*terpr*se Ed*t*o* Release11.2 *>.0.4 *>.0 *>- *> 64b*t *>*roduct*o* *>W*th *> the *art*t*o****, OLA*, Data M*****a*d *>Real *>Appl*cat*o* Test*** opt*o*s 已成功加载 *>/ *>卸载了主表 "SYSTEM"."SYS_IM*ORT_FULL_01" 启动 "SYSTEM"."SYS_IM*ORT_FULL_01": system *>/* *>******* d*rectory=dump dumpf*le=scott.dmp 处理对象类型 SCHEMA_E**ORT/USER 处理对象类型 SCHEMA_E**ORT/SYSTEM_GRANT 处理对象类型 SCHEMA_E**ORT/ROLE_GRANT 处理对象类型 SCHEMA_E**ORT/DEFAULT_ROLE 处理对象类型 SCHEMA_E**ORT/*RE_SCHEMA/*ROCACT_SCHEMA 处理对象类型 SCHEMA_E**ORT/TABLE/TABLE 处理对象类型 SCHEMA_E**ORT/TABLE/TABLE_DATA . . 导入了 "SCOTT"."DE*T" 5.656 KB 4 行 . . 导入了 "SCOTT"."EM*" 7.820 KB 14 行 . . 导入了 "SCOTT"."SALGRADE" 5.585 KB 5 行 . . 导入了 "SCOTT"."TEST1" 4.929 KB 3 行 . . 导入了 "SCOTT"."TEST2" 4.960 KB 4 行 . . 导入了 "SCOTT"."BONUS" 0 KB 0 行 处理对象类型 SCHEMA_E**ORT/TABLE/INDE*/INDE* 处理对象类型 SCHEMA_E**ORT/TABLE/CONSTRAINT/CONSTRAINT 处理对象类型 SCHEMA_E**ORT/TABLE/INDE*/STATISTICS/INDE*_STATISTICS 处理对象类型 SCHEMA_E**ORT/TABLE/CONSTRAINT/REF_CONSTRAINT 作业 "SYSTEM"."SYS_IM*ORT_FULL_01" 已于 星期二 7月 8 21:43:26 2014 elapsed 0 00:00:17 成功完成 *>
&*bsp;
2.验证目标库数据
SQL&*t; *> co** scott/ *>t**er 已连接。 SQL *>&*t; *>select *>* *>from *>test1; ID *>-- *>-------- *>1 *>2 *>3 *>SQL *>&*t; *>select *>* *>from *>test2; NAME *>-- *>---------------------------------------------------------- *>batma* l*keq*a** superma* x*j**p*** *>
&*bsp;
3.源库再次做出交易
SQL&*t; *>**sert *>**to *> test1values *>(5 *>); *>1 *>row created. SQL *>&*t; *>comm*t *>; *>Comm*t *>complete. SQL *>&*t; *>**sert *>**to *> test2values *>(' *>jackso* *>' *>); *>1 *>row created. SQL *>&*t; *>comm*t *>; *>Comm*t *> complete.
&*bsp;
[root@o**1 d*rdat]# ll
总计 4
-rw-rw-rw- 1 **s o**stall 1611 07-08 21:44 te000000
[root@o**2 d*rdat]# ll
总计 4
-rw-rw-rw- 1 **s o**stall 1634 07-08 21:45 tp000000
&*bsp;
4.启动repl*cat(aftercs*)
GGSCI (o**2) 9&*t; start repl*cat test_r,
Se*d*** START request to MANAGER ...
RE*LICAT TEST_R start***
&*bsp;
GGSCI (o**2) 10&*t; **fo all
*ro*ram&*bsp;&*bsp;&*bsp;&*bsp; Status&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; Group&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; La* at Chkpt&*bsp; T*me S**ce Chkpt
MANAGER&*bsp;&*bsp;&*bsp;&*bsp; RUNNING&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;&*bsp;
RE*LICAT&*bsp;&*bsp;&*bsp; RUNNING&*bsp;&*bsp;&*bsp;&*bsp; TEST_R&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; 00:00:00&*bsp;&*bsp;&*bsp;&*bsp;&*bsp; 00:00:00&*bsp;&*bsp;&*bsp;
&*bsp;
5.验证目标库数据
SQL&*t; *> co** scott/ *>t**er 已连接。 SQL *>&*t; *>select *>* *>from *>test1; ID *>-- *>-------- *>1 *>2 *>3 *>4 *>5 *>SQL *>&*t; *>select *>* *>from *>test2; NAME *>-- *>---------------------------------------------------------- *>batma* jackso* l*keq*a** m*chael superma* x*j**p*** 已选择6行。 *>
&*bsp;
&*bsp;