CentOS5.6中裝好Oracle11g之後,啟動sqlplus報錯

ora_erin發表於2013-11-27

--整理以前的學習筆記

CentOS5.6中裝好Oracle11g之後,啟動sqlplus報錯

sqlplus: error while loading shared libraries: /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied

網上查資料需要禁用selinux
root使用者登入
使用cd命令切換當前目錄到 /etc/selinux
使用vim開啟config檔案
找到裡面的SELINUX條目,設定成disabled
重啟系統


/etc/selinux/config大致內容如下:

# 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 - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

但是我禁用的時候設定錯了,本來應該要把SELINUX=enforcing改為disabled,但是我卻把SELINUXTYPE=targeted改成了disabled

導致重啟之後報錯unable to load selinux policy. kernel panic-not syncing: attempated to kill init!系統進不去


解決方法:
通過編輯Grub啟動項解決。
在Grub啟動選單上按e進入編輯模式,在啟動項最後面加上 enforcing=0 ,回車,然後按b啟動即可
kernel /vmlinuz-2.6.19-prep ro root=LABEL=/ rhgb quiet 後面加上一個 enforcing=0,然後啟動即可
啟動後再把/etc/selinux/config正確地修改回來
如下所示
# 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 - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted


參考資料:
http://www.crypt.gen.nz/selinux/disable_selinux.html
http://minyupeng.blog.163.com/blog/static/221544992011462156662/

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26524307/viewspace-1061198/,如需轉載,請註明出處,否則將追究法律責任。

相關文章