Я пытаюсь подключиться к Oracle XE 11g2 из julia, используя Oracle .jl, как показано ниже:
Среда: CentOS 7.5 64bit
a) Загружено instantclient-basic-linux.x64-19.6.0.0.0dbru.zip
и извлечен в папку stdlib /opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
б) конфигурация julia /etc/profile.d/julia.sh content:
#!/bin/sh
export JULIA_HOME=/opt/julia/julia-1.4.1
export JULIA_LOAD_PATH=/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
export JULIA_DEPOT_PATH=/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
export JULIA_PKG_DEVDIR=/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
export JULIA_PROJECT=/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
export JULIA_HISTORY=/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4/logs/repl_history.jl
export PATH=$JULIA_HOME/bin:$PATH
c) сценарий julia, oraConnTest .jl:
import Oracle
global const dbHost = "localhost";
global const dbClientType = "thin";
global const dbName = "xe";
global const dbPort = "1521";
global const schema = "test";
global const dbUserPassword = "test2357";
global const conn_str="//"*dbHost*":"*dbPort*"/"*dbName;
conn = Oracle.Connection(dbUserName, dbUserPassword, conn_str);
rs=Oracle.query(conn, "SELECT * FROM TAB");
println(rs[:,1])
conn.close();
Я получаю следующую ошибку:
julia> include("/root/oraConnTest.jl")
ERROR: LoadError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory".
Обновление 1:
Но у меня есть libclnt sh .so в моем JULIA_LOAD_PATH, как показано ниже:
[root@srvr0 ~]# find / -name libclntsh.so
/index/instantclient_19_6/libclntsh.so
/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4/instantclient_19_6/libclntsh.so
/u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so
журналы:
[root@srvr0 ~]# cat /etc/profile.d/julia.sh
#!/bin/sh
export JULIA_HOME=/opt/julia/julia-1.4.1
export JULIA_LOAD_PATH=/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
export JULIA_DEPOT_PATH=/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
export JULIA_PKG_DEVDIR=/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
export JULIA_PROJECT=/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
export JULIA_HISTORY=/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4/logs/repl_history.jl
export ORA_INST_CLNT_PATH=/index/instantclient_19_6
#export ORA_INST_CLNT_PATH=/opt/julia/julia-1.4.1/share/julia/stdlib/v1.4/instantclient_19_6
#export ORA_INST_CLNT_PATH=/u01/app/oracle/product/11.2.0/xe/lib/
export PATH=$ORA_INST_CLNT_PATH:$JULIA_HOME/bin:$PATH
julia> versioninfo()
Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7 CPU M 620 @ 2.67GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, westmere)
Environment:
JULIA_DEPOT_PATH = /opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
JULIA_PROJECT = /opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
JULIA_LOAD_PATH = /opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
JULIA_PKG_DEVDIR = /opt/julia/julia-1.4.1/share/julia/stdlib/v1.4
JULIA_HOME = /opt/julia/julia-1.4.1
JULIA_HISTORY = /opt/julia/julia-1.4.1/share/julia/stdlib/v1.4/logs/repl_history.jl
(v1.4) pkg> rm Oracle.jl
Updating `@stdlib/Project.toml`
[7240a794] - Oracle v0.1.0
Updating `@stdlib/Manifest.toml`
[7240a794] - Oracle v0.1.0
[ade2ca70] - Dates
[8f399da3] - Libdl
[de0858da] - Printf
[4ec0a83e] - Unicode
(v1.4) pkg> add Oracle.jl
Updating registry at `@stdlib/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
┌ Warning: Some registries failed to update:
│ — /opt/julia/julia-1.4.1/share/julia/stdlib/v1.4/registries/General — failed to fetch from repo
└ @ Pkg.Types /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Types.jl:1122
Resolving package versions...
Updating `@stdlib/Project.toml`
[7240a794] + Oracle v0.1.0
Updating `@stdlib/Manifest.toml`
[7240a794] + Oracle v0.1.0
[ade2ca70] + Dates
[8f399da3] + Libdl
[de0858da] + Printf
[4ec0a83e] + Unicode
julia> include("/root/ora.jl")
ERROR: LoadError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help
Stacktrace:
[1] Oracle.Context() at /opt/julia/julia-1.4.1/share/julia/stdlib/v1.4/packages/Oracle/U5383/src/context.jl:25
[2] #Connection#10 at /opt/julia/julia-1.4.1/share/julia/stdlib/v1.4/packages/Oracle/U5383/src/connection.jl:122 [inlined]
[3] Oracle.Connection(::String, ::String, ::String) at /opt/julia/julia-1.4.1/share/julia/stdlib/v1.4/packages/Oracle/U5383/src/connection.jl:122
[4] top-level scope at /root/ora.jl:13
[5] include(::String) at ./client.jl:439
[6] top-level scope at REPL[5]:1
in expression starting at /root/ora.jl:13
Я пробовал со всеми тремя путями libclnt sh .so, указанными командой find. Тем не менее, проблема не устранена.
Пожалуйста, помогите мне решить указанную выше проблему.