-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix][Connectors V2][CDC Oracle] oracle run in cdb+pdb mode, fix ORA-… #8958
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @screnwei . Please add test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue with CDC Oracle by enabling the connector to run in both CDB and PDB modes, addressing the ORA-00942 error.
- Added a SQL constant and utility method in OracleConnectionUtils to fetch the current container name from the Oracle server.
- Updated OracleSnapshotSplitReadTask to switch the session to a designated PDB when the container name is "cdb$root".
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/oracle/utils/OracleConnectionUtils.java | Added SHOW_CON_NAME constant and new method getCurrentContainerName to retrieve the container name. |
seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/oracle/source/reader/fetch/scan/OracleSnapshotSplitReadTask.java | Added logic to use the container name and set the session to PDB if necessary. |
throw new SeaTunnelException( | ||
"Cannot read the container name via '" | ||
+ SHOW_CON_NAME | ||
+ "'. Makesure your server is correctly configured"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in error message: 'Makesure' should be 'Make sure'.
+ "'. Makesure your server is correctly configured"); | |
+ "'. Make sure your server is correctly configured"); |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
throw new SeaTunnelException( | ||
"Cannot read the container name via '" | ||
+ SHOW_CON_NAME | ||
+ "'. Makesure your server is correctly configured", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in error message: 'Makesure' should be 'Make sure'.
+ "'. Makesure your server is correctly configured", | |
+ "'. Make sure your server is correctly configured", |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -164,6 +165,13 @@ protected SnapshottingTask getSnapshottingTask( | |||
@Override | |||
protected SnapshotContext<OraclePartition, OracleOffsetContext> prepare( | |||
OraclePartition partition) throws Exception { | |||
String currentContainerName = OracleConnectionUtils.getCurrentContainerName(jdbcConnection); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to change this code?
For pdb you need to add configuration
source {
Oracle-CDC {
......
debezium {
database.pdb.name = "your pdb name"
}
}
}
…00942 error
Purpose of this pull request
Fix #8463
Does this PR introduce any user-facing change?
How was this patch tested?
I tested on my own mac pc.
Check list
New License Guide
release-note
.