安裝oracle 11gr2 的完成 執行sqlplus 遇到如下錯誤:
oracle@rac:/opt>sqlplus "/as sysdba"
sqlplus: error while loading shared libraries: /opt/app/oracle/11.2.0/product/db_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied
1 檢查SELinux是否開啟
[root@localhost db_1]# vi /etc/sysconfig/selinux
SELINUX=disabled
SELINUXTYPE=targeted
~
若為true 在 設定為disable
2. 使用指令chcon改變檔案或者目錄的SELinux屬性, 文法chcon -t texrel_shlib_t 庫名字
oracle@rac:/opt>chcon -t textrel_shlib_t $ORACLE_HOME/lib/libclntsh.so.11.1
oracle@rac:/opt>
SQL*Plus: Release 11.2.0.1.0 Production on Thu May 10 11:23:12 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL> exit
執行成功!
一般是 SELinux 安全設定 導緻權限方面的不足 ,修改相應的權限問題就好;
chcon是修改security context(安全上下文)中type的。