CUSEREXIT
Valid For
Extract when fetching from a multitenant container database (CDB) and Replicat
Description
Use the CUSEREXIT
parameter to call a custom exit routine written in C programming code from a Windows DLL or UNIX shared object at a defined exit point within Oracle GoldenGate processing. Your user exit routine must be able to accept different events and information from the Extract and Replicat processes, process the information as desired, and then return a response and information to the caller (the Oracle GoldenGate process that called it).
User exits can be used as an alternative to, or in conjunction with, the data transformation functions that are available within the Oracle GoldenGate solution.
Note:
When using a coordinated Replicat to call a user exit routine, you are responsible for writing the user exits in a thread-safe manner.
For help with creating and implementing user exits, see Administering Oracle GoldenGate.
Default
None
Syntax
CUSEREXIT {DLL
|shared_object
}routine
[, INCLUDEUPDATEBEFORES] [, PARAMS 'string']
-
{
DLL
|shared_object
} -
The name of the Windows DLL or UNIX shared object that contains the user exit function.
-
routine
-
The name of the exit routine to be executed.
-
INCLUDEUPDATEBEFORES
-
Passes the before images of column values to a user exit. When using this parameter, you must explicitly request the before image by setting the
requesting_before_after_ind
flag toBEFORE_IMAGE_VAL
within a callback function that supports this flag. Otherwise, only the after image is passed to the user exit. By default, Oracle GoldenGate only works with after images.When using
INCLUDEUPDATEBEFORES
for a user exit that is called from a data pump or from Replicat, always use theGETUPDATEBEFORES
parameter for the primary Extract process, so that the before image is captured, written to the trail, and causes aprocess_record
event in the user exit. In a case where the primary Extract also has a user exit,GETUPDATEBEFORES
causes both the before image and the after image to be sent to the user exit as separateEXIT_CALL_PROCESS_RECORD
events.If the user exit is called from a primary Extract (one that reads the transaction log), only
INCLUDEUPDATEBEFORES
is needed for that Extract.GETUPDATEBEFORES
is not needed in this case, unless other Oracle GoldenGate processes downstream will need the before image to be written to the trail.INCLUDEUPDATEBEFORES
does not cause before images to be written to the trail. -
PARAMS
'string'
-
Passes the specified string at startup. Can be used to pass a properties file, startup parameters, or other string. Enclose the string within single quote marks.
Data in the string is passed to the user exit in the
EXIT_CALL_START
exit_params_def.function_param
. If no quoted string is specified withPARAMS
, theexit_params_def.function_param
isNULL
.
Examples
- Example 1
CUSEREXIT userexit.dll MyUserExit
- Example 2
CUSEREXIT userexit.dll MyUserExit, PARAMS 'init.properties'
- Example 3
CUSEREXIT userexit.dll MyUserExit, INCLUDEUPDATEBEFORES, PARAMS 'init.properties'
- Example 4
CUSEREXIT userexit.dll MyUserExit, INCLUDEUPDATEBEFORES, & PARAMS 'init.properties'
- Example 5
CUSEREXIT cuserexit.dll MyUserExit, & INCLUDEUPDATEBEFORES, PARAMS 'Some text to start with during startup'