Immediately after a successful RDBMS installation (perhaps even including a sample DB instance creation), sqlplus will not start:

[oracle@test ~]$ sqlplus ‘/as sysdba’
sqlplus: error while loading shared libraries: /u01/app/oracle/product/11.1.0/db_1/lib/libnnz11.so: cannot restore segment prot after reloc: Permission denied

The reason is that SELinux is running in “enforcing” mode.

You can check it on file /etc/pam.d/login

Oracle development has recommended the following workaround while they correct the problem:

Switch SELinux from the default “Enforcing” mode that it is running in, to the “Permissive” mode.

Commands, as root:
======================
getenforce       (returns “Enforcing”)
setenforce 0
getenforce       (returns “Permissive”)

This allows SELinux to continue running, and logging denial messages, but SELinux will not actually deny any operations. Once Development has resolved this issue, you can (and should) return SELinux to the default “Enforcing” mode as follows:

Commands, as root:
======================
setenforce 1
getenforce       (returns “Enforcing”)

20 responses to “sqlplus: error while loading shared libraries: /u01/app/oracle/product/11.1.0/db_1/lib/libnnz11.so: cannot restore segment prot after reloc: Permission denied”

  1. Kit Avatar

    Command setenforce 0
    solved the problem.

    Like

  2. Hasan Raihan Avatar
    Hasan Raihan

    Solved my problem. Thank u very much Lidia Lima.

    Like

  3. Mauro Paludeti Avatar
    Mauro Paludeti

    awesome! thanks a bunch… I had same problem after installing Db 11gR2 (11.2.0.1.0) on OEL 5.5. — setenforce to 0 solve these 2 issues:

    ./lsnrctl status
    -bash-3.2$ cd /oracle01/app/oracle/product/11.2.0/oradba/bin
    -bash-3.2$ ./lsnrctl status
    ./lsnrctl: error while loading shared libraries: /oracle01/app/oracle/product/11.2.0/oradba/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied
    -bash-3.2$

    and

    -bash-3.2$ sqlplus / as sysdba
    sqlplus: error while loading shared libraries: /oracle01/app/oracle/product/11.2.0/oradba/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied
    -bash-3.2$

    thanks a lot… :)

    Like

    1. venkatesh Avatar
      venkatesh

      hi
      can u tell me the procedure to solve the above same as yours
      clearly i am fresher

      Like

  4. marc guentgen Avatar
    marc guentgen

    helped me for centos on virtualbox too. thank you very much.

    Like

  5. Ahmed Zeidan Avatar
    Ahmed Zeidan

    i disabled the SELinux using the root user ( echo 0 >/selinux/enforce) and being able to use the sqlplus . thank you very much

    Like

    1. naidu Avatar
      naidu

      thanqqqqqqqqq alot

      Like

  6. Suraj Avatar
    Suraj

    This worked! Thanks a lot.

    Like

  7. Anup A. uplenchwar Avatar

    This problem will help on RHEL 5
    I simpally run
    at root
    getenforce
    setenforce 0
    getenforce

    and the problem is solved…..
    thanks a lot!!!!

    Like

  8. Andrew_IF Avatar
    Andrew_IF

    RHEL 5.5 solves the problem. Thank you!

    Like

  9. hariganesh Avatar
    hariganesh

    superb, Than Q very much

    Like

  10. ali Avatar
    ali

    thanks it works for me.

    Like

  11. Rony Avatar
    Rony

    Hi,
    I have resolved this issue by setting SELINUX=permissive in /etc/selinux/config file
    Thanks.

    Like

  12. Kirill Avatar
    Kirill

    I do not want disable SElinux.

    Like

  13. rajesh pachiyappan Avatar
    rajesh pachiyappan

    thanks it worked fine..

    Regards,
    Rajesh Pachiyappan

    Like

  14. Brian Avatar
    Brian

    Bless you, saved me a great deal of frustration

    Like

  15. sam Avatar
    sam

    [root@lin01 ~]# setenforce 0
    setenforce: SELinux is disabled
    [root@lin01 ~]# sudo su – oracle
    [oracle@lin01 ~]$ sqlplus ‘/as sysdba’
    sqlplus: error while loading shared libraries: /u01/app/oracle/product/11.2/db_1/lib/libclntsh.so.11.1: file too short
    [oracle@lin01 ~]$

    Did not work for me. Any other advise would be greatly appreciated!!

    Like

  16. ashutosh Avatar
    ashutosh

    Sir i have some problem please help
    Error while loading shared libraries :/oracle/app/product/10.2.0/db_1/lib/libnnzll.so: file is too short

    Like

  17. Remember Avatar
    Remember

    Alex.. this post is still helping

    Like

  18. satyanarayana Avatar

    thanku soooo much

    Like

Leave a reply to Anup A. uplenchwar Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.