Skip to content
Home » Oracle » How to Resolve TNS-01201: Listener cannot find executable

How to Resolve TNS-01201: Listener cannot find executable

TNS-01201

After adding a static service to the local listener, I tried to start the listener, but it failed with TNS-01201.

[oracle@test ~]$ vi $ORACLE_HOME/network/admin/listener.ora
...
SID_LIST_LISTENER=
  (SID_LIST=
    (SID_DESC=
      (SID_NAME=ORCL)
      (ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1)
    )
  )
[oracle@test ~]$ lsnrctl stop
[oracle@test ~]$ lsnrctl start
...
TNS-01201: Listener cannot find executable /u01/app/oracle/product/19.0.0/dbhome_1/bin/oracle for SID ORCL

Listener failed to start. See the error message(s) above...

Solution

To solve TNS-01201, we should inspect ORACLE_SID and ORACLE_HOME, then correct them if any.

We can get the information by checking environment variables like this:

[oracle@test ~]$ echo $ORACLE_SID
ORCLCDB
[oracle@test ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/19.3.0/dbhome_1

The second place that we can check ORACLE_SID and ORACLE_HOME is the oracle configuration table (oratab) on server.

[oracle@test ~]$ cat /etc/oratab
...
ORCLCDB:/u01/app/oracle/product/19.3.0/dbhome_1:Y

The format of every entry is as:

$ORACLE_SID:$ORACLE_HOME:<N|Y>

For Linux, Oracle configuration table is usually at /etc/oratab, but it may vary in other platforms.

As we can see, we used incorrect values of ORACLE_SID and ORACLE_HOME in the listener.ora.

  • ORACLE_SID
  • It should be ORCLCDB, not ORCL.

  • ORACLE_HOME
  • it should be 19.3.0, not 19.0.0.

We fixed the problem by correct the values of ORACLE_SID and ORACLE_HOME like this:

[oracle@test ~]$ vi $ORACLE_HOME/network/admin/listener.ora
...
SID_LIST_LISTENER=
  (SID_LIST=
    (SID_DESC=
      (SID_NAME=ORCLCDB)
      (ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1)
    )
  )

Then start the listener again.

[oracle@test ~]$ lsnrctl start
...
Services Summary...
Service "ORCLCDB" has 1 instance(s).
  Instance "ORCLCDB", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

We solved it.

Leave a Reply

Your email address will not be published. Required fields are marked *