This discussion is archived
5 Replies Latest reply: Sep 18, 2012 2:32 AM by 930454 RSS

`ORA-12504: listener was not given the SERVICE_NAME`, but it was

930454 Newbie
Currently Being Moderated
Hi all!

My OS is RHEL 6.1. Oracle DB 11.2

I set "TNS_ADMIN=”/usr/lib/oracle/11.2/client64/bin” export TNS_ADMIN" in /etc/profile

My listener.ora locates in /usr/lib/oracle/11.2/client64 and contains:

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME=MYDB)
(SID=MYDB)
)
)
)

tnsnames.ora
MYDB =

(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME=MYDB)
(SID=MYDB)
)
)

But when it type: "*isql -v mudsn system system*", I get message "ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA"

When I type tnsping localhost, I receive "(DESCRIPTION =(CONNECT_DATA =(SERVICE_NAME=))(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)))"
Where it comes from????

Thank you in advance

PS:
odbc.ini
[mydsn]
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
BindAsFLOAT = F
CloseCursor = F
DisableDPM = F
DisableMTS = T
Driver = Oracle
DSN = mydsn
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
ServerName = localhost
Database = MYDB
Username = system
Password = system
SQLGetData extensions = F
Translation DLL = Translation
Option = 0
DisableRULEHint = T
UserID =

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points