ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

Ris picture Ris · Jan 28, 2011 · Viewed 58.2k times · Source

I'm trying to connect my local Oracle 11g database using server explorer in Visual Studio 2010. I tried to setup everything as per instruction, but I'm still getting an ORA-12504 error.

Here is the error:

enter image description here

Here is my tnsnames.ora contents:

# tnsnames.ora Network Configuration File: C:\app\rsahi\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.


VENUS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = SPRPRG020)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = VENUS)
    )
  )

LISTENER_VENUS =
  (ADDRESS = (PROTOCOL = TCP)(HOST = SPRPRG020)(PORT = 1521))

listener.ora file contents,

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

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

ADR_BASE_LISTENER = C:\app\rsahi

Answer

Rene Luna picture Rene Luna · Jun 6, 2012

Try this, in Visual Studio's Server Explorer Data Connection panel:

Data source name: SPRPRG020/VENUS

i.e. the Data source name format is SERVER_NAME_OR_IP/DATABASE_NAME