goldengate(18)

goldengate(18)--Selecting columns

To control which columns of a source table are extracted by GoldenGate, use the COLS and
COLSEXCEPT options of the TABLE parameter. Use COLS to select columns for extraction, and
use COLSEXCEPT to select all columns except those designated by COLSEXCEPT.
Restricting the columns that are extracted can be useful when a target table does not
contain the same columns as the source table, or when the columns contain sensitive
information, such as a personal identification number or other proprietary business
information.

examples:

The name of a column. To specify multiple columns, create a comma-delimited list as
in the following examples.
The following processes only columns 1 and 3.
TABLE hq.acct, COLS (col1, col3);
The following processes all columns except column 4.
TABLE hq.acct, COLSEXCEPT (col4);

示例:

extract 配置:

EXTRACT s_ex_hr
--SETENV (NLS_LANG = "CHINESE_CHINA.ZHS16GBK")
SETENV (ORACLE_HOME = "/u01/app/oracle/product/11.2.0/dbhome_1")
SETENV (ORACLE_SID = "dbking")
DBOPTIONS ALLOWUNUSEDCOLUMN
USERID ggs, PASSWORD ggs
TRANLOGOPTIONS ASMUSER sys@asm, ASMPASSWORD grid
EXTTRAIL /u01/app/oracle/ggs/dirdat/trail/hr/tt
--TABLEEXCLUDE test.MV_123, test.mlog$_xy101
SEQUENCE gis_test.*;
GETTRUNCATES
WARNLONGTRANS 1m, CHECKINTERVAL 5s
DDL INCLUDE MAPPED OBJNAME "gis_test.*"
--TABLE gis_test.*;
TABLE gis_test.t4, COLSEXCEPT (NAME);

EXTRACT pump_hr
SETENV (ORACLE_HOME = "/u01/app/oracle/product/11.2.0/dbhome_1")
SETENV (ORACLE_SID = "dbking")
USERID ggs, PASSWORD ggs
RMTHOST 10.23.5.71, MGRPORT 7809
RMTTRAIL /u01/app/oracle/ggs/dirdat/rtrail/hr/pp
PASSTHRU
--TABLEEXCLUDE test.MV_123, test.mlog$_xy101
SEQUENCE gis_test.*;
TABLE gis_test.*;

REPLICAT rep_hr
--SETENV (NLS_LANG = "AMERICAN_AMERICA.WE8ISO8859P1")
SETENV (ORACLE_HOME = "/u01/app/oracle/product/10.2.0/db_1")
SETENV (ORACLE_SID = "dbwdn")
ASSUMETARGETDEFS
DISCARDFILE /u01/app/oracle/ggs/dirrpt/discard/rep.dsc, APPEND
USERID ggs, PASSWORD ggs
GETTRUNCATES
DDL INCLUDE MAPPED
MAP gis_test.*, TARGET gis_test.*;

源端插入数据:

insert into gis_test.t4 values(6,'ffff');
commit;

id   name

 1 aaa
 2 bbb
 3 ccc
 4 ddd
 5 eee
 6 ffff

目标端查看:

id    name

 1 aaa
 2 bbb
 3 ccc
 4 ddd
 5 eee
 6           ------NAME字段没有复制.

 

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21266384/viewspace-756919/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/21266384/viewspace-756919/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值