ODBC.jl to connect to an Oracle database on Linux

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:

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

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

Hi jd-foster.

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