Showing posts with label Goldengate for Kafka. Show all posts
Showing posts with label Goldengate for Kafka. Show all posts

Wednesday, 27 September 2017

Goldengate for Kafka : how to send Tokens to Kafka from Goldengate

Requirement -

Recently i got one request from client to provide one unique identifier of the Source table to Kafka mostly Source Table name. 

As we do not have any Column in the table which can provide this information to the Kafka by simple Goldengate Mapping. 

To full-fill this requirement i Used Goldengate Tokens to give Source Table name with each generated topic to Kafka. 

for this configuration below changes are required. 



Source Side (Goldengate)

we need to add Token to the goldengate extract parameter file.  

TABLE Hr.Emp , tokens (SOURCE_TABLE = "Emp") ;




Target Side (Kafka)

we need to make below changes to kafka.props file at target goldengate configuration side 

gg.handler.kafkahandler.includeTokens=true



Note: before implementing above solution in to production please do testing of your requirement by your own in non production ENV . above solution is based on my requirement and experience. 

Tuesday, 4 July 2017

OGG-03528 | OGG-15052 - Goldengate For Kafka : Replicate stopped after Linux latest OS kernel updates

Situation 

After installing Linux latest OS kernel updates, Oracle Goldengate replicate process are stopped and showing below in report file. 

GGSCI > View report <Replicate name>

Report file show like below


2017-07-04 00:16:01  INFO    OGG-03528  The source database character set, as determined from the table definition file, is ISO-8859-1.
REPLICAT INR28
TARGETDB LIBFILE libggjava.so SET property=/goldengate/ggadmin/12.3.0/dirprm/kafka.props

2017-07-04 00:16:02  INFO    OGG-15052  Using Java class path: /goldengate/ggadmin/12.3.0/ggjava/ggjava.jar:/goldengate/ggadmin/12.3.0/dirprm:ggjava/resources/lib/op
tional/log4j-1.2.17.jar:ggjava/resources/lib/optional/slf4j-log4j12-1.7.6.jar.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0x00007f0369010eac, pid=48662, tid=139653265958272
#
# JRE version:  (8.0_66-b17) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.66-b17 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# j  sun.reflect.ReflectionFactory.<clinit>()V+0
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /goldengate/ggadmin/12.3.0/hs_err_pid48662.log
#

# If you would like to submit a bug report, please visit:


Reason - 
After Linux Kernel updates JVMController will not start and core dump is generated. 


Solution - 
As per Oracle Document Doc ID 2280962.1

we need to change below parameter values 

at GG_HOME/dirprm directory in kafka.props file 


BEFORE VALUE


gg.classpath=/goldengate/ggadmin/12.3.0/dirprm:/dgt/kfk/kafka/kafka_2.10-0.10.1.0/libs/*
javawriter.bootoptions=-Xmx512m -Xms32m -Djava.class.path=/goldengate/ggadmin/12.3.0/ggjava/ggjava.jar:/goldengate/ggadmin/12.3.0/dirprm


Value After Fix

gg.classpath=/goldengate/ggadmin/12.3.0/dirprm:/dgt/kfk/kafka/kafka_2.10-0.10.1.0/libs/*
javawriter.bootoptions=-Xss2m -Xms512m -Xmx1024m -Djava.class.path=/goldengate/ggadmin/12.3.0/ggjava/ggjava.jar:/goldengate/ggadmin/12.3.0/dirprm



Note: Values may change with environment and versions in use .  Before considering changes in Production Environment please validate the same in Non-production or Testing environment.