sqlplus: error while loading shared libraries的解决方案是什么

45次阅读
没有评论

共计 1225 个字符,预计需要花费 4 分钟才能阅读完成。

今天就跟大家聊聊有关 sqlplus: error while loading shared libraries 的解决方案是什么,可能很多人都不太了解,为了让大家更加了解,丸趣 TV 小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

昨天在给学员培训时,安装完毕数据库后,执行 sqlplus 出现了如下错误。
建好 oracle 库后,执行 sqlplus 命令:
[oracle@localhost database]$ sqlplus /nolog
sqlplus: error while loading shared libraries: /oracle/app/product/11.2.0/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied

问题原因:安装 LINUX 时开启了 SELinux

解决方案:关闭 SELinux

第一种方法
(1)查看 SELinux 的状态,若为 Enforcing 表示 SELinux 为开启状态
[root@mydb]# getenforce
Enforcing

(2)执行 setenforce 0 将 SELinux 设为 permissive 模式(即临时关闭 SElinux)
[root@mydb]# setenforce 0

(3)验证上步操作的结果
[root@mydb]# getenforce
Permissive

这种方法的缺点是当系统重启的时候,SELinux 又恢复为 Enforcing 状态,执行 sqlplus 仍然会报错。

第二种方法
用 root 账户将 /etc/selinux/config 中的 SELinux=enforcing 改为 SELinux=disabled,改完之后如下所示:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#  enforcing – SELinux security policy is enforced.
#  permissive – SELinux prints warnings instead of enforcing.
#  disabled – SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#  targeted – Only targeted network daemons are protected.
#  strict – Full SELinux protection.
SELINUXTYPE=targeted

重启系统让设置生效:
# reboot

看完上述内容,你们对 sqlplus: error while loading shared libraries 的解决方案是什么有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注丸趣 TV 行业资讯频道,感谢大家的支持。

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-17发表,共计1225字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)