Enabling Table-level Supplemental Logging
Enable table-level supplemental logging on the source system in the following cases:
-
To enable the required level of logging when not using schema-level logging (see Enabling Schema-level Supplemental Logging). Either schema-level or table-level logging must be used. By default, table-level logging automatically enables unconditional supplemental logging of the primary key and conditional supplemental logging of unique key(s) and foreign key(s) of a table. Options enable you to alter the logging as needed.
-
To prevent the logging of the primary key for any given table.
-
To log non-key column values at the table level to support specific Oracle GoldenGate features, such as filtering and conflict detection and resolution logic.
-
If the key columns change on a table that only has table-level supplemental logging, you must perform
ADD TRANDATAon the table prior to allowing any DML activity on the table.
Perform the following steps on the source system to enable table-level supplemental logging or use the optional features of the command.
-
Run the command line on the source system.
-
Issue the
DBLOGINcommand using the alias of a user in the credential store who has privilege to enable table-level supplemental logging.DBLOGIN USERIDALIAS aliasSee
USERIDALIASin Parameters and Functions Reference for Oracle GoldenGatefor more information aboutDBLOGINand additional options. -
Issue the
ADD TRANDATAcommand.ADD TRANDATA [PDB.]schema.table [, COLS (columns)] [, NOKEY] [, ALLCOLS | NOSCHEDULINGCOLS]Where:
-
PDBis the name of the root container or pluggable database if the table is in a multitenant container database. -
schemais the source schema that contains the table. -
tableis the name of the table. See Specifying Object Names in Oracle GoldenGate Input for instructions for specifying object names. -
ADD TRANDATAwithout other options automatically enables unconditional supplemental logging of the primary key and conditional supplemental logging of unique key(s) and foreign key(s) of the table. Unconditional logging forces the primary key values to the log whether or not the key was changed in the current operation. Conditional logging logs all of the column values of a foreign or unique key if at least one of them was changed in the current operation. The default is optional to support nonintegrated Replicat (see alsoNOSCHEDULINGCOLS) but is required to support integrated Replicat because primary key, unique keys, and foreign keys must all be available to the inbound server to compute dependencies. For more information about integrated Replicat, see Deciding Which Replicat Method to Use. -
ALLCOLSenables the unconditional supplemental logging of all of the columns of the table. Use to support integrated Replicat when the source and target tables have different scheduling columns. (Scheduling columns are the primary key, the unique key, and the foreign key.) -
NOSCHEDULINGCOLSis valid for Replicat in nonintegrated mode only. It issues anALTER TABLEcommand with anADD SUPPLEMENTAL LOG DATA ALWAYSclause that is appropriate for the type of unique constraint that is defined for the table, or all columns in the absence of a unique constraint. This command satisfies the basic table-level logging requirements of Oracle GoldenGate when schema-level logging will not be used. See Ensuring Row Uniqueness in Source and Target Tables for how Oracle GoldenGate selects a key or index. -
COLScolumnslogs non-key columns that are required for aKEYCOLSclause or for filtering and manipulation. The parentheses are required. These columns will be logged in addition to the primary key unless theNOKEYoption is also present. -
NOKEYprevents the logging of the primary key or unique key. Requires aKEYCOLSclause in theTABLEandMAPparameters and aCOLSclause in theADD TRANDATAcommand to log the alternateKEYCOLScolumns.
-
-
If using
ADD TRANDATAwith theCOLSoption, create a unique index for those columns on the target to optimize row retrieval. If you are logging those columns as a substitute key for aKEYCOLSclause, make a note to add theKEYCOLSclause to theTABLEandMAPstatements when you configure the Oracle GoldenGate processes.