安装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>
oracle@rac:/opt>sqlplus "/as sysdba"
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>
SQL>
SQL>
SQL>
SQL> exit
执行成功!
一般是 SELinux 安全设置 导致权限方面的不足 ,修改相应的权限问题就好;
chcon是修改security context(安全上下文)中type的。
相关资料:SELinux 资料