Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 746
Ris Avatar asked Jan 28 '11 06:01

Ris


People also ask

What is Oracle Service_name?

SERVICE_NAMES specifies one or more names by which clients can connect to the instance. The instance registers its service names with the listener. When a client requests a service, the listener determines which instances offer the requested service and routes the client to the appropriate instance.

Where can I find listener Ora file?

By default, the listener. ora file is located in the ORACLE_HOME/network/admin directory. The listener.

How do I find Oracle service name?

Right click on your Connection/Propriety. You should see the name on the left under something like "connection details" and should look like "Connectionname@servicename", or on the right, under the connection's details.


1 Answers

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

like image 194
Rene Luna Avatar answered Oct 11 '22 23:10

Rene Luna