Unable to establish the connection with the database ORA-12541: TNS: No Listener - Windows
search cancel

Unable to establish the connection with the database ORA-12541: TNS: No Listener - Windows

book

Article ID: 154322

calendar_today

Updated On:

Products

Data Loss Prevention Enforce

Issue/Introduction

A common error is 'Unable to establish the connection with the database. ORA-12541: TNS: No Listener.'

This can often occur when attempting to run the Update Readiness Tool (URT) on the Enforce server, 

Error: unable to establish db connection for user protect: ORA-12541:  TNS:no listener

Cause

It is possible the Listener service is not running on the Oracle Server.

Resolution

To resolve the issue, follow the steps below:

Confirm the Listener service is running on the Oracle Server using the "lsnrctl status" command. 

      1. If the Listener service is not running, try to start the Listener service.
    1. If the Listener service does not start, please refer to the article "Troubleshoot TNSListener" (also linked below.)

Verify the Environment variables are set correctly on the Enforce Server

      1. Two environment variable values are used when connecting to the Oracle Listener from Enforce, ORACLE_HOME and from the PATH variable, the value for %ORACLE_HOME%\bin or its equivalent.
        1. If either variable for ORACLE_HOME path or the PATH variable does not contain %ORACLE_HOME%\bin path do not exist on the system you will need to correct the system environment variables.
          1. Create a system environment variable ORACLE_HOME
            • the directory is the location of the db_1 (or folder name assigned during installation.)
          2. Add %ORACLE_HOME%\bin to the system PATH variable on the server.
            • Assure any other client references are either removed or this is earliest in the PATH variable listing.
        2. Confirm both are as expected as seen here:

Assure the destination address used matches that of the Oracle Listener

  1. Compare the TNSNAMES.ORA (Enforce) entry with the appropriate LISTENER.ORA (Oracle) file.
    1. \<Oracle Home>\product\<Oracle Version>\client_1\NETWORK\ADMIN\tnsnames.ora
    2. \<OracleHome>\product\<Oracle Version>\db_1\network\admin\Listener.ora
  2. Open the Listener.ora file and verify the port for incoming requests is reflected in the tnsnames.ora
    • Note:
      1. Any change must be consistent between the two files and servers.
      2. It is recommended that the HOST format be consistent in type
        1. IP value or DNS host name with FQDN included.

For additional information related to testing the connection string itself, Troubleshoot Enforce connection to Oracle

Additional Information

Troubleshoot TNSListener

Troubleshoot Enforce connection to Oracle