Friday, April 11, 2025

Solution to "ORA-12546: TNS:permission denied" when starting sqlplus

Problem: when trying to start sqlplus, the error below is thrown:
ORA-12546: TNS:permission denied
Cause: Incorrect permissions on the oracle binary.

It needs the setuid permissions. Without those permissions, it cannot open sockets or shared memory properly — and the ORA-12546 is thrown when trying to connect via sqlplus.

Solution: Relink the oracle binary
oracle@myserver:[cdb]# ls -l $ORACLE_HOME/bin/oracle
-rw-r--r-- 1 oracle dba 0 Jan 24 09:57 /u01/oracle/product/19c/bin/oracle
oracle@myserver:[cdb]# cd $ORACLE_HOME/rdbms/lib
oracle@myserver:[cdb]# make -f ins_rdbms.mk ioracle
Afterwards, permissions are correct:
oracle@myserver:[cdb]# ls -l $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 oracle dba 462603312 Apr 11 10:54 /u01/oracle/product/19c/bin/oracle

No comments:

Post a Comment