Oracle 12c server cannot be accessed from remote computer using the .Net provider

StackOverflow https://stackoverflow.com/questions/23676311

  •  23-07-2023
  •  | 
  •  

Question

On the Oracle server, I can connect using the following:

enter image description here

The status is the following:

enter image description here

When I try to connect from my developer computer using the .Net provider with these settings:

enter image description here

I cannot connect and get the following error:

enter image description here

I tried with sqlplus:

sqlplus system/password@http://10.111.111.47:1521/Telefon

ERROR: ORA-12154: TNS:could not resolve the connect identifier specified

This is my listener.ora file content:

# listener.ora Network Configuration File: C:\app\Oracle\product\12.1.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\app\Oracle\product\12.1.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\app\Oracle\product\12.1.0\dbhome_1\bin\oraclr12.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

Firewall is disabled.

What should I set?

Was it helpful?

Solution

You should not have the http: in the host name, in either place. The SQL*Plus version would be:

sqlplus system/password@//10.111.111.47:1521/Telefon

assuming the service name is the same as the SID, which isn't necessarily the case; from your lsnrctl status it is for you so that part should be OK.

But your listener is only listening on localhost, 127.0.0.1. That means it is not contactable from anywhere else. You'll probably get a 'no listener' error with that connection string. You need to modify your listener configuration so it's listening on the external IP address, 10.111.111.47, which is hopefully static and not assigned by DHCP. It can listen on both addresses if necessary:

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = AndrasWin7x64v1)(PORT = 1521))
    )
  )

Assuming AndrasWin7x64v1 resolves to 10.111.111.47, at least within that server; if not you can use the IP address instead:

      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.111.111.47)(PORT = 1521))

But again, you should only be using IP addresses if the server's IP is static; if it's dynamic (assigned by DHCP) then you should be using a DNS name that resolves to that address, in the listener.ora and from the client, and you should probably do that anyway even if it is static in case it has to change in the future.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top