SELinux and Oracle – How to disable SELinux and make Oracle work

If you encounter this error on Oracle it is a good possibility that you have SELinux enabled on your Linux box:

$> sqlplus / as sysdba
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
The quick way to get Oracle working is to use setenforce:

$> setenforce 0
$> sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 13 15:31:35 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.

However, this solution will only work until you reboot the server.
To permanently fix this issue you need to modify the SELinux configuration file:

$> vi /etc/selinux/config
Change:
SELINUX=enforcing
To:
SELINUX=disabled
You should also be able to use permissive mode on single instances, if you change to this mode BEFORE you install Oracle:
SELINUX=permissive
CRS will not like permissive mode, so this does not apply for RAC installations.
Now SQL*Plus works:

$> sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 13 15:31:35 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.

Tags: , , , ,

This entry was posted on Monday, March 8th, 2010 at 21:43 and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

 

Leave a Reply