<?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>topic Re: Unable to use CX_Oracle library in notebook in Warehousing &amp; Analytics</title>
    <link>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/23953#M576</link>
    <description>&lt;P&gt;Hello @Manoj Hegde​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your suggestion. I used the script and the error disappeared. Hurray!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jun 2022 10:39:51 GMT</pubDate>
    <dc:creator>AshvinManoj</dc:creator>
    <dc:date>2022-06-14T10:39:51Z</dc:date>
    <item>
      <title>Unable to use CX_Oracle library in notebook</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/23949#M572</link>
      <description>&lt;P&gt;While using cx_oracle python library, it returns the below error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;error message: Cannot locate a 64-bit Oracle Client library: "&lt;A href="http://libclntsh.so/" target="_blank" rel="noopener"&gt;libclntsh.so&lt;/A&gt;: cannot open shared object file: No such file or directory&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The cx_oracle library is dependent on native libraries like&amp;nbsp;&lt;A href="http://libclntsh.so/" target="_blank" rel="noopener"&gt;libclntsh.so&lt;/A&gt;. There is an instant client required to use the cx_oracle library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This often breaks due to the unavailability of the instant client or missing this library in the path variable.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 12:59:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/23949#M572</guid>
      <dc:creator>User16753724663</dc:creator>
      <dc:date>2025-03-21T12:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use CX_Oracle library in notebook</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/23950#M573</link>
      <description>&lt;P&gt;To fix this issue, we can use the below init script to download the instant client and add that in the path variable.&amp;nbsp;Sometimes the dynamic linker run-time cache needs to be refreshed, especially if there are native libraries that have cross dependencies, and they were placed on the machine before the LD_LIBRARY_PATH was set. In this case, run ldconfig -v /path/to/native/libs before attempting to load the native library from Java.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample init script that would help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1: Create the base directory you want to store the init script ( assuming&amp;nbsp;it does not exist.)&amp;nbsp;Here we use dbfs:/databricks/&amp;lt;directory&amp;gt; as an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbutils.fs.mkdirs("dbfs:/databricks/&amp;lt;directory&amp;gt;/")&lt;/P&gt;&lt;P&gt;Step 2 :&amp;nbsp;Create the script&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
&amp;nbsp;
dbutils.fs.put("dbfs:/databricks/oracleTest/oracle_ctl.sh","""
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
#!/bin/bash
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
#Download instant client archived file and update the url in case of different #version
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
wget --quiet-O /tmp/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip &lt;A href="https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip" target="test_blank"&gt;https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip&lt;/A&gt;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
unzip /tmp/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip -d /databricks/driver/oracle_ctl/
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
sudo echo 'export LD_LIBRARY_PATH="/databricks/driver/oracle_ctl/"' &amp;gt;&amp;gt; /databricks/spark/conf/spark-env.sh
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
sudo echo 'export ORACLE_HOME="/databricks/driver/oracle_ctl/"' &amp;gt;&amp;gt; /databricks/spark/conf/spark-env.sh
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
""", True)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3: Verify that the script exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;display(&lt;A href="http://dbutils.fs.ls/" alt="http://dbutils.fs.ls/" target="_blank"&gt;dbutils.fs.ls&lt;/A&gt;("dbfs:/databricks/&amp;lt;directory&amp;gt;/oracle_ctl&lt;A href="http://private-pypi-install.sh/" alt="http://private-pypi-install.sh/" target="_blank"&gt;.sh&lt;/A&gt;"))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 4. Configure a cluster-scoped init script in the cluster&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;On the cluster configuration page, click the Advanced Options toggle.&lt;/LI&gt;&lt;LI&gt;At the bottom of the page, click the Init Scripts tab.&lt;/LI&gt;&lt;LI&gt;In the Destination drop-down, select DBFS, provide the file path to the script, and click Add.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 5: Restart the cluster&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 16:11:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/23950#M573</guid>
      <dc:creator>User16753724663</dc:creator>
      <dc:date>2021-06-16T16:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use CX_Oracle library in notebook</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/23951#M574</link>
      <description>&lt;P&gt;This did not work for me. I get an error as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;U&gt; DPI-1047: Cannot locate a 64-bit Oracle Client library: "/databricks/driver/oracle_ctl//lib/libclntsh.so: cannot open shared object file: No such file or directory".&lt;/U&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I tried to check for the directory using dbutils.f.ls("&lt;I&gt;&lt;U&gt;/databricks/driver/oracle_ctl&lt;/U&gt;&lt;/I&gt;") I am not able to find that directory. May be the init script is not copying the client as expected. So I also manually downloaded the Oracle client and mapped it to my cluster by creating a location as "&lt;I&gt;/databricks/driver/oracle_ctl/", &lt;/I&gt;still no success. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I noticed that the error is pointing to a location "....&lt;I&gt;&lt;U&gt;/oracle_ctl//lib/libclntsh&lt;/U&gt;&lt;/I&gt;". When I inspected the downloaded client, I am not able to find any folder called &lt;I&gt;&lt;U&gt;/lib/libclntsh.&lt;/U&gt;&lt;/I&gt;&lt;U&gt; &lt;/U&gt; May be its pointing to a wrong directory because of any recent changes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any helps is appreciated to connect to Oracle database in on premises system.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 06:59:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/23951#M574</guid>
      <dc:creator>AshvinManoj</dc:creator>
      <dc:date>2022-06-14T06:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use CX_Oracle library in notebook</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/23952#M575</link>
      <description>&lt;P&gt;Hi @Manoj Ashvin​&amp;nbsp;can you use the below init script and try ? &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;dbutils.fs.put("dbfs:/databricks/oracleTest/oracle_ctl_new.sh","""
&amp;nbsp;
#!/bin/bash
sudo apt-get install libaio1
wget --quiet -O /tmp/instantclient-basiclite-linuxx64.zip &lt;A href="https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip" target="test_blank"&gt;https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip&lt;/A&gt;
unzip /tmp/instantclient-basiclite-linuxx64.zip -d /databricks/driver/oracle_ctl/
mv /databricks/driver/oracle_ctl/instantclient* /databricks/driver/oracle_ctl/instantclient
sudo echo 'export LD_LIBRARY_PATH="/databricks/driver/oracle_ctl/instantclient/"' &amp;gt;&amp;gt; /databricks/spark/conf/spark-env.sh
sudo echo 'export ORACLE_HOME="/databricks/driver/oracle_ctl/instantclient/"' &amp;gt;&amp;gt; /databricks/spark/conf/spark-env.sh 
 
""", True)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 10:01:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/23952#M575</guid>
      <dc:creator>User16752245772</dc:creator>
      <dc:date>2022-06-14T10:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use CX_Oracle library in notebook</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/23953#M576</link>
      <description>&lt;P&gt;Hello @Manoj Hegde​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your suggestion. I used the script and the error disappeared. Hurray!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 10:39:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/23953#M576</guid>
      <dc:creator>AshvinManoj</dc:creator>
      <dc:date>2022-06-14T10:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use CX_Oracle library in notebook</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/101060#M1735</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/46678"&gt;@AshvinManoj&lt;/a&gt;&amp;nbsp; I used your script and still get same error.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sudo echo &lt;/SPAN&gt;&lt;SPAN&gt;'LD_LIBRARY_PATH="/dbfs/databricks/instantclient_23_6"'&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt;&amp;gt; /databricks/spark/conf/spark-env.sh&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sudo echo &lt;/SPAN&gt;&lt;SPAN&gt;'ORACLE_HOME="/dbfs/databricks/instantclient_23_6"'&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt; &amp;gt;&amp;gt; /databricks/spark/conf/spark-env.sh&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;oracledb.&lt;/SPAN&gt;&lt;SPAN&gt;init_oracle_client&lt;/SPAN&gt;&lt;SPAN&gt;(lib_dir=/dbfs/databricks/instantclient_23_6)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 05 Dec 2024 10:48:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/unable-to-use-cx-oracle-library-in-notebook/m-p/101060#M1735</guid>
      <dc:creator>ovbieAmen</dc:creator>
      <dc:date>2024-12-05T10:48:59Z</dc:date>
    </item>
  </channel>
</rss>

