spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kuassi.men...@oracle.com
Subject Re: Connecting to Oracle Autonomous Data warehouse (ADW) from Spark via JDBC
Date Wed, 26 Aug 2020 20:55:04 GMT
Fwiw here are our write-ups on Java connectivity to Database Cloud 
Services: 
https://www.oracle.com/database/technologies/appdev/jdbc-db-cloud.html

Kuassi

On 8/26/20 1:50 PM, Mich Talebzadeh wrote:
> Thanks Jorn,
>
> Only running in REPL in local mode
>
> This works fine connecting with ojdbc6.jar to Oracle 12c.
>
> cheers
>
>
>
> LinkedIn 
> /https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw 
> <https://urldefense.com/v3/__https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw__;!!GqivPVa7Brio!IpP_2AH4GdpSkFQU9bg-qm33KB7IlwXGD4CC1NmZT6m91z2iu0pJiVCPPf7YFqywtw$>/
>
>
>
> *Disclaimer:* Use it at your own risk.Any and all responsibility for 
> any loss, damage or destruction of data or any other property which 
> may arise from relying on this email's technical content is explicitly 
> disclaimed. The author will in no case be liable for any monetary 
> damages arising from such loss, damage or destruction.
>
>
>
> On Wed, 26 Aug 2020 at 21:39, Jörn Franke <jornfranke@gmail.com 
> <mailto:jornfranke@gmail.com>> wrote:
>
>     Is the directory available on all nodes ?
>
>>     Am 26.08.2020 um 22:08 schrieb kuassi.mensah@oracle.com
>>     <mailto:kuassi.mensah@oracle.com>:
>>
>>     
>>
>>     Mich,
>>
>>     All looks fine.
>>     Perhaps some special chars in username or password?
>>
>>>     it is recommended not to use such characters like '@', '.' in
>>>     your password.
>>     Best, Kuassi
>>     On 8/26/20 12:52 PM, Mich Talebzadeh wrote:
>>>     Thanks Kuassi.
>>>
>>>     This is the version of jar file that work OK with JDBC
>>>     connection via JAVA to ADW
>>>
>>>     unzip -p ojdbc8.jar META-INF/MANIFEST.MF
>>>     Manifest-Version: 1.0
>>>     Implementation-Title: JDBC
>>>     *Implementation-Version: 18.3.0.0.0*
>>>     sealed: true
>>>     Specification-Vendor: Sun Microsystems Inc.
>>>     Specification-Title: JDBC
>>>     Class-Path: oraclepki.jar
>>>     Implementation-Vendor: Oracle Corporation
>>>     Main-Class: oracle.jdbc.OracleDriver
>>>     Ant-Version: Apache Ant 1.7.1
>>>     Repository-Id: JAVAVM_18.1.0.0.0_LINUX.X64_180620
>>>     Created-By: 25.171-b11 (Oracle Corporation)
>>>     Specification-Version: 4.0
>>>
>>>     And this the setting for TNS_ADMIN
>>>
>>>     e*cho ${TNS_ADMIN}*
>>>     */home/hduser/dba/bin/ADW/DBAccess*
>>>
>>>     hduser@rhes76: /home/hduser/dba/bin/ADW/DBAccess> *cat
>>>     ojdbc.properties*
>>>     *# Connection property while using Oracle wallets.*
>>>     *oracle.net.wallet_location=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=${TNS_ADMIN})))*
>>>     *# FOLLOW THESE STEPS FOR USING JKS*
>>>     *# (1) Uncomment the following properties to use JKS.*
>>>     *# (2) Comment out the oracle.net.wallet_location property above*
>>>     *# (3) Set the correct password for both trustStorePassword and
>>>     keyStorePassword.*
>>>     *# It's the password you specified when downloading the wallet
>>>     from OCI Console or the Service Console.*
>>>     *#javax.net.ssl.trustStore=${TNS_ADMIN}/truststore.jks*
>>>     *#javax.net.ssl.trustStorePassword=<password_from_console>*
>>>     *#javax.net.ssl.keyStore=${TNS_ADMIN}/keystore.jks*
>>>     *#javax.net.ssl.keyStorePassword=<password_from_console>hduser@rhes76:
>>>     /home/hduser/dba/bin/ADW/DBAccess>*
>>>
>>>     Regards,
>>>
>>>     Mich
>>>
>>>     LinkedIn
>>>     /https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
>>>     <https://urldefense.com/v3/__https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw__;!!GqivPVa7Brio!LxAFleT1w3dN53Njh2o9xm_GtQd-d0NTouqw1mBYLroe4Byzc1nvSN0rb-cnpRttfw$>/
>>>
>>>
>>>
>>>     *Disclaimer:* Use it at your own risk.Any and all responsibility
>>>     for any loss, damage or destruction of data or any other
>>>     property which may arise from relying on this
>>>     email's technical content is explicitly disclaimed. The author
>>>     will in no case be liable for any monetary damages arising from
>>>     such loss, damage or destruction.
>>>
>>>
>>>
>>>     On Wed, 26 Aug 2020 at 20:16, <kuassi.mensah@oracle.com
>>>     <mailto:kuassi.mensah@oracle.com>> wrote:
>>>
>>>         Hi,
>>>
>>>         From which release is the ojdbc8.jar from? 12c, 18c or 19c?
>>>         I'd recommend ojdbc8.jar from the latest release.
>>>         One more thing to pay attention to is the content of the
>>>         ojdbc.properties file (part of the unzipped wallet)
>>>         Make sure that ojdbc.properties file has been configured to
>>>         use Oracle Wallet, as follows (i.e., anything related to JKS
>>>         commented out)
>>>
>>>         /oracle.net.wallet_location=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=${TNS_ADMIN})))//
>>>         //#javax.net.ssl.trustStore=${TNS_ADMIN}/truststore.jks//
>>>         //#javax.net.ssl.trustStorePassword=<password_from_console>//
>>>         //#javax.net.ssl.keyStore=${TNS_ADMIN}/keystore.jks//
>>>         //#javax.net.ssl.keyStorePassword=<password_from_console>/
>>>
>>>         Alternatively, if you want to use JKS< then you need to
>>>         comment out the firts line and un-comment the other lines
>>>         and set the values.
>>>
>>>         Kuassi
>>>
>>>         On 8/26/20 11:58 AM, Mich Talebzadeh wrote:
>>>>         Hi,
>>>>
>>>>         The connection from Spark to Oracle 12c etc are well
>>>>         established using ojdb6.jar.
>>>>
>>>>         I am attempting to connect to Oracle Autonomous Data
>>>>         warehouse (ADW) version
>>>>
>>>>         *Oracle Database 19c Enterprise Edition Release 19.0.0.0.0*
>>>>
>>>>         Oracle document suggest using ojdbc8.jar
>>>>         <https://urldefense.com/v3/__http://ojdbc8.jar__;!!GqivPVa7Brio!Msuw5mr2YjeHSLbBSlNvs8rqL7T_-eWFfdsamiYduARIsECZqEzUTG8hd-v1x8KwcQ$> to
>>>>         connect to the database with the following URL format using
>>>>         Oracle Wallet
>>>>
>>>>         "jdbc:oracle:thin:@mydb_high?TNS_ADMIN=/home/hduser/dba/bin/ADW/DBAccess"
>>>>
>>>>         This works fine through JAVA itself but throws an error
>>>>         with Spark version 2.4.3.
>>>>
>>>>         The connection string is defined as follows
>>>>
>>>>         val url =
>>>>         "jdbc:oracle:thin:@mydb_high?TNS_ADMIN=/home/hduser/dba/bin/ADW/DBAccess"
>>>>
>>>>         where DBAcess directory is the unzipped wallet for
>>>>         Wallet_mydb.zip as created by ADW connection.
>>>>
>>>>         The thing is that this works through normal connection via
>>>>         java code.using the same URL
>>>>
>>>>         So the question is whether there is a dependency in Spark
>>>>         JDBC connection to the ojdbc.
>>>>
>>>>         The error I am getting is:
>>>>
>>>>         java.sql.SQLRecoverableException: IO Error: Invalid
>>>>         connection string format, a valid format is: "host:port:sid"
>>>>             at
>>>>         oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
>>>>             at
>>>>         oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
>>>>             at
>>>>         oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
>>>>             at
>>>>         oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
>>>>             at
>>>>         oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
>>>>             at
>>>>         java.sql.DriverManager.getConnection(DriverManager.java:664)
>>>>
>>>>         This Oracle doc
>>>>         <https://docs.oracle.com/en/cloud/paas/autonomous-data-warehouse-cloud/user/connect-jdbc-thin-wallet.html#GUID-5ED3C08C-1A84-4E5A-B07A-A5114951AA9E>
>>>>         explains the connectivity.
>>>>
>>>>         The unzipped wallet has the followiing files
>>>>
>>>>          ls DBAccess/
>>>>         README cwallet.sso  ewallet.p12 keystore.jks
>>>>         ojdbc.properties sqlnet.ora  tnsnames.ora truststore.jks
>>>>
>>>>
>>>>         Thanks
>>>>
>>>>         Mich
>>>>
>>>>
>>>>
>>>>         LinkedIn
>>>>         /https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
>>>>         <https://urldefense.com/v3/__https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw__;!!GqivPVa7Brio!Msuw5mr2YjeHSLbBSlNvs8rqL7T_-eWFfdsamiYduARIsECZqEzUTG8hd-teislmnw$>/
>>>>
>>>>
>>>>
>>>>         *Disclaimer:* Use it at your own risk.Any and all
>>>>         responsibility for any loss, damage or destruction of data
>>>>         or any other property which may arise from relying on this
>>>>         email's technical content is explicitly disclaimed. The
>>>>         author will in no case be liable for any monetary damages
>>>>         arising from such loss, damage or destruction.
>>>>

Mime
View raw message