Linux – Unable to start Oracle listener as root user

linuxoracleoracle10g

I want to start Oracle Listner as root user. I am able to start listener as oracle user.
But its not starting as root user.
I am able to stop and check status as root user.

When I start listener as root it gives following messages:-

# lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 08-MAY-2012 15:08:11

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Starting /opt/oracle/102/bin/tnslsnr: please wait...

/opt/oracle/102/bin/tnslsnr: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory
TNS-12547: TNS:lost contact
 TNS-12560: TNS:protocol adapter error
  TNS-00517: Lost contact
   Linux Error: 32: Broken pipe

Please help me to start listener as root user.

Best Answer

You should not run Oracle as root user, it's a security risk. There is not a single reason to run the rdbms and/or the listener as root user, unless you completely messed up the installation, that also is not even allowed to run as root.

If you do feel a need to run the listener as root user, make sure that your environment variables are correct. In your case:

   # export ORACLE_HOME=/opt/oracle/102
   # export PATH=$PATH:$ORACLE_HOME/bin

   # cd $ORACLE_HOME/bin
   # chmod u+s lsnrctl
   # lsnrctl start

LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 09-MAY-2012 20:51:07

Copyright (c) 1991, 2010, Oracle. All rights reserved.

Starting /data/oracle/base/product/se_10205_s/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.5.0 - Production System parameter file is /data/oracle/base/admin/network/listener.ora Log messages written to /data/oracle/base/product/se_10205_s/network/log/listener.log Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production Start Date
09-MAY-2012 20:51:09 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /data/oracle/base/admin/network/listener.ora Listener Log File /data/oracle/base/product/se_10205_s/network/log/listener.log Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) The listener supports no services The command completed successfully

# lsnrctl stop

LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 09-MAY-2012 20:52:16

Copyright (c) 1991, 2010, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) TNS-01190: The user is not authorized to execute the requested listener command

Don't do this; if you do you make a mistake. Pick any other user that is member of the dba group but not root.

BTW: after this little demo I had to fix a little issue:

Started with pid=5215 Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) TNS-12555: TNS:permission denied TNS-12560: TNS:protocol adapter error
TNS-00525: Insufficient privilege for operation Linux Error: 1: Operation not permitted

problem was - obvious - that /var/tmp/.oracle/sLISTENER was owned by root. A little chown to the correct user took care of that.

Related Topic