defgen
Note:
Make sure to set the environment variables as described in Oracle GoldenGate Programs section, to be able to use the defgen
utility.
Use defgen
to run the DEFGEN
utility
from the command line of the Linux, UNIX, or Windows operating system. The
defgen
program is installed in the Oracle GoldenGate
installation directory or library.
Syntax for Windows, UNIX, and Linux
defgen paramfile parameter_file
[CHARSET character_set]
[COLCHARSET character_set]
[noextattr]
[pauseatend | nopauseatend]
[reportfile report_file]
The following syntax can also be used without any other options:
defgen defs_file
updatecs
charset
-
defgen
-
Used without options, the command runs the program interactively.
-
paramfile
parameter_file
-
Required. Specifies the relative or absolute path name of the parameter file for the
DEFGEN
program that is being run. -
COLCHARSET
character_set
-
Any supported character set. See
COLCHARSET
for more information. -
noextattr
-
Can be used to support backward compatibility with Oracle GoldenGate versions that are older than Release 11.2.1 and do not support character sets other than ASCII, nor case-sensitivity or object names that are quoted with spaces.
NOEXTATTR
preventsDEFGEN
from including the database locale and character set that support the globalization features that were introduced in Oracle GoldenGate Release 11.2.1. If the table or column name has multi-byte or special characters such as white spaces,DEFGEN
does not include the table definition whenNOEXTATTR
is specified. IfAPPEND
mode is used in the parameter file,NOEXTATTR
is ignored, and the new table definition is appended in the existing file format, whether with the extra attributes or not. -
pauseatend | nopauseatend
-
(Windows only) When the process stops, requires an Oracle GoldenGate user to look at the console output and then strike any key to clear it. Also indicates whether the process ended normally or abnormally.
-
reportfile
report_file
-
Sends command output to the specified report file. Without the
reportfile
option, the command output is printed to the screen. -
defs_file
updatecs
charset
-
Converts the character set of a definitions file to a different character set if the file is transferred to an operating system with an incompatible character set. This procedure takes the name of the definitions file and the targeted character set as input. For example:
defgen ./dirdef/source.def
UPDATECS
UTF-8
.updatecs
helps in situations such as when a Japanese table name on Japanese Windows is written in Windows CP932 to the data-definitions file, and then the definitions file is transferred to Japanese UNIX. The file cannot be used unless the UNIX is configured in PCK locale. Thus, you must useupdatecs
to convert the encoding of the definitions file to the correct format.
Example
Following is a sample DEFGEN
parameter file,
defgenparam.prm
:
DEFSFILE /home/oracle/ogg/ora/bin/ora.defs,
PURGE useridalias oracle_source
table hr.employees;
Use the following command to call the DEFGEN
program:
.$OGG_HOME/bin/defgen PARAMFILE defgenparam.prm