# ODBC.jl to connect to an Oracle database on Linux

**URL:** <https://discourse.julialang.org/t/odbc-jl-to-connect-to-an-oracle-database-on-linux/97037>\
**Category:** Data\
**Tags:** linux, odbc, oracle\
**Created:** [April 3, 2023, 11:43pm UTC](https://discourse.julialang.org/t/odbc-jl-to-connect-to-an-oracle-database-on-linux/97037 "2023-04-03T23:43:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![klwlevy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klwlevy/32/25272_2.png) [@klwlevy](https://discourse.julialang.org/u/klwlevy)\
**Post date:** [April 3, 2023, 11:43pm UTC](https://discourse.julialang.org/t/odbc-jl-to-connect-to-an-oracle-database-on-linux/97037/1 "2023-04-03T23:43:20Z")

</div>

Hi there, I am succesfully using ODBC.jl to connect to an Oracle database on my local Windows laptop (with system-provided DSN from Windows ODBC).

Now I am struggling to connect to the same database from a server running linux.

I am trying the following:

```julia
using ODBC

driverpath = "/usr/lib/oracle/12.1/client64/lib/libsqora.so.12.1"
isfile(driverpath)
ODBC.adddriver("wl_driver_test1", driverpath)
ODBC.drivers()
ODBC.adddsn("wl_dsn_test1", "wl_driver_test1")
ODBC.Connection("DSN=wl_dsn_test1")

```

Unfortunately I can’t get it to work:

```julia
julia> using ODBC

julia> driverpath = "/usr/lib/oracle/12.1/client64/lib/libsqora.so.12.1"
"/usr/lib/oracle/12.1/client64/lib/libsqora.so.12.1"

julia> isfile(driverpath)
true

julia> ODBC.adddriver("wl_driver_test1", driverpath)
1

julia> ODBC.drivers()
Dict{String, String} with 1 entry:
  "wl_driver_test1" => "Driver=/usr/lib/oracle/12.1/client64/lib/libsqora.so.12.1\0UsageCount=2\0"

julia> ODBC.adddsn("wl_dsn_test1", "wl_driver_test1")

julia> ODBC.Connection("DSN=wl_dsn_test1")
ERROR: 01000: [unixODBC][Driver Manager]Can't open lib '/usr/lib/oracle/12.1/client64/lib/libsqora.so.12.1' : file not found
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] driverconnect(connstr::String)
   @ ODBC.API ~/.julia/packages/ODBC/9VZTC/src/API.jl:111
 [3] connect
   @ ~/.julia/packages/ODBC/9VZTC/src/API.jl:349 [inlined]
 [4] ODBC.Connection(dsn::String; user::Nothing, password::Nothing, extraauth::Nothing)
   @ ODBC ~/.julia/packages/ODBC/9VZTC/src/dbinterface.jl:57
 [5] ODBC.Connection(dsn::String)
   @ ODBC ~/.julia/packages/ODBC/9VZTC/src/dbinterface.jl:54
 [6] top-level scope
   @ REPL[7]:1

julia> 

```

I would be very grateful for any pointers what I could be doing wrong.  
I am suspecting something is fishy with my unixODBC driver manager installation but I don’t know what.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [April 4, 2023, 12:58am UTC](https://discourse.julialang.org/t/odbc-jl-to-connect-to-an-oracle-database-on-linux/97037/2 "2023-04-04T00:58:36Z")

</div>

> [@klwlevy](#):
>
> `"/usr/lib/oracle/12.1/client64/lib/libsqora.so.12.1"`

Are you completely sure that this file exists at this path? The error indicates it’s not.

(If you are able to consider alternatives, I’ve had success with [Oracle.jl](https://felipenoris.github.io/Oracle.jl/stable/) too.)

---

<div class="post-metadata">

**Author:** ![klwlevy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klwlevy/32/25272_2.png) [@klwlevy](https://discourse.julialang.org/u/klwlevy)\
**Post date:** [April 4, 2023, 8:08am UTC](https://discourse.julialang.org/t/odbc-jl-to-connect-to-an-oracle-database-on-linux/97037/3 "2023-04-04T08:08:48Z")

</div>

Hi jd-foster.

Well, yes, that’s why I included the isfile()-test. The file is there but it is not enough.

---

<div class="post-metadata">

**Author:** ![hhaensel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hhaensel/32/1207_2.png) [@hhaensel](https://discourse.julialang.org/u/hhaensel)\
**Post date:** [August 28, 2025, 8:40pm UTC](https://discourse.julialang.org/t/odbc-jl-to-connect-to-an-oracle-database-on-linux/97037/4 "2025-08-28T20:40:22Z")

</div>

> [@klwlevy](#):
>
> I would be very grateful for any pointers what I could be doing wrong.  
> I am suspecting something is fishy with my unixODBC driver manager installation but I don’t know what.

Could you solve it by now? I am experiencing the same issue.

---

<div class="post-metadata">

**Author:** ![hhaensel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hhaensel/32/1207_2.png) [@hhaensel](https://discourse.julialang.org/u/hhaensel)\
**Post date:** [August 28, 2025, 9:07pm UTC](https://discourse.julialang.org/t/odbc-jl-to-connect-to-an-oracle-database-on-linux/97037/5 "2025-08-28T21:07:20Z")

</div>

Found it. It was missing the libaio file, which can be installed by

```sh
sudo apt-get install libaio1

```

Here’s the page that helped me: [Support](https://knowledge.informatica.com/s/article/HOW-TO-Configure-ODBC-For-Oracle-In-Linux?language=en_US)

---

<div class="post-metadata">

**Author:** ![hhaensel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hhaensel/32/1207_2.png) [@hhaensel](https://discourse.julialang.org/u/hhaensel)\
**Post date:** [September 15, 2025, 5:39am UTC](https://discourse.julialang.org/t/odbc-jl-to-connect-to-an-oracle-database-on-linux/97037/6 "2025-09-15T05:39:08Z")

</div>

There’s even more to it. I wanted to get ODBC running on a Docker with the latest julia image and found that it failed. There are two pitfalls

- ODBC needs libaio to be installed, so you need to add an  
`RUN apt-get update && apt-get install libaio1` to your Dockerfile
- The latest Julia image of version 1.11.6 comes with Ubuntu 24, which uses a different version of libaio. So you need to do
  - `RUN apt-get update && apt-get install libaio1t64`
  - `RUN ln -sf /usr/lib/x86_64-linux-gnu/libaio.so.1t64.0.2 /usr/lib/x86_64-linux-gnu/libaio.so.1`
