共计 2192 个字符,预计需要花费 6 分钟才能阅读完成。
问题现象:
安装 Oracle 服务端后,sqlplus 命令以下错误。
oracle@linux:~/opt/oracle/product/11gR2/db/bin> sqlplus / as sysdba
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
1. 检查 LD_LIBRARY_PATH 这个环境变量,还是不行。
oracle@linux:echo $LD_LIBRARY_PATH
/lib:/usr/lib
修改为实际的:/opt/oracle/product/11gR2/db/lib:/lib:/usr/lib:/opt/oracle/product/11gR2/db/rdbms/lib
2. 检查用户的组也没问题。
oracle@linux:~> id
uid=1048(oracle) gid=120(oinstall) groups=120(oinstall),121(dba)
进入到 sqlplus 脚本路径下直接执行
oracle@linux:/opt/oracle/product/11gR2/db/bin> ./sqlplus
./sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
3. 排查依赖的库是否有问题
oracle@linux:/opt/oracle/product/11gR2/db/bin> ldd /opt/oracle/product/11gR2/db/bin/sqlplus
linux-gate.so.1 => (0xffffe000)
libsqlplus.so => not found
libclntsh.so.11.1 => not found
libnnz11.so => not found
libdl.so.2 => /lib/libdl.so.2 (0x555a8000)
libm.so.6 => /lib/libm.so.6 (0x555ae000)
libpthread.so.0 => /lib/libpthread.so.0 (0x555d6000)
libnsl.so.1 => /lib/libnsl.so.1 (0x555f1000)
libc.so.6 => /lib/libc.so.6 (0x5560a000)
/lib/ld-linux.so.2 (0x55555000)
可以看到 libsqlplus.so => not found
解决方案:依赖的动态库不存在,重新 relink。
oracle@linux:/opt/oracle/product/11gR2/db/bin> relink all
writing relink log to: /opt/oracle/product/11gR2/db/install/relink.log
oracle@linux:/opt/oracle/product/11gR2/db/bin> sqlplus
SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 15 04:57:09 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Enter user-name: ^C
oracle@linux:/opt/oracle/product/11gR2/db/bin> ldd /opt/oracle/product/11gR2/db/bin/sqlplus
linux-gate.so.1 => (0xffffe000)
libsqlplus.so => /opt/oracle/product/11gR2/db/lib/libsqlplus.so (0x55577000)
libclntsh.so.11.1 => /opt/oracle/product/11gR2/db/lib/libclntsh.so.11.1 (0x55627000)
libnnz11.so => /opt/oracle/product/11gR2/db/lib/libnnz11.so (0x57648000)
libdl.so.2 => /lib/libdl.so.2 (0x578cc000)
libm.so.6 => /lib/libm.so.6 (0x578d2000)
libpthread.so.0 => /lib/libpthread.so.0 (0x578fa000)
libnsl.so.1 => /lib/libnsl.so.1 (0x57915000)
libc.so.6 => /lib/libc.so.6 (0x5792e000)
libaio.so.1 => /lib/libaio.so.1 (0x57a8f000)
/lib/ld-linux.so.2 (0x55555000)
sqlplus 依赖的库文件恢复正常,sqlplus 可以使用。
更多 Oracle 相关信息见 Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2017-01/139608.htm
正文完
星哥玩云-微信公众号