chenyz1984 commented on issue #8463:
URL: https://github.com/apache/seatunnel/issues/8463#issuecomment-2577687061
> 因为我身边无使用CDB+PDB模式的数据库实例,无法验证你的问题。 根据我的理解你可以尝试一个修改点:
把表名前缀的database名改为:CDB的名称:ORA19C (需为大写) 原因是:在源码中获取database列表的查询语句为:
>
> ```java
> @Override
> protected String getListDatabaseSql() {
> return "SELECT name FROM v$database";
> }
> ```
>
> 该查询只会得到 CDB名称。
>
> 同时连接数据库的 base-url 把'/' 改为':'
>
> ```shell
> base-url = "jdbc:oracle:thin:@//10.0.6.53:1521:ora19c"
> ```
>
> 原因是源码中在拼接连接串时,会自动拼接/:
>
> ```java
> protected String getUrlFromDatabaseName(String databaseName) {
> String url = baseUrl.endsWith("/") ? baseUrl : baseUrl + "/";
> return url + databaseName + suffix;
> }
> ```
>
> 错误可能和这里有关。
>
> 配置项:
>
> ```
> source {
> Oracle-CDC {
> driver = "oracle.jdbc.driver.OracleDriver"
> base-url = "jdbc:oracle:thin:@//10.0.6.53:1521:ora19c" # 此处不区分大小写
> username = "c##logminer"
> password = "logminer"
> database-names = ["PDB1"] # 监控的 db 列表
> schema-names = ["PROVINCE_LNJY"] # 监控的 schema 列表
> table-names = ["ORA19C.PROVINCE_LNJY.MY_OBJECTS"] # 监控的 table
列表,需含库名前缀,使用CDB名称
> use_select_count = true
> result_table_name = "customers"
> source.reader.close.timeout = 120000
> connection.pool.size = 1
> schema-changes.enabled = true # 启用 schema evolution 功能
> }
> }
> ```
我的问题解决了,明天到公司给您贴我最终用的配置。以及列一下在各种尝试过程中,踩到的其他坑。经过实践,国产开源产品远没有宣传中所描述的那么强大啊。文档里各种坑。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]