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 the DEFGEN utility to generate source table metadata definitions, which can be used by a Replicat to read from a trail file that is in a format release older than Oracle GoldenGate 12.2 and that does not contain source table metadata. The DEFGEN program is installed in Oracle GoldenGate’s home, bin directory.

Syntax for Windows, UNIX, and Linux

defgen PARAMFILE parameter_file 
[NOEXTATTR]
[PAUSEATEND | NOPAUSEATEND]
[REPORTFILE report_file]
[UPDATECS characterset ]
PARAMFILE parameter_file

Required. Specifies the relative or absolute path name of the parameter file for the DEFGEN program that is being run. The parameter file must be created manually and will list a defs file for table definition output, database connection information, and which tables to generate definitions.

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 prevents DEFGEN 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 when NOEXTATTR is specified. If APPEND 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 (default)

(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 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 use UPDATECS to convert the encoding of the definitions file to the correct format.

Example

The following is a sample DEFGEN parameter file, defgenparam.prm. See the DEFSFILE parameter for details.

DEFSFILE /home/oracle/ogg/ora/bin/ora.defs, PURGE
USERIDALIAS oracle_source
TABLE hr.employees;

Use the following command to run the DEFGEN program:

$OGG_HOME/bin/defgen PARAMFILE defgenparam.prm