你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle服务安装后sqlplus命令提示错误

[日期:2017-01-16] 来源:Linux社区  作者:zihanxing [字体: ]

问题现象:

安装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

linux
相关资讯       sqlplus  sqlplus命令 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款