GGSCI (localhost.localdomain) 5> edit params eorakk
--
-- Change Capture parameter file to capture
-- TCUSTMER and TCUSTORD Changes
--
EXTRACT EORAKK
USERID system, PASSWORD oracle
RMTHOST 192.168.199.104, MGRPORT 7809
EXTTRAIL ./dirdat/KK
DDL INCLUDE ALL
TABLE SCOTT.TCUSTMER;
TABLE SCOTT.TCUSTORD;
在原有基础上添加一行DDL INCLUDE ALL
编辑Replicat参数
GGSCI (localhost.localdomain) 4> edit params rorakk
--
-- Change Delivery parameter file to apply
-- TCUSTMER and TCUSTORD Changes
--
REPLICAT RORAKK
USERID system, PASSWORD oracle
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORAKK.DSC, PURGE
DDL INCLUDE MAPPED
MAP scott.tcustmer, TARGET scott.tcustmer;
MAP scott.tcustord, TARGET scott.tcustord;
在原有基础上添加一行DDL INCLUDE MAPPED
启动Manager、Extract、Replicat
源端
GGSCI (localhost.localdomain) 6> start manager
Manager started.
GGSCI (localhost.localdomain) 7> start extract eorakk
Sending START request to MANAGER ...
EXTRACT EORAKK starting
目的端
GGSCI (localhost.localdomain) 5> start mgr
Manager started.
GGSCI (localhost.localdomain) 16> start replicat rorakk
Sending START request to MANAGER ...
REPLICAT RORAKK starting
验证数据
源端
SQL> truncate table tcustmer;
Table truncated.
SQL> desc tcustmer
Name Null? Type
----------------------------------------- -------- ----------------------------
CUST_CODE NOT NULL VARCHAR2(4)
NAME VARCHAR2(30)
CITY VARCHAR2(20)
STATE CHAR(2)
SQL> alter table tcustmer add state_desc varchar2(30);
Table altered.
目的端
SQL> select * from tcustmer;
no rows selected
SQL> desc tcustmer
Name Null? Type
----------------------------------------- -------- ----------------------------
CUST_CODE NOT NULL VARCHAR2(4)
NAME VARCHAR2(30)
CITY VARCHAR2(20)
STATE CHAR(2)
STATE_DESC VARCHAR2(30)
数据已同步。