加载共享库时出错:libsqlplus。所以:不能打开共享对象文件:没有这样的文件或目录。

时间:2022-01-27 15:29:47

I am running into a peculiar issue for last few days. Here are the details.

我最近几天遇到了一个奇怪的问题。这里有详细的安排。

I am trying to install oracle xe client on an EC2 (redhat like) instance. I am doing this using cloudformation provided by aws which basically first starts the instance and then runs all the script that we provide as root user. While installing it prints the following error message :

我正在尝试在EC2实例(类似于redhat)上安装oracle xe客户机。我使用的是aws提供的cloudformation,它首先启动实例,然后运行我们作为根用户提供的所有脚本。安装时打印以下错误信息:

case 1 ) when i try to run it using full path -

情形1)当我尝试使用全路径运行它时

/opt/oracle/product/11.2.0/xe/bin/sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

case 2 ) when i run it using sqlplus keyword only

当我只使用sqlplus关键字运行它时

sqlplus: command not found

Cloudformation will provision the instance first after starting and then only , i can log into the instance. Now when i log in to the instance sqlplus command works perfectlty without any issue.

Cloudformation将在启动后首先提供实例,然后我才能登录到该实例。现在,当我登录到实例sqlplus命令时,它工作得非常完美,没有任何问题。

When i echo the environment variables etc, i get proper outputs. i also get everything at proper place too. While provisioning i have created multiple users and they can access the sqlplus too without any problem.

当我响应环境变量等时,我得到了适当的输出。我也把所有的东西都放在合适的地方。在配置时,我创建了多个用户,他们也可以访问sqlplus,没有任何问题。

Below is the way i am trying to install oracle xe because i had similar requirement.

下面是我安装oracle xe的方式,因为我有类似的需求。

a) Download Oracle 11.2 XE for Linux 64 in your $HOME

a)在$HOME下载Linux 64的Oracle 11.2 XE

b) Unzip the zip file you get

b)解压你得到的zip文件

c) Unpack the content of the rpm file without installing it (we don't need the Oracle RDBMS to be running on the server) and then

c)在不安装rpm文件的情况下解包rpm文件的内容(我们不需要在服务器上运行Oracle RDBMS),然后

        mkdir ~/Oracle11XE-binaries
        cd ~/Oracle11XE-binaries

        # extract all the binaries from the RPM (rather than installing the RPM)
        rpm2cpio ../Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm  | cpio -idmv

        sudo mkdir /opt/oracle
        sudo mv u01/app/oracle/product /opt/oracle

        # clean up downloaded and extracted files (they are BIG)
        cd
        rm -rf Disk1 oracle-xe-11.2.0-1.0.x86_64.rpm.zip

        echo 'export ORACLE_HOME=/opt/oracle/product/11.2.0/xe
        export PATH=$PATH:$ORACLE_HOME/bin
        export LD_LIBRARY_PATH=$ORACLE_HOME/lib
        export TNS_ADMIN=$ORACLE_HOME/network/admin' | sudo tee /etc/profile.d/oracle.sh

        # source it so it takes effect in the current session
        . /etc/profile.d/oracle.sh
        ldconfig

I know the issue is pretty common but i am not finding any way out of it.

我知道这个问题很常见,但我并没有找到解决的办法。

Below is the output of ldconfig -p ( if required , but it doesn't contain libsqlplus.so)

下面是ldconfig -p的输出(如果需要,但是它不包含libsqlplus.so)

 libz.so.1 (libc6,x86-64) => /lib64/libz.so.1
        libyaml-0.so.2 (libc6,x86-64) => /usr/lib64/libyaml-0.so.2
        libxtables.so.10 (libc6,x86-64) => /lib64/libxtables.so.10
        libxslt.so.1 (libc6,x86-64) => /usr/lib64/libxslt.so.1
        libxml2.so.2 (libc6,x86-64) => /usr/lib64/libxml2.so.2
        libxcb.so.1 (libc6,x86-64) => /usr/lib64/libxcb.so.1
        libxcb-xvmc.so.0 (libc6,x86-64) => /usr/lib64/libxcb-xvmc.so.0
        libxcb-xv.so.0 (libc6,x86-64) => /usr/lib64/libxcb-xv.so.0
        libxcb-xtest.so.0 (libc6,x86-64) => /usr/lib64/libxcb-xtest.so.0
        libxcb-xselinux.so.0 (libc6,x86-64) => /usr/lib64/libxcb-xselinux.so.0
        libxcb-xinerama.so.0 (libc6,x86-64) => /usr/lib64/libxcb-xinerama.so.0
        libxcb-xf86dri.so.0 (libc6,x86-64) => /usr/lib64/libxcb-xf86dri.so.0
        libxcb-xfixes.so.0 (libc6,x86-64) => /usr/lib64/libxcb-xfixes.so.0
        libxcb-xevie.so.0 (libc6,x86-64) => /usr/lib64/libxcb-xevie.so.0
        libxcb-sync.so.0 (libc6,x86-64) => /usr/lib64/libxcb-sync.so.0
        libxcb-shm.so.0 (libc6,x86-64) => /usr/lib64/libxcb-shm.so.0
        libxcb-shape.so.0 (libc6,x86-64) => /usr/lib64/libxcb-shape.so.0
        libxcb-screensaver.so.0 (libc6,x86-64) => /usr/lib64/libxcb-screensaver.so.0
        libxcb-res.so.0 (libc6,x86-64) => /usr/lib64/libxcb-res.so.0
        libxcb-render.so.0 (libc6,x86-64) => /usr/lib64/libxcb-render.so.0
        libxcb-record.so.0 (libc6,x86-64) => /usr/lib64/libxcb-record.so.0
        libxcb-randr.so.0 (libc6,x86-64) => /usr/lib64/libxcb-randr.so.0
        libxcb-glx.so.0 (libc6,x86-64) => /usr/lib64/libxcb-glx.so.0
        libxcb-dri2.so.0 (libc6,x86-64) => /usr/lib64/libxcb-dri2.so.0
        libxcb-dpms.so.0 (libc6,x86-64) => /usr/lib64/libxcb-dpms.so.0
        libxcb-damage.so.0 (libc6,x86-64) => /usr/lib64/libxcb-damage.so.0
        libxcb-composite.so.0 (libc6,x86-64) => /usr/lib64/libxcb-composite.so.0
        libwrap.so.0 (libc6,x86-64) => /lib64/libwrap.so.0
        libverto.so.0 (libc6,x86-64) => /usr/lib64/libverto.so.0
        libverto.so (libc6,x86-64) => /usr/lib64/libverto.so
        libverto-k5ev.so.0 (libc6,x86-64) => /usr/lib64/libverto-k5ev.so.0
        libverto-k5ev.so (libc6,x86-64) => /usr/lib64/libverto-k5ev.so
        libuuid.so.1 (libc6,x86-64) => /lib64/libuuid.so.1
        libutil.so.1 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libutil.so.1
        libutempter.so.0 (libc6,x86-64) => /usr/lib64/libutempter.so.0
        libuser.so.1 (libc6,x86-64) => /usr/lib64/libuser.so.1
        libungif.so.4 (libc6,x86-64) => /usr/lib64/libungif.so.4
        libudev.so.0 (libc6,x86-64) => /lib64/libudev.so.0
        libtinfo.so.5 (libc6,x86-64) => /lib64/libtinfo.so.5
        libtic.so.5 (libc6,x86-64) => /usr/lib64/libtic.so.5
        libthread_db.so.1 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libthread_db.so.1
        libtasn1.so.3 (libc6,x86-64) => /usr/lib64/libtasn1.so.3
        libsysfs.so.2 (libc6,x86-64) => /usr/lib64/libsysfs.so.2
        libstdc++.so.6 (libc6,x86-64) => /usr/lib64/libstdc++.so.6
        libssl3.so (libc6,x86-64) => /usr/lib64/libssl3.so
        libssl.so.10 (libc6,x86-64) => /usr/lib64/libssl.so.10
        libssh2.so.1 (libc6,x86-64) => /usr/lib64/libssh2.so.1
        libss.so.2 (libc6,x86-64) => /usr/lib64/libss.so.2
        libsqlite3.so.0 (libc6,x86-64) => /usr/lib64/libsqlite3.so.0
        libsoftokn3.so (libc6,x86-64) => /usr/lib64/libsoftokn3.so
        libsmime3.so (libc6,x86-64) => /usr/lib64/libsmime3.so
        libslang.so.2 (libc6,x86-64) => /usr/lib64/libslang.so.2
        libsepol.so.1 (libc6,x86-64) => /lib64/libsepol.so.1
        libselinux.so.1 (libc6,x86-64) => /usr/lib64/libselinux.so.1
        libsasl2.so.2 (libc6,x86-64) => /usr/lib64/libsasl2.so.2
        libruby.so.2.0 (libc6,x86-64) => /usr/lib64/libruby.so.2.0
        librt.so.1 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/librt.so.1
        librpmsign.so.1 (libc6,x86-64) => /usr/lib64/librpmsign.so.1
        librpmio.so.3 (libc6,x86-64) => /usr/lib64/librpmio.so.3
        librpmbuild.so.3 (libc6,x86-64) => /usr/lib64/librpmbuild.so.3
        librpm.so.3 (libc6,x86-64) => /usr/lib64/librpm.so.3
        libresolv.so.2 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libresolv.so.2
        libreadline.so.6 (libc6,x86-64) => /lib64/libreadline.so.6
        libp11-kit.so.0 (libc6,x86-64) => /usr/lib64/libp11-kit.so.0
        libpython2.7.so.1.0 (libc6,x86-64) => /usr/lib64/libpython2.7.so.1.0
        libpython2.7.so (libc6,x86-64) => /usr/lib64/libpython2.7.so
        libpwquality.so.1 (libc6,x86-64) => /lib64/libpwquality.so.1
        libpthread.so.0 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libpthread.so.0
        libpth.so.20 (libc6,x86-64) => /usr/lib64/libpth.so.20
        libpsl.so.0 (libc6,x86-64) => /usr/lib64/libpsl.so.0
        libproc-3.2.8.so (libc6,x86-64) => /lib64/libproc-3.2.8.so
        libpopt.so.0 (libc6,x86-64) => /lib64/libpopt.so.0
        libpng12.so.0 (libc6,x86-64) => /usr/lib64/libpng12.so.0
        libpng.so.3 (libc6,x86-64) => /usr/lib64/libpng.so.3
        libplds4.so (libc6,x86-64) => /lib64/libplds4.so
        libplc4.so (libc6,x86-64) => /lib64/libplc4.so
        libpipeline.so.1 (libc6,x86-64) => /usr/lib64/libpipeline.so.1
        libpcreposix.so.0 (libc6,x86-64) => /usr/lib64/libpcreposix.so.0
        libpcrecpp.so.0 (libc6,x86-64) => /usr/lib64/libpcrecpp.so.0
        libpcre.so.0 (libc6,x86-64) => /lib64/libpcre.so.0
        libpcprofile.so (libc6,x86-64, OS ABI: Linux 2.6.35) => /usr/lib64/libpcprofile.so
        libpci.so.3 (libc6,x86-64) => /lib64/libpci.so.3
        libparted-2.1.so.0 (libc6,x86-64) => /lib64/libparted-2.1.so.0
        libpanelw.so.5 (libc6,x86-64) => /usr/lib64/libpanelw.so.5
        libpanel.so.5 (libc6,x86-64) => /usr/lib64/libpanel.so.5
        libpamc.so.0 (libc6,x86-64) => /lib64/libpamc.so.0
        libpam_misc.so.0 (libc6,x86-64) => /lib64/libpam_misc.so.0
        libpam.so.0 (libc6,x86-64) => /lib64/libpam.so.0
        libopts.so.25 (libc6,x86-64) => /usr/lib64/libopts.so.25
        libopcodes-2.23.52.0.1-16.47.amzn1.so (libc6,x86-64) => /usr/lib64/libopcodes-2.23.52.0.1-16.47.amzn1.so
        libnuma.so.1 (libc6,x86-64) => /usr/lib64/libnuma.so.1
        libnss3.so (libc6,x86-64) => /usr/lib64/libnss3.so
        libnssutil3.so (libc6,x86-64) => /usr/lib64/libnssutil3.so
        libnsssysinit.so (libc6,x86-64) => /usr/lib64/libnsssysinit.so
        libnsspem.so (libc6,x86-64) => /usr/lib64/libnsspem.so
        libnssdbm3.so (libc6,x86-64) => /usr/lib64/libnssdbm3.so
        libnssckbi.so (libc6,x86-64) => /usr/lib64/libnssckbi.so
        libnss_nisplus.so.2 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libnss_nisplus.so.2
        libnss_nis.so.2 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libnss_nis.so.2
        libnss_hesiod.so.2 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libnss_hesiod.so.2
        libnss_files.so.2 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libnss_files.so.2
        libnss_dns.so.2 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libnss_dns.so.2
        libnss_db.so.2 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libnss_db.so.2
        libnss_compat.so.2 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libnss_compat.so.2
        libnspr4.so (libc6,x86-64) => /lib64/libnspr4.so
        libnsl.so.1 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libnsl.so.1
        libnih.so.1 (libc6,x86-64) => /lib64/libnih.so.1
        libnih-dbus.so.1 (libc6,x86-64) => /lib64/libnih-dbus.so.1
        libnewt.so.0.52 (libc6,x86-64) => /usr/lib64/libnewt.so.0.52
        libncursesw.so.5 (libc6,x86-64) => /lib64/libncursesw.so.5
        libncurses.so.5 (libc6,x86-64) => /lib64/libncurses.so.5
        libmp.so.3 (libc6,x86-64) => /usr/lib64/libmp.so.3
        libmount.so.1 (libc6,x86-64) => /lib64/libmount.so.1
        libmenuw.so.5 (libc6,x86-64) => /usr/lib64/libmenuw.so.5
        libmenu.so.5 (libc6,x86-64) => /usr/lib64/libmenu.so.5
        libmemusage.so (libc6,x86-64, OS ABI: Linux 2.6.35) => /usr/lib64/libmemusage.so
        libmagic.so.1 (libc6,x86-64) => /usr/lib64/libmagic.so.1
        libm.so.6 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libm.so.6
        liblzma.so.5 (libc6,x86-64) => /usr/lib64/liblzma.so.5
        liblwres.so.80 (libc6,x86-64) => /usr/lib64/liblwres.so.80
        liblvm2cmd.so.2.02 (libc6,x86-64) => /lib64/liblvm2cmd.so.2.02
        liblvm2app.so.2.2 (libc6,x86-64) => /lib64/liblvm2app.so.2.2
        liblua-5.1.so (libc6,x86-64) => /usr/lib64/liblua-5.1.so
        libldif-2.4.so.2 (libc6,x86-64) => /lib64/libldif-2.4.so.2
        libldap_r-2.4.so.2 (libc6,x86-64) => /lib64/libldap_r-2.4.so.2
        libldap-2.4.so.2 (libc6,x86-64) => /lib64/libldap-2.4.so.2
        liblcms2.so.2 (libc6,x86-64) => /usr/lib64/liblcms2.so.2
        liblber-2.4.so.2 (libc6,x86-64) => /lib64/liblber-2.4.so.2
        libk5crypto.so.3 (libc6,x86-64) => /lib64/libk5crypto.so.3
        libkrb5support.so.0 (libc6,x86-64) => /lib64/libkrb5support.so.0
        libkrb5.so.3 (libc6,x86-64) => /lib64/libkrb5.so.3
        libkmod.so.2 (libc6,x86-64) => /usr/lib64/libkmod.so.2
        libkeyutils.so.1 (libc6,x86-64) => /lib64/libkeyutils.so.1
        libkdb5.so.6 (libc6,x86-64) => /usr/lib64/libkdb5.so.6
        libkadm5srv_mit.so.8 (libc6,x86-64) => /usr/lib64/libkadm5srv_mit.so.8
        libkadm5clnt_mit.so.8 (libc6,x86-64) => /usr/lib64/libkadm5clnt_mit.so.8
        libjpeg.so.62 (libc6,x86-64) => /usr/lib64/libjpeg.so.62
        libisccfg.so.82 (libc6,x86-64) => /usr/lib64/libisccfg.so.82
        libisccc.so.80 (libc6,x86-64) => /usr/lib64/libisccc.so.80
        libisc.so.83 (libc6,x86-64) => /usr/lib64/libisc.so.83
        libip6tc.so.0 (libc6,x86-64) => /lib64/libip6tc.so.0
        libip4tc.so.0 (libc6,x86-64) => /lib64/libip4tc.so.0
        libiptc.so.0 (libc6,x86-64) => /lib64/libiptc.so.0
        libidn.so.11 (libc6,x86-64) => /lib64/libidn.so.11
        libicuuc.so.50 (libc6,x86-64) => /usr/lib64/libicuuc.so.50
        libicutu.so.50 (libc6,x86-64) => /usr/lib64/libicutu.so.50
        libicutest.so.50 (libc6,x86-64) => /usr/lib64/libicutest.so.50
        libiculx.so.50 (libc6,x86-64) => /usr/lib64/libiculx.so.50
        libicule.so.50 (libc6,x86-64) => /usr/lib64/libicule.so.50
        libicui18n.so.50 (libc6,x86-64) => /usr/lib64/libicui18n.so.50
        libicuio.so.50 (libc6,x86-64) => /usr/lib64/libicuio.so.50
        libicudata.so.50 (libc6,x86-64) => /usr/lib64/libicudata.so.50
        libhistory.so.6 (libc6,x86-64) => /usr/lib64/libhistory.so.6
        libhesiod.so.0 (libc6,x86-64) => /usr/lib64/libhesiod.so.0
        libgthread-2.0.so.0 (libc6,x86-64) => /usr/lib64/libgthread-2.0.so.0
        libgssrpc.so.4 (libc6,x86-64) => /lib64/libgssrpc.so.4
        libgssapi_krb5.so.2 (libc6,x86-64) => /lib64/libgssapi_krb5.so.2
        libgpm.so.2 (libc6,x86-64) => /usr/lib64/libgpm.so.2
        libgpgme.so.11 (libc6,x86-64) => /usr/lib64/libgpgme.so.11
        libgpgme-pthread.so.11 (libc6,x86-64) => /usr/lib64/libgpgme-pthread.so.11
        libgpg-error.so.0 (libc6,x86-64) => /lib64/libgpg-error.so.0
        libgobject-2.0.so.0 (libc6,x86-64) => /usr/lib64/libgobject-2.0.so.0
        libgmpxx.so.4 (libc6,x86-64) => /usr/lib64/libgmpxx.so.4
        libgmp.so.3 (libc6,x86-64) => /usr/lib64/libgmp.so.3
        libgmodule-2.0.so.0 (libc6,x86-64) => /usr/lib64/libgmodule-2.0.so.0
        libglib-2.0.so.0 (libc6,x86-64) => /usr/lib64/libglib-2.0.so.0
        libgio-2.0.so.0 (libc6,x86-64) => /usr/lib64/libgio-2.0.so.0
        libgif.so.4 (libc6,x86-64) => /usr/lib64/libgif.so.4
        libgdbm.so.2 (libc6,x86-64) => /usr/lib64/libgdbm.so.2
        libgcrypt.so.11 (libc6,x86-64) => /usr/lib64/libgcrypt.so.11
        libgcc_s.so.1 (libc6,x86-64) => /lib64/libgcc_s.so.1
        libfreetype.so.6 (libc6,x86-64) => /usr/lib64/libfreetype.so.6
        libfreebl3.so (libc6,x86-64) => /lib64/libfreebl3.so
        libfreebl3.so (libc6,x86-64) => /usr/lib64/libfreebl3.so
        libformw.so.5 (libc6,x86-64) => /usr/lib64/libformw.so.5
        libform.so.5 (libc6,x86-64) => /usr/lib64/libform.so.5
        libfontenc.so.1 (libc6,x86-64) => /usr/lib64/libfontenc.so.1
        libfontconfig.so.1 (libc6,x86-64) => /usr/lib64/libfontconfig.so.1
        libfipscheck.so.1 (libc6,x86-64) => /usr/lib64/libfipscheck.so.1
        libffi.so.6 (libc6,x86-64) => /usr/lib64/libffi.so.6
        libe2p.so.2 (libc6,x86-64) => /usr/lib64/libe2p.so.2
        libext2fs.so.2 (libc6,x86-64) => /usr/lib64/libext2fs.so.2
        libexslt.so.0 (libc6,x86-64) => /usr/lib64/libexslt.so.0
        libexpat.so.1 (libc6,x86-64) => /lib64/libexpat.so.1
        libelf.so.1 (libc6,x86-64) => /usr/lib64/libelf.so.1
        libedit.so.0 (libc6,x86-64) => /usr/lib64/libedit.so.0
        libdns.so.81 (libc6,x86-64) => /usr/lib64/libdns.so.81
        libdmraid.so.1 (libc6,x86-64) => /lib64/libdmraid.so.1
        libdmraid.so (libc6,x86-64) => /lib64/libdmraid.so
        libdmraid-events-isw.so.1 (libc6,x86-64) => /lib64/libdmraid-events-isw.so.1
        libdmraid-events-isw.so (libc6,x86-64) => /lib64/libdmraid-events-isw.so
        libdl.so.2 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libdl.so.2
        libdevmapper.so.1.02 (libc6,x86-64) => /lib64/libdevmapper.so.1.02
        libdevmapper-event.so.1.02 (libc6,x86-64) => /lib64/libdevmapper-event.so.1.02
        libdevmapper-event-lvm2thin.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2thin.so
        libdevmapper-event-lvm2snapshot.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2snapshot.so
        libdevmapper-event-lvm2raid.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2raid.so
        libdevmapper-event-lvm2mirror.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2mirror.so
        libdevmapper-event-lvm2.so.2.02 (libc6,x86-64) => /lib64/libdevmapper-event-lvm2.so.2.02
        libdbus-1.so.3 (libc6,x86-64) => /lib64/libdbus-1.so.3
        libdb-4.7.so (libc6,x86-64) => /lib64/libdb-4.7.so
        libdb-4.7.so (libc6,x86-64) => /usr/lib64/libdb-4.7.so
        libcurl.so.4 (libc6,x86-64) => /usr/lib64/libcurl.so.4
        libcryptsetup.so.4 (libc6,x86-64) => /lib64/libcryptsetup.so.4
        libcrypto.so.10 (libc6,x86-64) => /lib64/libcrypto.so.10
        libcrypt.so.1 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libcrypt.so.1
        libcrack.so.2 (libc6,x86-64) => /usr/lib64/libcrack.so.2
        libcpupower.so.0 (libc6,x86-64) => /usr/lib64/libcpupower.so.0
        libcom_err.so.2 (libc6,x86-64) => /usr/lib64/libcom_err.so.2
        libcidn.so.1 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libcidn.so.1
        libcap.so.2 (libc6,x86-64) => /lib64/libcap.so.2
        libcap-ng.so.0 (libc6,x86-64) => /lib64/libcap-ng.so.0
        libc.so.6 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libc.so.6
        libbz2.so.1 (libc6,x86-64) => /lib64/libbz2.so.1
        libblkid.so.1 (libc6,x86-64) => /lib64/libblkid.so.1
        libbind9.so.80 (libc6,x86-64) => /usr/lib64/libbind9.so.80
        libbfd-2.23.52.0.1-16.47.amzn1.so (libc6,x86-64) => /usr/lib64/libbfd-2.23.52.0.1-16.47.amzn1.so
        libauparse.so.0 (libc6,x86-64) => /lib64/libauparse.so.0
        libaudit.so.1 (libc6,x86-64) => /lib64/libaudit.so.1
        libattr.so.1 (libc6,x86-64) => /lib64/libattr.so.1
        libassuan.so.0 (libc6,x86-64) => /usr/lib64/libassuan.so.0
        libasound.so.2 (libc6,x86-64) => /lib64/libasound.so.2
        libanl.so.1 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libanl.so.1
        libaio.so.1.0.0 (libc6,x86-64) => /lib64/libaio.so.1.0.0
        libaio.so.1 (libc6,x86-64) => /lib64/libaio.so.1
        libacl.so.1 (libc6,x86-64) => /lib64/libacl.so.1
        libX11.so.6 (libc6,x86-64) => /usr/lib64/libX11.so.6
        libX11-xcb.so.1 (libc6,x86-64) => /usr/lib64/libX11-xcb.so.1
        libXtst.so.6 (libc6,x86-64) => /usr/lib64/libXtst.so.6
        libXrender.so.1 (libc6,x86-64) => /usr/lib64/libXrender.so.1
        libXi.so.6 (libc6,x86-64) => /usr/lib64/libXi.so.6
        libXfont.so.1 (libc6,x86-64) => /usr/lib64/libXfont.so.1
        libXext.so.6 (libc6,x86-64) => /usr/lib64/libXext.so.6
        libXau.so.6 (libc6,x86-64) => /usr/lib64/libXau.so.6
        libSegFault.so (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libSegFault.so
        libSM.so.6 (libc6,x86-64) => /usr/lib64/libSM.so.6
        libICE.so.6 (libc6,x86-64) => /usr/lib64/libICE.so.6
        libBrokenLocale.so.1 (libc6,x86-64, OS ABI: Linux 2.6.35) => /lib64/libBrokenLocale.so.1
        ld-linux-x86-64.so.2 (libc6,x86-64) => /lib64/ld-linux-x86-64.so.2

1 个解决方案

#1


2  

If you have a parent script which calls (but does not source) two child scripts, any environment changes made by the first child script do not affect the parent or the other child.

如果您有一个父脚本,它调用(但不调用)两个子脚本,那么第一个子脚本所做的任何环境更改都不会影响父脚本或其他子脚本。

As a simple example let's say you have an install.sh script which contains:

作为一个简单的例子,假设您有一个安装。sh脚本包含:

#!/bin/bash
install_oraclexe.sh
create_schema.sh

where install_oraclexe.sh contains the commands you showed in step c, including sourcing the environment script with . /etc/profile.d/oracle.sh; and create_schema.sh executes SQL*Plus.

install_oraclexe的地方。sh包含步骤c中显示的命令,包括使用环境脚本的源代码。/etc/profile.d/oracle.sh;和create_schema。sh执行SQL * +。

Within install_oraclexe.sh the environment is modified and PATH, LD_LIBRARY_PATH, etc. are available and have values that would allow you to run SQL*Plus later in that same child script. But those environment changes are only visible to that script. When it exits and control passes back to the parent script, its environment has not been touched, and it is not aware of anything the child has done. When it then executes the create_schema.sh script it still doesn't have the Oracle-specfic environment settings, so the second child script doesn't have those either.

install_oraclexe之内。修改了环境,并且路径、LD_LIBRARY_PATH等都是可用的,并且具有允许您稍后在相同的子脚本中运行SQL*Plus的值。但是这些环境更改只对脚本可见。当它退出并控制返回到父脚本时,它的环境没有被修改,并且它不知道子脚本做了什么。然后执行create_schema。它仍然没有Oracle-specfic环境设置,所以第二个子脚本也没有这些设置。

You can either move (or copy) the source command for the environment changes to the parent script:

您可以将环境更改的源命令移动(或复制)到父脚本:

#!/bin/bash
install_oraclexe.sh
. /etc/profile.d/oracle.sh
create_schema.sh

Or perhaps more neatly add it to the create_schema.sh script:

或者更巧妙地将它添加到create_schema中。sh脚本:

#!/bin/bash
. /etc/profile.d/oracle.sh
sqlplus ...

Presumably as you are only installing the client you are connecting to a remote DB and are already using a suitable connection string, so you don't need to export ORACLE_SID=....

大概是你只安装客户端连接到一个远程数据库和已经使用一个合适的连接字符串,所以你不需要出口ORACLE_SID = ....


Not really relevant, but extracting files from the XE client installer seems a little odd; I would consider using the easier-to-install Oracle Instant Client instead. This seems like just the kind of distribution scenario it's designed for.

不是很相关,但是从XE客户端安装程序中提取文件似乎有点奇怪;我将考虑使用更容易安装的Oracle Instant Client。这似乎正是它所设计的分发场景。

#1


2  

If you have a parent script which calls (but does not source) two child scripts, any environment changes made by the first child script do not affect the parent or the other child.

如果您有一个父脚本,它调用(但不调用)两个子脚本,那么第一个子脚本所做的任何环境更改都不会影响父脚本或其他子脚本。

As a simple example let's say you have an install.sh script which contains:

作为一个简单的例子,假设您有一个安装。sh脚本包含:

#!/bin/bash
install_oraclexe.sh
create_schema.sh

where install_oraclexe.sh contains the commands you showed in step c, including sourcing the environment script with . /etc/profile.d/oracle.sh; and create_schema.sh executes SQL*Plus.

install_oraclexe的地方。sh包含步骤c中显示的命令,包括使用环境脚本的源代码。/etc/profile.d/oracle.sh;和create_schema。sh执行SQL * +。

Within install_oraclexe.sh the environment is modified and PATH, LD_LIBRARY_PATH, etc. are available and have values that would allow you to run SQL*Plus later in that same child script. But those environment changes are only visible to that script. When it exits and control passes back to the parent script, its environment has not been touched, and it is not aware of anything the child has done. When it then executes the create_schema.sh script it still doesn't have the Oracle-specfic environment settings, so the second child script doesn't have those either.

install_oraclexe之内。修改了环境,并且路径、LD_LIBRARY_PATH等都是可用的,并且具有允许您稍后在相同的子脚本中运行SQL*Plus的值。但是这些环境更改只对脚本可见。当它退出并控制返回到父脚本时,它的环境没有被修改,并且它不知道子脚本做了什么。然后执行create_schema。它仍然没有Oracle-specfic环境设置,所以第二个子脚本也没有这些设置。

You can either move (or copy) the source command for the environment changes to the parent script:

您可以将环境更改的源命令移动(或复制)到父脚本:

#!/bin/bash
install_oraclexe.sh
. /etc/profile.d/oracle.sh
create_schema.sh

Or perhaps more neatly add it to the create_schema.sh script:

或者更巧妙地将它添加到create_schema中。sh脚本:

#!/bin/bash
. /etc/profile.d/oracle.sh
sqlplus ...

Presumably as you are only installing the client you are connecting to a remote DB and are already using a suitable connection string, so you don't need to export ORACLE_SID=....

大概是你只安装客户端连接到一个远程数据库和已经使用一个合适的连接字符串,所以你不需要出口ORACLE_SID = ....


Not really relevant, but extracting files from the XE client installer seems a little odd; I would consider using the easier-to-install Oracle Instant Client instead. This seems like just the kind of distribution scenario it's designed for.

不是很相关,但是从XE客户端安装程序中提取文件似乎有点奇怪;我将考虑使用更容易安装的Oracle Instant Client。这似乎正是它所设计的分发场景。