libclntsh.so.11.1:cannot restore segment prot after reloc:Permission denied 报错

在oracle  bin目录下执行命令报错

[oracle@standby bin]$ ./lsnrctl status
./lsnrctl: error while loading shared libraries: /home/oracle/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied


oracle@standby bin]$ ./sqlplus
./sqlplus: error while loading shared libraries: /home/oracle/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied


是selinux导致

解决方法

执行以下两条命令,或者完全关掉selinux
[root@standby ~]# semanage fcontext -a -t textrel_shlib_t  /home/oracle/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1

[root@standby ~]# restorecon -R -v /home/oracle/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1
restorecon reset /home/oracle/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1 context root:object_r:user_home_t:s0->system_u:object_r:textrel_shlib_t:s0

请使用浏览器的分享功能分享到微信等