我正在尝试使用 UTM 在 M2 MacBook Air 上运行 Oracle Linux 9(aarch64),以便我可以开发连接到 Oracle Database 11g 所需的 python 应用程序。
因为python应用程序需要安装Oracle instantclient,所以我根据以下步骤安装了3个RPM(basic、devel、sqlplus):https://docs.oracle.com/en/database/oracle/oracle-database/19/lacli/installing-ic-arm-packages.html#GUID-1F3D38AD-A4DB-461A-9B50-9FC283C5A7CB
[kojima@localhost ~]$ sudo dnf list installed | grep instantclient
oracle-instantclient19.10-basic.aarch64 19.10.0.0.0-1 @@commandline
oracle-instantclient19.10-devel.aarch64 19.10.0.0.0-1 @@commandline
oracle-instantclient19.10-sqlplus.aarch64 19.10.0.0.0-1 @@commandline
SQLplus 似乎已成功安装,但 bash 抱怨如下:
[kojima@localhost ~]$ sqlplus
-bash: /usr/lib/oracle/19.10/client64/bin/sqlplus: No such file or directory
但可执行文件确实存在。有人可以解释一下我错过了什么吗?我应该做些什么?
[kojima@localhost ~]$ file /usr/lib/oracle/19.10/client64/bin/sqlplus
/usr/lib/oracle/19.10/client64/bin/sqlplus: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=abac9e40cfe83fd8802fb2226289640658b3b024, not stripped
[kojima@localhost ~]$ uname -a
Linux localhost.localdomain 5.15.0-3.60.5.1.el9uek.aarch64 #2 SMP Wed Oct 19 20:23:09 PDT 2022 aarch64 aarch64 aarch64 GNU/Linux
[kojima@localhost ~]$ cat /etc/oracle-release
Oracle Linux Server release 9.1
编辑
strace sqlplus
给出以下:
[kojima@localhost ~]$ strace sqlplus
execve("/usr/lib/oracle/19.10/client64/bin/sqlplus", ["sqlplus"], 0xfffff0bed0a0 /* 32 vars */) = -1 ENOENT (No such file or directory)
strace: exec: No such file or directory
+++ exited with 1 +++
ldd -v /usr/lib/oracle/19.10/client64/bin/sqlplus
:
[kojima@localhost ~]$ ldd -v /usr/lib/oracle/19.10/client64/bin/sqlplus
linux-vdso.so.1 (0x0000ffff8e854000)
libsqlplus.so => /usr/lib/oracle/19.10/client64/lib/libsqlplus.so (0x0000ffff8e744000)
libclntsh.so.19.1 => /usr/lib/oracle/19.10/client64/lib/libclntsh.so.19.1 (0x0000ffff8ba19000)
libclntshcore.so.19.1 => /usr/lib/oracle/19.10/client64/lib/libclntshcore.so.19.1 (0x0000ffff8b745000)
libnnz19.so => /usr/lib/oracle/19.10/client64/lib/libnnz19.so (0x0000ffff8b24a000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000ffff8b229000)
libm.so.6 => /lib64/libm.so.6 (0x0000ffff8b188000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000ffff8b167000)
librt.so.1 => /lib64/librt.so.1 (0x0000ffff8b146000)
libaio.so.1 => /lib64/libaio.so.1 (0x0000ffff8b125000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x0000ffff8b102000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000ffff8b0d1000)
libc.so.6 => /lib64/libc.so.6 (0x0000ffff8af23000)
/lib64/ld-linux-aarch64.so.1 => /lib/ld-linux-aarch64.so.1 (0x0000ffff8e817000)
Version information:
/usr/lib/oracle/19.10/client64/bin/sqlplus:
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
/usr/lib/oracle/19.10/client64/lib/libsqlplus.so:
libpthread.so.0 (GLIBC_2.17) => /lib64/libpthread.so.0
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
/usr/lib/oracle/19.10/client64/lib/libclntsh.so.19.1:
libresolv.so.2 (GLIBC_2.17) => /lib64/libresolv.so.2
libdl.so.2 (GLIBC_2.17) => /lib64/libdl.so.2
libm.so.6 (GLIBC_2.17) => /lib64/libm.so.6
libpthread.so.0 (GLIBC_2.17) => /lib64/libpthread.so.0
libaio.so.1 (LIBAIO_0.4) => /lib64/libaio.so.1
libaio.so.1 (LIBAIO_0.1) => /lib64/libaio.so.1
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
/usr/lib/oracle/19.10/client64/lib/libclntshcore.so.19.1:
librt.so.1 (GLIBC_2.17) => /lib64/librt.so.1
libgcc_s.so.1 (GCC_3.0) => /lib64/libgcc_s.so.1
libdl.so.2 (GLIBC_2.17) => /lib64/libdl.so.2
libm.so.6 (GLIBC_2.17) => /lib64/libm.so.6
libpthread.so.0 (GLIBC_2.17) => /lib64/libpthread.so.0
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
/usr/lib/oracle/19.10/client64/lib/libnnz19.so:
libdl.so.2 (GLIBC_2.17) => /lib64/libdl.so.2
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
/lib64/libdl.so.2:
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
/lib64/libm.so.6:
ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
/lib64/libpthread.so.0:
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
/lib64/librt.so.1:
ld-linux-aarch64.so.1 (GLIBC_PRIVATE) => /lib/ld-linux-aarch64.so.1
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
/lib64/libaio.so.1:
ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
/lib64/libresolv.so.2:
ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
libc.so.6 (GLIBC_2.34) => /lib64/libc.so.6
libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
/lib64/libgcc_s.so.1:
libc.so.6 (GLIBC_2.34) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.17) => /lib64/libc.so.6
/lib64/libc.so.6:
ld-linux-aarch64.so.1 (GLIBC_PRIVATE) => /lib/ld-linux-aarch64.so.1
ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
环境变量:
# at the bottom of the ~/.bashrc
# ...
export ORACLE_HOME=/usr/lib/oracle/19.10/client64
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ORACLE_HOME/lib"
export DYLD_LIBRARY_PATH="$ORACLE_HOME/lib:$DYLD_LIBRARY_PATH"
export TNS_ADMIN="$ORACLE_HOME/lib/network/admin"
export PATH="$ORACLE_HOME/bin:$PATH"
export NLS_LANG=Japanese_Japan.AL32UTF8
export SQLPATH="$ORACLE_HOME"
export ORACLE_PATH="$ORACLE_HOME"
export ORA_NCHAR_LITERAL_REPLACE=TRUE
[kojima@localhost ~]$ echo $ORACLE_HOME
/usr/lib/oracle/19.10/client64
[kojima@localhost ~]$ echo $PATH
/usr/lib/oracle/19.10/client64/bin:/home/kojima/.local/bin:/home/kojima/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
答案1
不知道为什么会这样以及它是如何找到的,但我需要修改所有可执行文件的解释器。
来源:https://askubuntu.com/a/1440839
sudo dnf install oracle-epel-release-el9
sudo dnf install patchelf
sudo patchelf --set-interpreter /lib/ld-linux-aarch64.so.1 \
/usr/lib/oracle/19.10/client64/bin/*
执行后patchelf
,sqlplus
效果正如我预期的那样:
[kojima@localhost ~]$ sqlplus
SQL*Plus: Release 19.0.0.0.0 - Production on 木 3月 23 11:27:30 2023
Version 19.10.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
ユーザー名を入力してください: ^C