<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Connect SPARK with Oracle Databank in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-SPARK-with-Oracle-Databank/m-p/222746#M72553</link>
    <description>&lt;P&gt;Hi bkosaraju,&lt;/P&gt;&lt;P&gt;it works, thank you very much!&lt;/P&gt;&lt;P&gt;If I wanna use the same comand in Zeppelin I need the ojdbc.jar. Do you know how I have to set the Classpath to the jar?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Greatings Mario&lt;/P&gt;</description>
    <pubDate>Wed, 13 Dec 2017 17:06:06 GMT</pubDate>
    <dc:creator>mario_borys</dc:creator>
    <dc:date>2017-12-13T17:06:06Z</dc:date>
    <item>
      <title>Connect SPARK with Oracle Databank</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-SPARK-with-Oracle-Databank/m-p/222744#M72551</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to Connect Spark with my Company Database and I'm getting this Error through Shell.&lt;/P&gt;&lt;P&gt;[hdfs@sandbox /]$ /usr/hdp/current/spark-client/bin/spark-shell --driver-class-path /usr/hdp/current/spark-client/lib/ojdbc8.jar&lt;/P&gt;&lt;P&gt;scala&amp;gt; val sqlContext = new org.apache.spark.sql.SQLContext(sc)&lt;/P&gt;&lt;P&gt;scala&amp;gt; val Connector = sqlContext.read.format("jdbc").options(Map("url" -&amp;gt; "jdbc:oracle:thin:@xxx.xxx.xxx:xxxx:xxxxxxxxxxxxxxxx?user=USERNAME&amp;amp;password=PASSWORD","dbtable" -&amp;gt; "PROCESS_DATA")).load().show()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;java.sql.SQLException: Listener refused the connection with the following error:&lt;BR /&gt;ORA-12505, TNS:listener does not currently know of SID given in connect descriptor&lt;BR /&gt;&lt;BR /&gt;  at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:774)&lt;BR /&gt;  at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688)&lt;BR /&gt;  at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39)&lt;BR /&gt;  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691)&lt;BR /&gt;  at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$createConnectionFactory$2.apply(JdbcUtils.scala:61)&lt;BR /&gt;  at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$createConnectionFactory$2.apply(JdbcUtils.scala:52)&lt;BR /&gt;  at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:120)&lt;BR /&gt;  at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation.&amp;lt;init&amp;gt;(JDBCRelation.scala:91)&lt;BR /&gt;  at org.apache.spark.sql.execution.datasources.jdbc.DefaultSource.createRelation(DefaultSource.scala:57)&lt;BR /&gt;  at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.apply(ResolvedDataSource.scala:158)&lt;BR /&gt;  at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:119)&lt;BR /&gt;  at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.&amp;lt;init&amp;gt;(&amp;lt;console&amp;gt;:29)&lt;BR /&gt;  at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.&amp;lt;init&amp;gt;(&amp;lt;console&amp;gt;:34)&lt;BR /&gt;  at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC.&amp;lt;init&amp;gt;(&amp;lt;console&amp;gt;:36)&lt;BR /&gt;  at $iwC$$iwC$$iwC$$iwC$$iwC.&amp;lt;init&amp;gt;(&amp;lt;console&amp;gt;:38)&lt;BR /&gt;  at $iwC$$iwC$$iwC$$iwC.&amp;lt;init&amp;gt;(&amp;lt;console&amp;gt;:40)&lt;BR /&gt;  at $iwC$$iwC$$iwC.&amp;lt;init&amp;gt;(&amp;lt;console&amp;gt;:42)&lt;BR /&gt;  at $iwC$$iwC.&amp;lt;init&amp;gt;(&amp;lt;console&amp;gt;:44)&lt;BR /&gt;  at $iwC.&amp;lt;init&amp;gt;(&amp;lt;console&amp;gt;:46)&lt;BR /&gt;  at &amp;lt;init&amp;gt;(&amp;lt;console&amp;gt;:48)&lt;BR /&gt;  at .&amp;lt;init&amp;gt;(&amp;lt;console&amp;gt;:52)&lt;BR /&gt;  at .&amp;lt;clinit&amp;gt;(&amp;lt;console&amp;gt;)&lt;BR /&gt;  at .&amp;lt;init&amp;gt;(&amp;lt;console&amp;gt;:7)&lt;BR /&gt;  at .&amp;lt;clinit&amp;gt;(&amp;lt;console&amp;gt;)&lt;BR /&gt;  at $print(&amp;lt;console&amp;gt;)&lt;BR /&gt;  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;BR /&gt;  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)&lt;BR /&gt;  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)&lt;BR /&gt;  at java.lang.reflect.Method.invoke(Method.java:498)&lt;BR /&gt;  at org.apache.spark.repl.SparkIMain$ReadEvalPrint.call(SparkIMain.scala:1065)&lt;BR /&gt;  at org.apache.spark.repl.SparkIMain$Request.loadAndRun(SparkIMain.scala:1346)&lt;BR /&gt;  at org.apache.spark.repl.SparkIMain.loadAndRunReq$1(SparkIMain.scala:840)&lt;BR /&gt;  at org.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:871)&lt;BR /&gt;  at org.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:819)&lt;BR /&gt;  at org.apache.spark.repl.SparkILoop.reallyInterpret$1(SparkILoop.scala:857)&lt;BR /&gt;  at org.apache.spark.repl.SparkILoop.interpretStartingWith(SparkILoop.scala:902)&lt;BR /&gt;  at org.apache.spark.repl.SparkILoop.command(SparkILoop.scala:814)&lt;BR /&gt;  at org.apache.spark.repl.SparkILoop.processLine$1(SparkILoop.scala:657)&lt;BR /&gt;  at org.apache.spark.repl.SparkILoop.innerLoop$1(SparkILoop.scala:665)&lt;BR /&gt;  at org.apache.spark.repl.SparkILoop.org$apache$spark$repl$SparkILoop$$loop(SparkILoop.scala:670)&lt;BR /&gt;  at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply$mcZ$sp(SparkILoop.scala:997)&lt;BR /&gt;  at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply(SparkILoop.scala:945)&lt;BR /&gt;  at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply(SparkILoop.scala:945)&lt;BR /&gt;  at scala.tools.nsc.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:135)&lt;BR /&gt;  at org.apache.spark.repl.SparkILoop.org$apache$spark$repl$SparkILoop$$process(SparkILoop.scala:945)&lt;BR /&gt;  at org.apache.spark.repl.SparkILoop.process(SparkILoop.scala:1059)&lt;BR /&gt;  at org.apache.spark.repl.Main$.main(Main.scala:31)&lt;BR /&gt;  at org.apache.spark.repl.Main.main(Main.scala)&lt;BR /&gt;  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;BR /&gt;  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)&lt;BR /&gt;  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)&lt;BR /&gt;  at java.lang.reflect.Method.invoke(Method.java:498)&lt;BR /&gt;  at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:750)&lt;BR /&gt;  at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)&lt;BR /&gt;  at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)&lt;BR /&gt;  at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)&lt;BR /&gt;  at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)&lt;BR /&gt;Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error:&lt;BR /&gt;ORA-12505, TNS:listener does not currently know of SID given in connect descriptor&lt;BR /&gt;&lt;BR /&gt;  at oracle.net.ns.NSProtocolNIO.negotiateConnection(NSProtocolNIO.java:271)&lt;BR /&gt;  at oracle.net.ns.NSProtocol.connect(NSProtocol.java:317)&lt;BR /&gt;  at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1438)&lt;BR /&gt;  at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:518)&lt;BR /&gt;  ... 56 more&lt;/P&gt;&lt;P&gt;--- I think therefore I need to set the SID in the Database ? Someone a clue ? &lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 20:55:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-SPARK-with-Oracle-Databank/m-p/222744#M72551</guid>
      <dc:creator>mario_borys</dc:creator>
      <dc:date>2017-12-11T20:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Connect SPARK with Oracle Databank</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-SPARK-with-Oracle-Databank/m-p/222745#M72552</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/49152/marioborys.html" nodeid="49152"&gt;@Mario Borys&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;The error is oiginated from Database front as the Connection URL doesn't consists of the SID information.&lt;/P&gt;&lt;P&gt;as per the driver URL &lt;A target="_blank" href="https://docs.oracle.com/cd/E11882_01/appdev.112/e13995/oracle/jdbc/OracleDriver.html"&gt;documentation&lt;/A&gt;, we must provide the SID information in along with the port number.&lt;/P&gt;&lt;P&gt;so the new URL look like &lt;/P&gt;&lt;PRE&gt;"url" -&amp;gt; "jdbc:oracle:thin:&amp;lt;userName&amp;gt;/&amp;lt;Password&amp;gt;@&amp;lt;ip/hostname&amp;gt;:&amp;lt;port num ex: 1521&amp;gt;:&amp;lt;SID name&amp;gt;"
or

"url" -&amp;gt; "jdbc:oracle:thin:@&amp;lt;ip/hostname&amp;gt;:&amp;lt;port num ex: 1521&amp;gt;:&amp;lt;SID name&amp;gt;?user=USERNAME&amp;amp;password=PASSWORD" //for password with special charectorys&lt;/PRE&gt;&lt;P&gt;Hope this helps!!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 08:40:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-SPARK-with-Oracle-Databank/m-p/222745#M72552</guid>
      <dc:creator>bkosaraju</dc:creator>
      <dc:date>2017-12-13T08:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Connect SPARK with Oracle Databank</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-SPARK-with-Oracle-Databank/m-p/222746#M72553</link>
      <description>&lt;P&gt;Hi bkosaraju,&lt;/P&gt;&lt;P&gt;it works, thank you very much!&lt;/P&gt;&lt;P&gt;If I wanna use the same comand in Zeppelin I need the ojdbc.jar. Do you know how I have to set the Classpath to the jar?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Greatings Mario&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 17:06:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-SPARK-with-Oracle-Databank/m-p/222746#M72553</guid>
      <dc:creator>mario_borys</dc:creator>
      <dc:date>2017-12-13T17:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Connect SPARK with Oracle Databank</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-SPARK-with-Oracle-Databank/m-p/222747#M72554</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/49152/marioborys.html" nodeid="49152"&gt;@Mario Borys&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Glad that it helped !!, by accepting the solution other HCC users find the answer directly.&lt;/P&gt;&lt;P&gt;now on to your other question, Yes it is possible by adding the spark.jars argument in interpreter configuration with ojdbc dirver jar file.&lt;/P&gt;&lt;P&gt;after you can create the context with same process how you did for the command line &lt;/P&gt;&lt;P&gt;more on how to configure Interpreter can be found at &lt;A target="_blank" href="https://zeppelin.apache.org/docs/latest/interpreter/spark.html#2-loading-spark-properties "&gt;here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 08:45:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-SPARK-with-Oracle-Databank/m-p/222747#M72554</guid>
      <dc:creator>bkosaraju</dc:creator>
      <dc:date>2017-12-18T08:45:21Z</dc:date>
    </item>
  </channel>
</rss>

