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.
-
paramfileparameter_file -
Required. Specifies the relative or absolute path name of the parameter file for the
DEFGENprogram that is being run. -
COLCHARSETcharacter_set -
Any supported character set. See
COLCHARSETfor 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.
NOEXTATTRpreventsDEFGENfrom 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,DEFGENdoes not include the table definition whenNOEXTATTRis specified. IfAPPENDmode is used in the parameter file,NOEXTATTRis 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.
-
reportfilereport_file -
Sends command output to the specified report file. Without the
reportfileoption, the command output is printed to the screen. -
defs_fileupdatecscharset -
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.defUPDATECSUTF-8.updatecshelps 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 useupdatecsto 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