192.168.27.33
test11g
hdb11g
trandata: 同步delete,update 使用
config 文件:同步表使用
进程根据SCN号和RBA和主键同步
##目的:数据定时同步,从源库 test11g同步到目标库 hdb11g
testDATA.TEST 同步到 MCPDATA.TEST
testDATA/testdatapr
##source和target端均操作:
source:
cd /testdb11g/ogg
target:
cd /testhdb11g/ogg
source:
PORT 7809
target:
PORT 7810
(/u01/gg11/ggserr.log
sqlplus testDATA/testdatapr
alter user gguser identified by gguser;
create user gguser identified by gguser default tablespace SUPPORT;
grant resource, connect, dba to gguser;
create table t1 as select * from user_objects;
alter table t1 add constraint pk_t1 primary key(object_id);
create table t1 as select * from user_objects where 1=2;
alter table t1 add constraint pk_t1 primary key(object_id);
step 1:
一.3.5.1 开启hr用户下所有表的附加日志
dblogin userid ggusr@ogg1, password lhr
add trandata hr.*
--extract einig1
--setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
--userid gguser,password gguser
--rmthost 192.168.27.33,mgrport 7810
--rmttask replicat,group rinig1
--extract einig1
--setenv (ORACLE_SID=test11g)
--setenv (NLS_LANG=AMERICAN_AMERICA.UTF8)
--userid gguser,password gguser
--rmthost 192.168.27.33,mgrport 7810
--rmttask replicat,group rinig1
--table testdata.t1;
--replicat rinig1
--setenv (ORACLE_SID=hdb11g)
--setenv (ORACLE_HOME=/opt/oracle11g/product/11.2)
--setenv (NLS_LANG=AMERICAN_AMERICA.UTF8)
--assumetargetdefs
--userid gguser,password gguser
--discardfile ./dirrpt/rinig1.dsc,purge
--map testdata.*,target testdata.*;
######process eora_test 添加并配置extract进程
add extract eora_test,tranlog,begin now
extract eora_test
setenv (ORACLE_SID=test11g)
setenv (ORACLE_HOME=/opt/oracle11g/product/11.2)
setenv (NLS_LANG=AMERICAN_AMERICA.UTF8)
userid gguser,password gguser
exttrail ./dirdat/mc
table testdata.*;
添加trail文件
add exttrail ./dirdat/mc,extract eora_test,megabytes 100
start extract eora_test
状态:
info extract eora_hr
#####process pora_test 添加并启动pump进程
edit params pora_test
extract pora_test
setenv (ORACLE_SID=test11g)
setenv (ORACLE_HOME=/opt/oracle11g/product/11.2)
setenv (NLS_LANG=AMERICAN_AMERICA.UTF8)
passthru
rmthost 192.168.27.33,mgrport 7810
rmttrail ./dirdat/pa
table testdata.*;
add extract pora_test,exttrailsource ./dirdat/mc
add rmttrail ./dirdat/pa,extract pora_test,megabytes 100
start extract pora_test
######target process :rora_test 在target端添加检查表,配置replicat进程
edit params ./GLOBALS
dblogin userid gguser@hdb11g, password gguser
add checkpointtable gguser.CHECKPOINTTABLE
二、 添加并启动replicat进程
edit params rora_test
replicat rora_test
setenv (ORACLE_SID=hdb11g)
setenv (ORACLE_HOME=/opt/oracle11g/product/11.2)
setenv (NLS_LANG=AMERICAN_AMERICA.UTF8)
userid gguser,password gguser
handlecollisions
assumetargetdefs
discardfile ./dirrpt/rora_test.dsc,purge
map testdata.* ,target testdata.*;
add replicat rora_test,exttrail ./dirdat/pa
状态检查:
GGSCI (rhel6_lhr) 4> info all