Introduction
Have you ever wondered whether Oracle GoldenGate replication can work without enabling TRANDATA on individual source tables?
The answer is Yes, but it depends on the level of supplemental logging enabled at the database level and the type of DML operation being performed.
Oracle GoldenGate relies on supplemental logging to capture sufficient information from redo logs to identify and replicate changes accurately.
When database-level supplemental logging is enabled for Primary Keys, Unique Keys, Foreign Keys, or ALL columns, table-level supplemental logging may not be required for the corresponding logging information.
However, enabling extensive supplemental logging at the database level can generate additional redo and introduce performance overhead.
Oracle generally recommends enabling minimal supplemental logging at the database level and enabling the required key-column logging at the table level through GoldenGate ADD TRANDATA.
In this article, we will perform a practical demonstration to understand how GoldenGate behaves when table-level TRANDATA is removed while only minimal supplemental logging is enabled at the database level.
We will test three different DML operations:
INSERT
DELETE
UPDATE
Let's see what happens!
1. Understanding Database-Level Supplemental Logging
Before starting the demonstration, let's understand how to check the supplemental logging configuration.
For a Non-CDB Database
Execute the following query:
SELECT supplemental_log_data_min MIN,
supplemental_log_data_pk PK,
supplemental_log_data_ui UI,
supplemental_log_data_fk FK,
supplemental_log_data_all "ALL"
FROM v$database;For a Multitenant Database (CDB/PDB)
To check the database-level supplemental logging configuration across containers, execute:
SELECT *
FROM cdb_supplemental_logging;Alternatively, when connected directly to a PDB:
SELECT *
FROM dba_supplemental_logging;When database-wide supplemental logging is enabled for Primary Keys, Unique Keys, Foreign Keys, or ALL columns, the corresponding logging information can be available without separately enabling table-level supplemental logging.
However, minimal supplemental logging alone does not guarantee that all the key-column information required by GoldenGate will be captured.
This distinction is important and will become clear during our UPDATE test.
2. Environment Configuration
For this demonstration, we will use the following Oracle GoldenGate configuration.
| Component | Source | Target |
|---|---|---|
| Hostname | ora-prod01 | ora-standby01 |
| CDB | PRODCDB | STBYCDB |
| PDB | SALESPDB | DRSALESPDB |
| Schema | SALESAPP | DRSALES |
| Table | PRODUCT_MASTER | PRODUCT_MASTER |
Source GoldenGate Process Status
Let's first verify the existing Extract and Pump processes.
GGSCI> INFO ALL
Program Status Group
MANAGER RUNNING
EXTRACT RUNNING EXT_SALES
EXTRACT RUNNING PMP_SALESTarget GoldenGate Process Status
Similarly, verify the Replicat process on the target.
GGSCI> INFO ALL
Program Status Group
MANAGER RUNNING
REPLICAT RUNNING REP_SALESVerify Database Supplemental Logging
In our environment, only minimal supplemental logging is enabled at both the CDB and PDB levels.
Connect to the source database:
sqlplus / as sysdbaCheck the database name:
SELECT name FROM v$database;Example:
NAME
---------
PRODCDBCheck the available PDBs:
SHOW PDBS;Now check supplemental logging:
SELECT *
FROM CDB_SUPPLEMENTAL_LOGGING;Example output:
MIN PRI UNI FOR ALL PRO CON_ID
--- --- --- --- --- --- ----------
YES NO NO NO NO NO 1
YES NO NO NO NO NO 3As we can see, only MIN supplemental logging is enabled at the CDB and PDB levels.
Primary Key, Unique Key, Foreign Key, and ALL supplemental logging are disabled.
3. Disable Table-Level TRANDATA
Now let's check the existing supplemental logging configuration for our source table.
Connect to the source GoldenGate environment:
GGSCI> INFO TRANDATA SALESPDB.SALESAPP.PRODUCT_MASTERExample output:
Oracle Goldengate support native capture
on table SALESAPP.PRODUCT_MASTER.
Oracle Goldengate marked following column
as key columns:
PRODUCT_ID.
Logging of supplemental redo log data is enabled
for table SALESPDB.SALESAPP.PRODUCT_MASTER.
Columns supplementally logged:
"PRODUCT_ID".Now remove the table-level supplemental logging:
GGSCI> DELETE TRANDATA SALESPDB.SALESAPP.PRODUCT_MASTERVerify the configuration again:
GGSCI> INFO TRANDATA SALESPDB.SALESAPP.PRODUCT_MASTERExpected output:
Oracle Goldengate support native capture
on table SALESAPP.PRODUCT_MASTER.
Oracle Goldengate marked following column
as key columns:
PRODUCT_ID.
Logging of supplemental redo log data is disabled
for table SALESPDB.SALESAPP.PRODUCT_MASTER.Now table-level TRANDATA is disabled.
Our database still has minimal supplemental logging enabled.
Let's test how GoldenGate behaves with different DML operations.
4. Testing DML Operations Without TRANDATA
Test 1: INSERT Operation
Connect to the source PDB:
sqlplus salesapp@SALESPDBCheck the existing table records:
SELECT *
FROM product_master;Example output:
PRODUCT_ID PRODUCT_NAME LOCATION
---------- ------------------ ----------
101 LAPTOP DELHI
102 DESKTOP MUMBAI
103 SERVER BANGALORENow execute an INSERT statement:
INSERT INTO product_master
VALUES (104, 'WORKSTATION', 'NOIDA');
COMMIT;Verify the source table:
SELECT *
FROM product_master;The new record should now be visible.
Check Replicat Statistics
Connect to the target GoldenGate environment:
GGSCI> STATS REP_SALES HOURLYExample output:
Replicating from SALESPDB.SALESAPP.PRODUCT_MASTER
to DRSALESPDB.DRSALES.PRODUCT_MASTER:
Total inserts 1.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00The INSERT operation has been successfully replicated.
Verify the Target Table
Connect to the target PDB:
sqlplus drsales@DRSALESPDBExecute:
SELECT *
FROM product_master;Example output:
PRODUCT_ID PRODUCT_NAME LOCATION
---------- ------------------ ----------
101 LAPTOP DELHI
102 DESKTOP MUMBAI
103 SERVER BANGALORE
104 WORKSTATION NOIDAResult: INSERT replication works successfully without table-level TRANDATA in this test environment.
Test 2: DELETE Operation
Now let's test a DELETE operation.
Connect to the source PDB and execute:
DELETE FROM product_master
WHERE product_id = 104;
COMMIT;Check Replicat statistics:
GGSCI> STATS REP_SALES HOURLYExample output:
Replicating from SALESPDB.SALESAPP.PRODUCT_MASTER
to DRSALESPDB.DRSALES.PRODUCT_MASTER:
Total inserts 1.00
Total updates 0.00
Total deletes 1.00
Total discards 0.00
Total operations 2.00The DELETE operation has also been successfully captured and replicated.
Verify the target table:
SELECT *
FROM product_master;Example output:
PRODUCT_ID PRODUCT_NAME LOCATION
---------- ------------------ ----------
101 LAPTOP DELHI
102 DESKTOP MUMBAI
103 SERVER BANGALOREResult: DELETE replication also works successfully without table-level TRANDATA in this test environment.
Test 3: UPDATE Operation
Now comes the interesting part!
Let's execute an UPDATE statement on the source table.
UPDATE product_master
SET product_name = 'ENTERPRISE_SERVER'
WHERE product_id = 103;
COMMIT;The source database successfully executes the UPDATE.
However, when we check the target Replicat process, we notice something unexpected.
Check the Replicat statistics:
GGSCI> STATS REP_SALES HOURLYExample output:
ERROR OGG-15148
REPLICAT REP_SALES not currently running.Now check the process status:
GGSCI> INFO ALLOutput:
Program Status Group
MANAGER RUNNING
REPLICAT ABENDED REP_SALESOur Replicat process has ABENDED!
Check the Replicat Report File
Let's investigate the Replicat report file.
Example error messages:
WARNING OGG-01431
Aborted grouped transaction on
DRSALESPDB.DRSALES.PRODUCT_MASTER,
Mapping error.
WARNING OGG-01003
Repositioning to rba in trail file.
WARNING OGG-01151
Error mapping from
SALESPDB.SALESAPP.PRODUCT_MASTER
to
DRSALESPDB.DRSALES.PRODUCT_MASTER.The UPDATE operation could not be successfully applied to the target.
Why Did INSERT and DELETE Work but UPDATE Failed?
This is where supplemental logging becomes important.
An INSERT operation introduces a new row, while a DELETE operation removes an existing row. In our test, GoldenGate successfully handled both operations.
An UPDATE operation is different.
When an UPDATE statement modifies only one column, Oracle's redo information does not necessarily contain the complete identifying key information required by GoldenGate to locate the corresponding target row.
In our example:
UPDATE product_master
SET product_name = 'ENTERPRISE_SERVER'
WHERE product_id = 103;Only PRODUCT_NAME is modified.
Without the required supplemental logging, the primary key PRODUCT_ID may not be available in the redo information in the form needed by GoldenGate.
As a result, Replicat cannot reliably identify the target row and encounters a mapping error.
This is why enabling table-level supplemental logging through ADD TRANDATA is important.
5. Resolution: Re-enable Table-Level TRANDATA
Now let's resolve the issue.
Step 1: Enable TRANDATA Again
Connect to the source GoldenGate environment.
First verify the current status:
GGSCI> INFO TRANDATA SALESPDB.SALESAPP.PRODUCT_MASTEREnable table-level supplemental logging:
GGSCI> ADD TRANDATA SALESPDB.SALESAPP.PRODUCT_MASTERExample output:
INFO OGG-15132
Logging of supplemental redo data enabled.
INFO OGG-15133
TRANDATA for scheduling columns has been added.
INFO OGG-15135
TRANDATA for instantiation CSN has been added.Verify the configuration:
GGSCI> INFO TRANDATA SALESPDB.SALESAPP.PRODUCT_MASTERNow supplemental logging should be enabled for the table, including its primary key column.
Step 2: Stop the Source Extract
For this demonstration, we will stop the source Extract before performing the next UPDATE operation.
GGSCI> STOP EXT_SALESVerify:
GGSCI> INFO ALLStep 3: Execute Another UPDATE
Connect to the source PDB:
UPDATE product_master
SET product_name = 'DATABASE_SERVER'
WHERE product_id = 103;
COMMIT;The transaction is now generated after table-level supplemental logging has been enabled.
Step 4: Perform Trail Rollover
For this demonstration, we will perform a trail rollover and reposition the downstream readers to the appropriate new trail sequence.
First, verify the existing trail files:
GGSCI> SH LS -LRT ./dirdat/et*Perform trail rollover:
GGSCI> ALTER EXT_SALES ETROLLOVERRestart the Extract:
GGSCI> START EXT_SALESVerify:
GGSCI> INFO ALLA new trail file should now be created.
Check the Extract statistics:
GGSCI> STATS EXT_SALES HOURLYConfirm that the latest UPDATE transaction has been captured.
Step 5: Reposition the Data Pump
Now stop the existing Pump process:
GGSCI> STOP PMP_SALESReposition it to the appropriate new Extract trail sequence.
For example, if the new trail sequence is 3:
GGSCI> ALTER PMP_SALES EXTSEQNO 3 EXTRBA 0Start the Pump:
GGSCI> START PMP_SALESVerify:
GGSCI> INFO ALLNote: The sequence number above is illustrative. Always identify the actual trail sequence and reader position before repositioning. Do not skip transactions that must be delivered to the target.
Step 6: Reposition and Restart Replicat
Now move to the target GoldenGate environment.
Check the target trail files:
GGSCI> INFO ALLInspect the available remote trail sequences:
GGSCI> SH LS -LRT ./dirdat/rt*If the appropriate new remote trail sequence is 2, the example repositioning command is:
GGSCI> ALTER REP_SALES EXTSEQNO 2 EXTRBA 0Start Replicat:
GGSCI> START REP_SALESVerify:
GGSCI> INFO ALLExpected output:
Program Status Group
MANAGER RUNNING
REPLICAT RUNNING REP_SALESMonitor the Replicat report and statistics to confirm successful application of the UPDATE.
Step 7: Verify the Final Result
Connect to the target PDB:
sqlplus drsales@DRSALESPDBExecute:
SELECT *
FROM product_master;Expected output:
PRODUCT_ID PRODUCT_NAME LOCATION
---------- ------------------ ----------
101 LAPTOP DELHI
102 DESKTOP MUMBAI
103 DATABASE_SERVER BANGALOREThe UPDATE operation has now been successfully replicated after enabling table-level TRANDATA.
6. Summary: INSERT vs DELETE vs UPDATE Without TRANDATA
Based on our demonstration, here is the final comparison.
| DML Operation | Without Table TRANDATA | Replicat Status |
|---|---|---|
| INSERT | Successful | RUNNING |
| DELETE | Successful in this test | RUNNING |
| UPDATE | Failed (OGG-01151) | ABENDED |
The important observation is that minimal supplemental logging at the database level does not provide all the information required for reliable UPDATE replication in this scenario.
7. Key Takeaways
GoldenGate replication behavior depends on the supplemental logging configuration at both database and table levels.
Minimal supplemental logging alone does not guarantee that primary key columns are supplementally logged for every table.
INSERT operations worked successfully in our demonstration without table-level TRANDATA.
DELETE operations also worked successfully in our demonstration.
UPDATE operations failed because GoldenGate did not have the required key-column information to identify the target row.
Enabling
ADD TRANDATAensures that the required key-column information is available for GoldenGate replication.Always verify the actual redo logging and GoldenGate report before making assumptions about replication behavior.
Conclusion
Can Oracle GoldenGate replication work without enabling table-level TRANDATA?
Yes, in certain scenarios. But should we rely on it in a production environment? Definitely not without understanding the supplemental logging requirements.
Our demonstration clearly shows that INSERT and DELETE operations were successfully replicated with only minimal supplemental logging, whereas the UPDATE operation caused Replicat to ABEND.
The safest and recommended approach is to enable minimal supplemental logging at the database level and use GoldenGate ADD TRANDATA to enable the required supplemental logging at the individual table level.
This ensures that GoldenGate has the necessary key-column information to identify and replicate row changes reliably.
Remember: Successful INSERT and DELETE replication does not necessarily mean your GoldenGate supplemental logging configuration is complete. Always test UPDATE operations as well!