当前位置:网站首页>Use of token in ogg
Use of token in ogg
2022-07-19 14:38:00 【Document Porter】
OGG edition :19.1
RDBMS:19.15
Test purpose :
Source side table :bb.t2
Destination end table : zbb.t4,zbb.t5 . t4 and t5 Different structure .t5 In contrast to t4 The redundant columns in are token Get the environment variable
At the same time bb.t2 Synchronize to zbb.t4 and zbb.t5 .
About token and @getenv function , Please refer to the official documents Oracle GoldenGate Windows and UNIX Reference Guide
Source side table :
[email protected]>desc t2
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NUMBER
NAME VARCHAR2(10)
[email protected]>
Destination end table
conn zbb/oracle
create table t5 (
no number,
firstname varchar2(10), ## token name = token value
host varchar2(40), -- TKN-HOST = @GETENV ('GGENVIRONMENT", "HOSTNAME'),
gg_group varchar2(40), -- TKN-GRP = @GETENV ('GGENVIRONMENT", "GROUPNAME'),
osuser varchar2(40), -- TKN-USER = @GETENV ('GGENVIRONMENT", "OSUSERNAME'),
domain varchar2(40), -- TKN-DOMAIN = @GETENV ('GGENVIRONMENT", "DOMAINNAME'),
UPDATETIME date, -- updatetime= @TOKEN ('GGHEADER','COMMITTIMESTAMP'),
tablename varchar2(40), -- TKN-TBNAME = @GETENV ('GGHEADER”, “TABLENAME'),
optype varchar2(40) -- TKN-OPT = @GETENV ('GGHEADER”, “OPTYPE'),
)Source side ext2 , Source end ext process , Get more environment variables , Although for t4 surface , It won't take so much , But for t5 surface , You can use these . No effect t2 and t4,t2 and t5 Simultaneous synchronization of
table bb.t2 ,TOKENS & ## I can't write in one line , You can use symbols & Line break
(TKN-HOST = @GETENV ('GGENVIRONMENT', 'HOSTNAME'), &
TKN-GRP = @GETENV ('GGENVIRONMENT', 'GROUPNAME'), &
TKN-USER = @GETENV ('GGENVIRONMENT', 'OSUSERNAME'),&
TKN-DOMAIN = @GETENV ('GGENVIRONMENT', 'DOMAINNAME'),&
updatetime= @GETENV ('GGHEADER','COMMITTIMESTAMP'),&
TKN-TBNAME = @GETENV ('GGHEADER', 'TABLENAME'),&
TKN-OPT = @GETENV ('GGHEADER', 'OPTYPE'));
Source side pump2 process
table bb.t2 ,TOKENS &
(TKN-HOST = @GETENV ('GGENVIRONMENT', 'HOSTNAME'), &
TKN-GRP = @GETENV ('GGENVIRONMENT', 'GROUPNAME'), &
TKN-USER = @GETENV ('GGENVIRONMENT', 'OSUSERNAME'),&
TKN-DOMAIN = @GETENV ('GGENVIRONMENT', 'DOMAINNAME'),&
updatetime= @GETENV ('GGHEADER','COMMITTIMESTAMP'),&
TKN-TBNAME = @GETENV ('GGHEADER', 'TABLENAME'),&
TKN-OPT = @GETENV ('GGHEADER', 'OPTYPE'));
Because the table on the source side has not changed , So don't generate again defgen file, Just on the target side rep2 Add map , The original is right t4 Tabular map, Also exist
map bb.t2,target zbb.t4, COLMAP (USEDEFAULTS,no=id,firstname=name ,updatetime= @TOKEN ('updatetime')),filter (id > 30); -- Just copy id>30
map bb.t2,target zbb.t5, COLMAP ( &
USEDEFAULTS, &
no=id, &
firstname=name , &
host = @token ('TKN-HOST'), &
gg_group = @token ('TKN-GRP'), &
osuser= @token ('TKN-USER'), &
domain = @token('TKN-DOMAIN'),&
updatetime= @TOKEN ('updatetime'), &
tablename= @TOKEN ('TKN-TBNAME'), &
optype= @TOKEN ('TKN-OPT'), &
);Synchronous success , The original T4, You can also synchronize . T2 Synchronize to T4,T5 .
[email protected]>select * from t4;
NO FIRSTNAME UPDATETIME
---------- ---------- -------------------------
41 p 2022-07-13 16:56:21
42 ae 2022-07-13 17:10:37
43 iwc 2022-07-13 17:13:22
47 mmm ## There is no result here , Because map t2 To t4 Of ,token in ,token The name is misspelled , After modification .
48 ccc 2022-07-14 15:24:15
14 c 2022-07-11 14:32:28
15 d 2022-07-11 14:34:23
11 c 2022-07-09 19:14:23
13 c 2022-07-09 19:28:29
18 a 2022-07-13 15:37:43
19 m 2022-07-13 15:41:25
NO FIRSTNAME UPDATETIME
---------- ---------- -------------------------
32 c 2022-07-13 16:01:14
40 i 2022-07-13 16:04:13
41 m 2022-07-13 16:53:05
9 a 2022-07-08 14:33:03
10 aa 2022-07-08 17:13:07
17 a 2022-07-13 11:24:54
16 a 2022-07-13 10:35:12
18 rows selected.
[email protected]>select * from t5; ## DOmain Field has no result , This field is only for Windows, There are instructions on the official documents
NO FIRSTNAME HOST GG_GROUP OSUSER DOMAIN UPDATETIME TABLENAME OPTYPE
---------- ---------- ---------------- ---------- ---------- ---------- ------------------------- ---------- ----------
44 aa redhat762100 PUMP2 oracle BB.T2 INSERT
45 mw redhat762100 PUMP2 oracle BB.T2 INSERT
46 afdsa redhat762100 PUMP2 oracle 2022-07-14 15:14:32 BB.T2 INSERT
47 mmm redhat762100 PUMP2 oracle 2022-07-14 15:22:35 BB.T2 INSERT
48 ccc redhat762100 PUMP2 oracle 2022-07-14 15:24:15 BB.T2 INSERT
[email protected]>END
边栏推荐
- Redis源码与设计剖析 -- 1.简单动态字符串
- Rotation formula of coordinate simulation matrix
- Redis source code and design analysis -- 1 Simple dynamic string
- OSPF appendix anti ring Reissue
- Huawei wireless device configuration dynamic load balancing
- 揭开服务网格~Istio Service Mesh神秘的面纱
- 函數初認識-下
- 常见的内置函数、可迭代对象、迭代器对象、异常捕获、异常捕获的用途、生成器对象、模块、绝对导入与相对导入、包的概念、模块
- topy库的安装(拓扑优化软件)
- What are the ways to realize load balancing?
猜你喜欢

96. Different binary search trees

BiShe - online reservation and registration system based on SSM

Code runner for vs code, with more than 40million downloads! Support more than 50 languages

ospf 附录 防环 重发布

CF 807 E. Mark and Professor Koro(权值线段树)

Take a look at try{}catch{}

Problème de la valeur maximale de la fenêtre coulissante

Dr. Tao's lunar line reverses by 6.0

Redis source code and design analysis -- 1 Simple dynamic string

Event preview | Apache Doris x Apache seatunnel joint meetup to start registration!
随机推荐
Robotics at google:laura Graesser | i-sim2real: strengthen the learning robot strategy in the close human-computer interaction cycle
函数初认识-下
Common built-in functions, iteratable objects, iterator objects, exception capture, purpose of exception capture, generator objects, modules, absolute and relative imports, package concepts, modules
Event preview | Apache Doris x Apache seatunnel joint meetup to start registration!
00 后博士获聘南大特任副研究员,曾 4 岁上小学,14 岁考入南大!
How to avoid global index in pychart? How to cancel the indexing of a folder?
揭开服务网格~Istio Service Mesh神秘的面纱
Huawei Technologies:Jonatan Krolikowski | 从设计到部署零接触深度强化学习WLANs
Analysis of network communication flow of different containers on the same host
JVM性能优化
【MQTT从入门到提高系列 | 07】MQTT3.1.1之链路保活及断开
4某公司在6个城市c1,c2,c3…c6中有分公司,已知城市ci到cj(I,j=1,2,3,…6)的联通情况下及费用的大小列于以下带权邻接矩阵中C中
华为无线设备配置静态负载均衡
Zhikanghu property elderly care service plan
Ranking and evaluation of the second "green tree Cup" Mathematics Competition
Excellent jar package startup shell script collection
Mvcc multi version concurrency control
洛谷:P3092 [USACO13NOV]No Change G(状压+二分,独特的状态定义,不写会后悔一辈子的题)
华为无线设备配置动态负载均衡
慎用TongWeb的热部署功能