For more information about using Oracle GoldenGate user exits, see Administering Oracle GoldenGate.
Topics:
Use EXIT_CALL_TYPE
to indicate when, during processing, the Extract or Replicat process (the caller) calls a user exit routine. A process can call a routine with the following calls.
Table 8-1 User Exit Calls
Call type | Processing point |
---|---|
|
Valid when the |
|
Called just before either of the following:
|
|
Called just before an Extract or Replicat checkpoint is written. |
|
Called during Extract processing before an ASCII input record is written to the discard file. The associated ASCII buffer can be retrieved and manipulated by the user exit using callback routines. This call type is not applicable for use with the Replicat process. |
|
Called during Replicat processing before a record is written to the discard file. Records can be discarded for several reasons, such as when a value in the Oracle GoldenGate change record is different from the current version in the target table.The associated discard buffer can be retrieved and manipulated by the user exit using callback routines. This call type is not applicable for use with the Extract process. |
|
Called just after either of the following:
|
|
Called during Extract or Replicat processing just before Oracle GoldenGate terminates after a fatal error. |
|
Called during Replicat processing when a marker from a NonStop server is read from the trail, and before writing to the marker history file. |
|
This call is the basis of most user exit processing. When |
|
Called at the start of processing. The user exit can perform initialization work, such as opening files and initializing variables. |
|
Called before the process stops gracefully or ends abnormally. The user exit can perform completion work, such as closing files or outputting totals. |
|
Set by the user exit routines to instruct the caller how to respond when each exit call completes. |
Valid For
Extract and Replicat
Description
Use the SET_SESSION_CHARSET
function to set the character set of the user exit. The character set of the user exit session indicates the encoding of any character-based callback structure members that are used between the user exit and the caller process (Extract, data pump, Replicat), including metadata such as (but not limited to):
database names and locales
table and column names
DDL text
error messages
character-type columns such as CHAR
and NCHAR
date-time and numeric columns that are represented in string form
This function can be called at any time that the user exit has control. When the user exit sets the session character set, it takes effect immediately, and all character values start being converted to the specified set. The recommended place to call this function is with call type EXIT_CALL_START
.
Note:
SET_SESSION_CHARSET
is not thread-safe.
If SET_SESSION_CHARSET
is not called, the session gets set to the default character set of the operating system, which is a predefined enumerated type value in ULIB_CS_DEFAULT
in the ucharset.h
file. When the session character set is a default from ULIB_CS_DEFAULT
, no conversion is performed by Oracle GoldenGate for character-type values that are exchanged between the user exit and the caller process. In addition, the object-name metadata of the database are considered to be the default character set of the operating system. Keep in mind that the default may not be correct.
The character set of the user exit is printed to the report file when the user exit is loaded and when SET_SESSION_CHARSET
is called. If the session character set is ULIB_CS_DEFAULT
, there is a message stating that no column data character-set conversion is being performed.
For more information about globalization support, see Administering Oracle GoldenGate.
Syntax
#include usrdecs.h short result_code; session_def session_charset_def; ERCALLBACK (SET_SESSION_CHARSET, &session_charset_def, &result_code);
Buffer
typedef struct { ULibCharSet session_charset; } session_def;
Input
Output
None
Return Values
EXIT_FN_RET_OK