편집하다

편집하다

저는 Oracle Database 11g에 연결하는 데 필요한 Python 애플리케이션을 개발할 수 있도록 UTM을 사용하여 M2 MacBook Air에서 Oracle Linux 9(aarch64)를 실행하려고 합니다.

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

관련 정보