/ Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved./
This is a User exit example for access to "Primary Key Updates" and "before images"
from Updates. This example uses the PK_BF_TIMESRC and PK_BF_TIMETRG tables,
which can be created using the demo_*pk_befores_create.sql scripts included
with the ER release. This same script will add a stored procedure, which when
executed will Insert and Update a row of data. Please be sure to "ADD TRANDATA" for
the PK_BF_TIMESRC table for those databases which allow the GGSCI command, before executing.
To compile this exit code, use the appropriate make or project file in this same directory. The compiles are 32bit,
for 64bit, changes will be necessary in the make files as well as possibly #includes in the .c file.
This example is a hypothetical business solution when a target database does not
allow the Primary Key Updates. Therefore, when reading a PKUpdate record, it will
change this operation into two separate records of Delete and Insert. While this is not
necessary for most databases, for those databases which PKUpdates are not allow
this example is not necessarily a recommended solution to this problem. It is only
an example to demonstrate access to PKupdate records. This example will work for Extract
and Replicat.
This example will also show access to the before images of an Update. These records
are typically included with the use of GETUPDATEBEFORES or the "cuserexit" option of
INCLUDEUPDATEBEFORES. This is intended as a hypothetical business solution of conflict
detection base on a specific column. The is an example which can only function in Replicat.
The examples when used in a Replicat will also make use of the SQLEXEC functionality.
Several user exit callbacks allow for access by both name or by index, examples are shown for both.
Callbacks that are exercised
GET_TABLE_NAME Used to get Name
GET_ENV_VALUE Used to get ENV values same as GGS @GETENV() function
GET_OPERATION_TYPE Used to test to only manipulate needed record types of
UPDATE_COMP_SQL_VAL, UPDATE_COMP_PK_SQL_VAL
SET_OPERATION_TYPE Used to change the current IO type
GET_TABLE_COLUMN_COUNT Used to get number of column, number of key columns
GET_TABLE_METADATA Used to get keys
GET_BEFORE_AFTER_IND Used to get the type of record image
GET_COLUMN_NAME_FROM_INDEX Used to get column name
GET_COLUMN_VALUE_FROM_NAME Used to get column value
GET_COLUMN_VALUE_FROM_INDEX Used to get column value
SET_COLUMN_VALUE_BY_INDEX Used to set column value
SET_COLUMN_VALUE_BY_NAME Used to set column value
GET_ERROR_INFO Used to get error info
OUTPUT_MESSAGE_TO_REPORT Used to write messages to report file
-------------------------------------------------------------------------------------------------------------------------
Param file options with Extract using the User Exit (only for PKUpdate processing)
Optional
EXTRACT EXTPKUP EXTRACT EXTPUMP
USERID XYZ, password XYZ PASSTHRU
EXTTRAIL dirdat\ux EXTTRAIL dirdat\xu
GETUPDATEBEFORES TABLE XYZ.*;
--Next option is DB specific,
-- this is for Oracle
-- if the Extract is processing
-- PKUpdates it must have a full
-- image for Insert
FETCHOPTIONS FETCHPKUPDATECOLS
CUSEREXIT cuserexit.dll CUSEREXIT
TABLE XYZ.PK_BF_TIMESRC;
-------------------------------------------------------------------------------------------------------------------------
Param file options with Extract Pump using the User Exit (only for PKUpdate processing)
EXTRACT EXTPKUP EXTRACT EXTPUMP
USERID XYZ, password XYZ SOURCEDEFS dirdef\pk.def
EXTTRAIL dirdat\ux EXTTRAIL dirdat\xu
GETUPDATEBEFORES CUSEREXIT cuserexit.dll CUSEREXIT, INCLUDEUPDATEBEFORES
-- if the Extract is processing TABLE XYZ.*;
-- PKUpdates it must have a full
-- image for Insert
-- Next option is DB specific,
-- plese check the manual as needed.
FETCHOPTIONS FETCHPKUPDATECOLS
TABLE XYZ.PK_BF_TIMESRC;
------------------------------
These Replicat params are for either of the first two examples with Extract processing the PKUpdate
REPLICAT REPPKBF
DISCARDFILE dirrpt\repdisc.txt, purge
USERID XYZ, password XYZ
ALLOWDUPTARGETMAP
ASSUMETARGETDEFS
CUSEREXIT cuserexit.dll CUSEREXIT, INCLUDEUPDATEBEFORES
IGNOREINSERTS
IGNOREDELETES
MAP XYZ.PK_BF_TIMESRC, TARGET XYZ.PK_BF_TIMETRG,
sqlexec (ID fetchUP, on update, trace all, error fatal,
QUERY " select LAST_UPDATE_DATETIME from XYZ.PK_BF_TIMETRG "
" where key_num = :key_num and cat_code = :cat_code and first_num_data_col = :first_num_data_col ",
params (key_num = before.key_num, cat_code = before.cat_code, first_num_data_col = before.first_num_data_col) ) ,
colmap (usedefaults,
LAST_UPDATE_DATETIME = @date ("YYYY-MM-DD:HH:MI:SS", "YYYY-MM-DD HH:MI:SS",
fetchUP.LAST_UPDATE_DATETIME)
),
filter ( @streq ( "SQL COMPUPDATE", @getenv ("GGHEADER", "OPTYPE") ) ) ;
IGNOREUPDATES
GETDELETES
GETINSERTS
MAP XYZ.PK_BF_TIMESRC, TARGET XYZ.PK_BF_TIMETRG;
-------------------------------------------------------------------------------------------------------------------------
Param files options for Replicat using the User Exit.
EXTRACT EXTPKUP
USERID XYZ, password XYZ
EXTTRAIL dirdat\ux
GETUPDATEBEFORES
TABLE XYZ.PK_BF_TIMESRC;
------------------------------
REPLICAT REPPKBF
DISCARDFILE dirrpt\repdisc.txt, purge
USERID XYZ, password XYZ
ALLOWDUPTARGETMAP
ASSUMETARGETDEFS
CUSEREXIT cuserexit.dll CUSEREXIT, INCLUDEUPDATEBEFORES
IGNOREINSERTS
IGNOREDELETES
MAP XYZ.PK_BF_TIMESRC, TARGET XYZ.PK_BF_TIMETRG,
sqlexec (ID fetchPK, on update, trace all, error fatal,
QUERY " select "
" FIRST_VAR_DATA_COL , "
" SECOND_VAR_DATA_COL, "
" SECOND_NUM_DATA_COL, "
" LAST_UPDATE_DATETIME "
" FROM XYZ.PK_BF_TIMETRG "
" where key_num = :key_num and cat_code = :cat_code and first_num_data_col = :first_num_data_col ",
params (key_num = before.key_num, cat_code = before.cat_code, first_num_data_col = before.first_num_data_col) ) ,
colmap (usedefaults,
FIRST_VAR_DATA_COL = fetchPK.FIRST_VAR_DATA_COL
SECOND_VAR_DATA_COL = fetchPK.SECOND_VAR_DATA_COL
SECOND_NUM_DATA_COL = fetchPK.SECOND_NUM_DATA_COL
LAST_UPDATE_DATETIME = @date ("YYYY-MM-DD:HH:MI:SS", "YYYY-MM-DD HH:MI:SS",
fetchPK.LAST_UPDATE_DATETIME)
) ,
filter ( @streq ( "PK UPDATE", @getenv ("GGHEADER", "OPTYPE") ) ) ;
MAP XYZ.PK_BF_TIMESRC, TARGET XYZ.PK_BF_TIMETRG,
sqlexec (ID fetchUP, on update, trace all, error
没有合适的资源?快使用搜索试试~ 我知道了~
V40156-01.zipOracle GoldenGate V12.1.2.0.0 for SQL Server on Win...
共240个文件
jar:53个
dll:51个
exe:17个
5星 · 超过95%的资源 需积分: 49 73 下载量 169 浏览量
2017-06-02
11:38:30
上传
评论 1
收藏 69.71MB ZIP 举报
温馨提示
V40156-01.zip Oracle GoldenGate V12.1.2.0.0 for SQL Server on Windows (64 bit)
资源推荐
资源详情
资源评论
收起资源包目录
V40156-01.zipOracle GoldenGate V12.1.2.0.0 for SQL Server on Windows (64 bit) (240个子文件)
Makefile_more_recs.AIX 3KB
Makefile_lob.AIX 3KB
Makefile_pk_befores.AIX 2KB
Makefile_passthru.AIX 2KB
Makefile_exit_demo.AIX 2KB
pw_agent_util.bat 1019B
jagent.bat 420B
exitdemo.c 57KB
exitdemo_utf16.c 45KB
exitdemo_pk_befores.c 36KB
exitdemo_lob.c 33KB
exitdemo_more_recs.c 30KB
exitdemo_passthru.c 20KB
default.css 316B
ggMessage.dat 1.35MB
icudt48.dll 21.77MB
orageneric12.dll 17.56MB
oraxml12.dll 6.95MB
orapls12.dll 6.01MB
orahasgen12.dll 5.93MB
oraclient12.dll 5.23MB
orazt12.dll 4.9MB
oraldapclnt12.dll 4.83MB
oraztkg12.dll 4.75MB
orannzsbb12.dll 4.51MB
oran12.dll 4.3MB
oraplp12.dll 4MB
oracommon12.dll 3.35MB
xerces-c_2_8.dll 2.88MB
icuin48.dll 2.05MB
oracore12.dll 1.64MB
icuuc48.dll 1.58MB
libdb52.dll 1.42MB
libxml2.dll 1.26MB
gglog.dll 1.17MB
oraocr12.dll 1.08MB
oranls12.dll 991KB
oraocrb12.dll 882KB
oraasmclnt12.dll 869KB
oci.dll 626KB
oranl12.dll 519KB
oracell12.dll 407KB
oranro12.dll 331KB
orasql12.dll 303KB
oranldap12.dll 278KB
oraclsce12.dll 251KB
ggrepo.dll 248KB
orawsec12.dll 225KB
orasnls12.dll 205KB
oraons.dll 203KB
antlr3cd.dll 193KB
orantcp12.dll 186KB
ggperf.dll 149KB
oraunls12.dll 103KB
orancrypt12.dll 99KB
antlr3c.dll 84KB
oraocrutl12.dll 67KB
orantns12.dll 41KB
oraslax12.dll 35KB
oranhost12.dll 22KB
ggsmsg.dll 17KB
ggnnzitp.dll 12KB
oravsn12.dll 10KB
orauts.dll 10KB
orancds12.dll 8KB
category.dll 3KB
OGG_WinUnix_Rel_Notes_12.1.2.0.0.doc 141KB
Oracle-GoldenGate-12.1.2.0-README.doc 92KB
extract.exe 5MB
replicat.exe 3.94MB
convprm.exe 2.4MB
ggsci.exe 2.23MB
server.exe 1.82MB
mgr.exe 1.75MB
defgen.exe 1.46MB
logdump.exe 1.41MB
emsclnt.exe 1.29MB
ggcmd.exe 1.16MB
convchk.exe 1.14MB
oggerr.exe 1.08MB
retrace.exe 1.07MB
reverse.exe 45KB
install.exe 29KB
cachefiledump.exe 14KB
keygen.exe 12KB
status_3.gif 263B
status_2.gif 263B
status_9.gif 258B
status_1.gif 258B
status_8.gif 258B
status_4.gif 258B
status_7.gif 258B
status_10.gif 258B
status_6.gif 258B
status_5.gif 258B
ucharset.h 36KB
usrdecs.h 28KB
Makefile_passthru.HP_OSS 2KB
Makefile_exit_demo.HP_OSS 2KB
Makefile_more_recs.HPUX 3KB
共 240 条
- 1
- 2
- 3
资源评论
- kdymm2021-04-23挺好,谢谢分享
- tangzongjian2018-05-21还不错哈!
- 雨花石~2018-07-18这个资源挺好的
- hduhans2019-02-28这个不行 docx 出错
- anduhan2019-03-28非常感谢,有同版本for Oracle的吗
薛定谔的DBA
- 粉丝: 1293
- 资源: 23
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 老飞飞搭建基础通用数据库V19数据库.rar
- jquery.js
- 机械设计多工位ACF贴胶带&预压设备sw18可编辑非常好的设计图纸100%好用.zip
- 基于Pytorch复现Point-Transformer,用于ShapeNet数据集点云分割
- 【医学影像分析】2D超声图像的分割检测(Ultrasound Nerve Segmentation - Kaggle数据集)
- 嘎嘎香的五款神仙谷歌插件
- .arch书源导入教程.mp4
- 贪心算法介绍及代码示例讲解
- CR13SP35MSI64 Crystal 水晶报表运行组件最后版本64位
- 图像分类数据集:玉米叶是否感染分类数据集(2分类,包含训练集、验证集)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功