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 TRANDATA
on 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
DBLOGIN
command using the alias of a user in the credential store who has privilege to enable table-level supplemental logging.DBLOGIN USERIDALIAS alias
See
USERIDALIAS
in Reference for Oracle GoldenGatefor more information aboutDBLOGIN
and additional options. -
Issue the
ADD TRANDATA
command.ADD TRANDATA [PDB.]schema.table [, COLS (columns)] [, NOKEY] [, ALLCOLS | NOSCHEDULINGCOLS]
Where:
-
PDB
is the name of the root container or pluggable database if the table is in a multitenant container database. -
schema
is the source schema that contains the table. -
table
is the name of the table. See Specifying Object Names in Oracle GoldenGate Input for instructions for specifying object names. -
ADD TRANDATA
without 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. -
ALLCOLS
enables 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.) -
NOSCHEDULINGCOLS
is valid for Replicat in nonintegrated mode only. It issues anALTER TABLE
command with anADD SUPPLEMENTAL LOG DATA ALWAYS
clause 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. -
COLS
columns
logs non-key columns that are required for aKEYCOLS
clause or for filtering and manipulation. The parentheses are required. These columns will be logged in addition to the primary key unless theNOKEY
option is also present. -
NOKEY
prevents the logging of the primary key or unique key. Requires aKEYCOLS
clause in theTABLE
andMAP
parameters and aCOLS
clause in theADD TRANDATA
command to log the alternateKEYCOLS
columns.
-
-
If using
ADD TRANDATA
with theCOLS
option, 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 aKEYCOLS
clause, make a note to add theKEYCOLS
clause to theTABLE
andMAP
statements when you configure the Oracle GoldenGate processes.