Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
959 views
in Technique[技术] by (71.8m points)

visual studio 2010 - 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
sahiproduct11.2.0dbhome_1
etworkadminnsnames.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
sahiproduct11.2.0dbhome_1
etworkadminlistener.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
sahi
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...