共計(jì) 1225 個(gè)字符,預(yù)計(jì)需要花費(fèi) 4 分鐘才能閱讀完成。
今天就跟大家聊聊有關(guān) sqlplus: error while loading shared libraries 的解決方案是什么,可能很多人都不太了解,為了讓大家更加了解,丸趣 TV 小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
昨天在給學(xué)員培訓(xùn)時(shí),安裝完畢數(shù)據(jù)庫后,執(zhí)行 sqlplus 出現(xiàn)了如下錯(cuò)誤。
建好 oracle 庫后,執(zhí)行 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 時(shí)開啟了 SELinux
解決方案:關(guān)閉 SELinux
第一種方法
(1)查看 SELinux 的狀態(tài),若為 Enforcing 表示 SELinux 為開啟狀態(tài)
[root@mydb]# getenforce
Enforcing
(2)執(zhí)行 setenforce 0 將 SELinux 設(shè)為 permissive 模式(即臨時(shí)關(guān)閉 SElinux)
[root@mydb]# setenforce 0
(3)驗(yàn)證上步操作的結(jié)果
[root@mydb]# getenforce
Permissive
這種方法的缺點(diǎn)是當(dāng)系統(tǒng)重啟的時(shí)候,SELinux 又恢復(fù)為 Enforcing 狀態(tài),執(zhí)行 sqlplus 仍然會報(bào)錯(cuò)。
第二種方法
用 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
重啟系統(tǒng)讓設(shè)置生效:
# reboot
看完上述內(nèi)容,你們對 sqlplus: error while loading shared libraries 的解決方案是什么有進(jìn)一步的了解嗎?如果還想了解更多知識或者相關(guān)內(nèi)容,請關(guān)注丸趣 TV 行業(yè)資訊頻道,感謝大家的支持。