Chinaunix首页 | 论坛 | 博客
  • 博客访问: 133929
  • 博文数量: 35
  • 博客积分: 1002
  • 博客等级: 准尉
  • 技术积分: 345
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-03 14:30
文章分类

全部博文(35)

文章存档

2014年(7)

2013年(8)

2011年(4)

2010年(9)

2009年(7)

我的朋友

分类: Oracle

2014-03-25 17:27:51


投递进程添加
TABLE HX_DJ.TEST2, TOKENS (TKN-COMMIT-TS = @GETENV ("GGHEADER", "COMMITTIMESTAMP") ...
将数据提交时获取的时间戳存入变量 TKN-COMMIT-TS
入库进程添加
MAP hx_dj.test2, TARGET hx_dj.test2,colmap (usedefaults,DEAL_DATE=@token("TKN-COMMIT-TS"), ...
获取变量值存入相应字段


下面是(抽取,投递,入库) E --> P --> R 进程:




GGSCI (bjcjhxdb01) 88> view param etest


extract etest
SETENV (ORACLE_SID="hxzg")
SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
USERID ggs , PASSWORD register
REPORT AT 01:59
REPORTROLLOVER AT 02:00
CACHEMGR, CACHESIZE 256MB
TRANLOGOPTIONS EXCLUDEUSER HX_SJYW
EXTTRAIL ./dirdat/aa
NUMFILES 3000
EOFDELAYCSECS 30
GETTRUNCATES
TRANLOGOPTIONS DBLOGREADER
DYNAMICRESOLUTION
BR BRINTERVAL 2H , BRDIR BR
GETUPDATEBEFORES
NOCOMPRESSDELETES
WARNLONGTRANS 3H, CHECKINTERVAL 3M
TABLEEXCLUDE *.DBMS_TABCOMP_TEMP*;


--TABLE HX_DJ.TEST2, TOKENS (DEAL_DATE = @GETENV ("GGHEADER", "COMMITTIMESTAMP"),OP_FLAG = @GETENV ("GGHEADER", "OPTYPE"), TIME_LAG = @GETENV ("LAG", "SECONDS"));




table hx_dj.test2;








GGSCI (bjcjhxdb01) 89> view param ptest


extract ptest
SETENV (ORACLE_SID="hxzg")
SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
USERID  ggs , PASSWORD register
REPORT AT 01:59
REPORTROLLOVER AT 02:00
CACHEMGR, CACHESIZE 256MB
FLUSHCSECS 30
NUMFILES 3000
EOFDELAYCSECS 30
RMTHOST  100.12.242.57,MGRPORT 7810, TCPBUFSIZE 100000, TCPFLUSHBYTES 300000
RMTTRAIL ./dirdat/bb
GETTRUNCATES
--PASSTHRU
DYNAMICRESOLUTION
GETUPDATEBEFORES
NOCOMPRESSDELETES
TABLEEXCLUDE *.DBMS_TABCOMP_TEMP*;




TABLE HX_DJ.TEST2, TOKENS (
TKN-COMMIT-TS = @GETENV ("GGHEADER", "COMMITTIMESTAMP"),
TKN-OP-TYPE = @GETENV ("GGHEADER", "OPTYPE"), 
TKN-LAG-SEC = @GETENV ("LAG", "SECONDS"));


GGSCI (bjcjhxdb02) 17> view param RTEST


replicat rtest
SETENV (ORACLE_SID="hxqz")
SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
USERID  ggs , PASSWORD register
sqlexec "Alter session set commit_write=nowait"
REPORT AT 01:59
REPORTROLLOVER AT 02:00
CACHEMGR, CACHESIZE 256MB
REPERROR DEFAULT,ABEND
DISCARDFILE ./dirrpt/rtest.dsc,APPEND,MEGABYTES 100
DISCARDROLLOVER AT 06:00
GETTRUNCATES
NUMFILES 3000
EOFDELAYCSECS 30
ASSUMETARGETDEFS
ALLOWNOOPUPDATES
DYNAMICRESOLUTION
GETUPDATEBEFORES
NOCOMPRESSDELETES


MAP hx_dj.test2, TARGET hx_dj.test2,colmap (usedefaults,DEAL_DATE=@token("TKN-COMMIT-TS"),OP_FLAG=@token("TKN-OP-TYPE"),TIME_LAG=@token("TKN-LAG-SEC"));


--测试


源端:


SQL> desc HX_DJ.TEST2
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID                                        NOT NULL CHAR(32)
 NAME                                      NOT NULL CHAR(17)
 AGE                                                NUMBER
 
 SQL> insert into HX_DJ.TEST2 (id,name,age) values('666','name2',66);


1 row created.


SQL> commit;


Commit complete.


目标端:


SQL> select deal_date,op_flag,time_lag from HX_DJ.TEST2 where id = '666';


DEAL_DATE
--------------------------------------------------------------------------------
OP_FLAG
--------------------------------------------------------------------------------
TIME_LAG
--------------------------------------------------------------------------------
2014-03-25 15:31:01.000000
INSERT
3


阅读(8472) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~