Friday, June 18, 2021

When starting Oracle Listener gets an error TNS-00525: Insufficient privilege for operation

Symptoms:
When trying to start the Oracle Listener, it returns an error regarding permission but not clear on the logs what it is:

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/ora19c/product/19.3.0/network/admin/listener.ora
Log messages written to /u01/ora19c/diag/tnslsnr/sandbox19js/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sandbox19js)(PORT=1521)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12555: TNS:permission denied
 TNS-12560: TNS:protocol adapter error
  TNS-00525: Insufficient privilege for operation
   Linux Error: 1: Operation not permitted


Cause:
In the directory /var/tmp/.oracle there exist some socket files which do not belong to UNIX user oracle and group dba, but to another user.
When the Listener process starts, it tries to create the following socket files:
  /var/tmp/.oracle/s#<pid>.1
  /var/tmp/.oracle/s#<pid>.2
  /var/tmp/.oracle/sREGISTER

where <pid> is the ID of the operating system process for the Listener.

Solution:
As UNIX user root, delete all socket files from directory /var/tmp/.oracle
Then as oracle owner UNIX user, starts the Listener by executing the command "lsnrctl start".

Wednesday, June 2, 2021

libnsl.so.1: cannot open shared object file: No such file or directory

Symptoms:

Installed the Oracle InstantClient on Linux Linux 8 (packages instantclient-basic-linux.x64-19.11.0.0.0dbru.zip and instantclient-sqlplus-linux.x64-19.11.0.0.0dbru.zip) and later configured the environment variables:
export ORACLE_HOME=/u01/instantclient_19_11/
export LD_LIBRARY_PATH=$ORACLE_HOME
export TNS_ADMIN=/u01/instantclient_19_11/network/admin
export PATH=$ORACLE_HOME:$PATH

When calling the sqlplus utilitary, it presents an error regarding Linux packages missing with message:
sqlplus: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory.


Cause: 

SqlPlus uses a few linux libraries and one of that is exactly the libnsl.
However there are a few packages with similar names (or endings) that does not solve the issue.


Solution:

Simply install the package libnsl with command:
yum install libnsl -y

Configure the Oracle DB Access Control List to avoid error like ORA-24247: network access denied

Symptoms:  You try to make external connections from the Oracle Database and receive erros like ORA-24247: network access denied by access c...