You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/09/15 12:16:25 UTC

[GitHub] [shardingsphere] stevefan1999-personal opened a new issue #7465: Unable to connect to Oracle Autonomous Database using TNS alias

stevefan1999-personal opened a new issue #7465:
URL: https://github.com/apache/shardingsphere/issues/7465


   ### Which version of ShardingSphere did you use?
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   `version.org.apache.shardingsphere..sharding-jdbc-spring-boot-starter=4.1.1`
   
   ### Expected behavior
   It should run
   
   ### Actual behavior
   Hikari can connect to the DB and start data sourcing/pooling, but because this particular style of connection string (TNS alias) is not conventional, ShardingSphere validator regex for Oracle fails to accept it.
   
   Caused by: org.apache.shardingsphere.underlying.common.database.metadata.UnrecognizedDatabaseURLException: The URL: 'jdbc:oracle:thin:@db202008101919_high' is not recognized. Please refer to this pattern: 'jdbc:oracle:(thin|oci|kprb):@(//)?([\w\-\.]+):?([0-9]*)[:/]([\w\-]+)'.
   
   
   I tried to add some minimal changes to match the regex, like appending '/' or ':' to the end and add '-' as Oracle doesn't really have the concept of multiple databases (like Postgres it is user per database). It looks like this:
   ```
   jdbc:oracle:thin:@db202008101919_high/-
   jdbc:oracle:thin:@db202008101919_high:-
   ```
   But then Hikari fails to connect
   
   ### Reason analyze (If you can)
   Obviously the regex only accounts for sqlplus style connection string
   
   https://docs.oracle.com/en/cloud/paas/autonomous-data-warehouse-cloud/user/connect-jdbc-thin-wallet.html#GUID-1640CC02-BF3E-48C2-8FFE-A596614A6A40
   
   But autonomous database use TNS alias style instead
   
   ### Possible fix
   Change the regex from 
   `jdbc:oracle:(thin|oci|kprb):@(//)?([\w\-\.]+):?([0-9]*)[:/]([\w\-]+)`
   to
   `jdbc:oracle:(thin|oci|kprb):@(//)?([\w\-\.]+):?([0-9]*)[:/]?([\w\-]+)`
   
   But this could potentially break existing application (I guess)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   This is my partial application.yml
   ```yaml
   spring:
     shardingsphere:
       datasource:
         names: ds0,ds1
         ds0:
           driver-class-name: oracle.jdbc.OracleDriver
           jdbcUrl: jdbc:oracle:thin:@db202008101919_high
           password: attack at dawn
           type: com.zaxxer.hikari.HikariDataSource
           username: admin
         ds1:
           driver-class-name: oracle.jdbc.OracleDriver
           jdbcUrl: jdbc:oracle:thin:@db202008101919_low
           password: attack at dawn
           type: com.zaxxer.hikari.HikariDataSource
           username: admin
   ```
   
   ### Workaround
   - Downgrade to 3.x
   - Manually replace all connection details to be like other normal connection string
   - Wait for 5.x to release and use https://github.com/apache/shardingsphere/issues/7195


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] RaigorJiang closed issue #7465: Unable to connect to Oracle Autonomous Database using TNS alias

Posted by GitBox <gi...@apache.org>.
RaigorJiang closed issue #7465:
URL: https://github.com/apache/shardingsphere/issues/7465


   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] stevefan1999-personal commented on issue #7465: Unable to connect to Oracle Autonomous Database using TNS alias

Posted by GitBox <gi...@apache.org>.
stevefan1999-personal commented on issue #7465:
URL: https://github.com/apache/shardingsphere/issues/7465#issuecomment-693197693


   @menghaoranss I can use bintray in gradle to get the master branch build or? 5.x is not yet released in Maven so I don't actually know where it is.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #7465: Unable to connect to Oracle Autonomous Database using TNS alias

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #7465:
URL: https://github.com/apache/shardingsphere/issues/7465#issuecomment-693146204


   hi, @stevefan1999-personal thanks for your issue.
   #7195 has been fixed already. Plus, you can check the relevant PR of that issue to learn how to fix it. Do you think that is entirely the same with your question?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #7465: Unable to connect to Oracle Autonomous Database using TNS alias

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #7465:
URL: https://github.com/apache/shardingsphere/issues/7465#issuecomment-694621952


   > I downgraded from 4.1.0 to 4.0.1, and using TNS alias connection style it works. So, I would like you to mark it as a regression?
   
   @stevefan1999-personal That's strange and not what we expected. Do you think it is possible to glance at them and find some differences?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] menghaoranss commented on issue #7465: Unable to connect to Oracle Autonomous Database using TNS alias

Posted by GitBox <gi...@apache.org>.
menghaoranss commented on issue #7465:
URL: https://github.com/apache/shardingsphere/issues/7465#issuecomment-693142693


   @stevefan1999-personal Have you try with the master branch?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] RaigorJiang commented on issue #7465: Unable to connect to Oracle Autonomous Database using TNS alias

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #7465:
URL: https://github.com/apache/shardingsphere/issues/7465#issuecomment-926740722


   Since this issue has been inactive for more than 1 year, we will close it. 
   If you still have related questions, please submit a new issue, thank you.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] stevefan1999-personal commented on issue #7465: Unable to connect to Oracle Autonomous Database using TNS alias

Posted by GitBox <gi...@apache.org>.
stevefan1999-personal commented on issue #7465:
URL: https://github.com/apache/shardingsphere/issues/7465#issuecomment-694035099


   @tristaZero I downgraded from 4.1.0 to 4.0.1, and using TNS alias connection style it works. So, I would like you to mark it as a regression?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #7465: Unable to connect to Oracle Autonomous Database using TNS alias

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #7465:
URL: https://github.com/apache/shardingsphere/issues/7465#issuecomment-693779011


   Hi @stevefan1999-personal 
   > I can use bintray in gradle to get the master branch build or?
   Yep, you can build it by yourself. But what the master branch fixed is precisely this one, namely #7195.
   If you think #7195 is not your target, then there is no need to build it.
   
   BTW, do your Oracle URL configuration is in line with Oracle's official supported format? Are there links or docs concerning it?
   
   If it is certainly a correct and standard configuration format, I suppose we need to cover it. 
   
   @stevefan1999-personal Are you interested in fixing it? 
   Looking forward to your reply.
   
   Best,
   Trista
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] stevefan1999-personal commented on issue #7465: Unable to connect to Oracle Autonomous Database using TNS alias

Posted by GitBox <gi...@apache.org>.
stevefan1999-personal commented on issue #7465:
URL: https://github.com/apache/shardingsphere/issues/7465#issuecomment-693197100


   @tristaZero no, that is not exactly the fix. however, i can copy the RAC entry of the alias in the TNS file respectively, that's why I should have had said it is more likely to be a workaround in the beginning...


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] stevefan1999-personal closed issue #7465: Unable to connect to Oracle Autonomous Database using TNS alias

Posted by GitBox <gi...@apache.org>.
stevefan1999-personal closed issue #7465:
URL: https://github.com/apache/shardingsphere/issues/7465


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org