Share |

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

The tnsnames entry you are using to connect to the database is lacking the SID or SERVICE_NAME entry.
eg:
ERROR.EU.DBMOTIVE.COM =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = mydbserver)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
)
)
Altough a tnsping will succeed (as it does not connect to an SID), a connection request will fail:
C:\>sqlplus myuser@error

SQL*Plus: Release 9.2.0.7.0 - Production

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Enter password:
ERROR:
ORA-12504: TNS:listener was not given the SID in CONNECT_DATA
You need to add a correct SID or SERVICE_NAME to the tnsnames entry:
ERROR.EU.DBMOTIVE.COM =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = mydbserver)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=MYDB)
)
)
Also pay attention for spelling mistakes:
oracle@dev01:~$ sqlplus x/x@"(DESCRIPTION=(ADDRESS=(PRO=TCP)(HOST=10.10.0.1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAMEx=DEV01)))"

SQL*Plus: Release 11.1.0.7.0

Copyright (c) 1982, 2008, Oracle.  All rights reserved.

ERROR:
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
Here we make a spelling mistake in the SERVICE_NAME keyword.

When using Oracle easy Connect, this error will appear when you forget to include the service name in the connect string:
C:\>sqlplus system/manager@//10.0.0.1

SQL*Plus: Release 11.1.0.7.0

Copyright (c) 1982, 2008, Oracle.  All rights reserved.

ERROR:
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
When we include the SERVICE_NAME, all is correct:
C:\>sqlplus system/manager@//10.0.0.1/DEV01
 Was this information helpful?  Yes No
If it was not helpful, please take some time to explain why. This is not to ask questions, you can do so in the forum.

Welcome to our forum for Oracle error: ORA-12504 Add your own message



UKDB10 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = UKPSG03.GSC.ZZ)(PORT = 1522))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ukdb10)
)
)


SERVICE_NAME is existing, SID is not
 
oci_connect() [function.oci-connect]: ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
Hello,

Can you post the tnsnames info for the entry you are connect to?

Apparently, there is a missing value for SID or SERVICE_NAME, or the entry was not formatted correctly.
 
I was attempting of install the database 10g expess edition and when and I opened a cmd and I wrote C:\>sqlplus /nolog
sql>connect /as sysdba
end then it told me nothing to chage then when I tried to log the production database brought me

ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
Are you on Windows? Did you use the start database icon which was installed when Oracle XE is installed?

If so, you should not receive any errors.
 
 

i hav two databases in one server,i have faced problem with dblinks  which is,  i have seen dblink is properly work from one database and not in second database,the following message is ahown as error

NN > create database link ddl2
  2  connect to jk identified by jk
  3  using 'nart';

Database link created.

NN > select * from tab@ddl2;
select * from tab@ddl2
                  *
ERROR at line 1:
ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from DDL2

 

my listener.ora configuration is:

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = nardba)(PORT = 1521))
      )


      )
    )


SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = db2sid)
      (ORACLE_HOME = /oraeng/app/oracle/product/10.2.0)

    )
    (SID_DESC =
      (GLOBAL_DBNAME = dev1ora.devlin.com)
      (ORACLE_HOME =/oraeng/app/oracle/product/10.2.0)
      (SID_NAME = naren)
-------------------------------------------------------------------------------------

my tnsnames.ora is:

nart=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = nardba)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SID= db2sid)
    )
  )
----------------------------------------------------------------------------------------------

please solve my problem iam using redhat linux4.0

You got message:

 invalid username/password; logon denied

Meaning the username or password you used to create the database link are not correct

Add your message

 Please provide your personal info 



 Please ask your message as briefly and clear as possible 

 Spam Protection 
Validation Code: 68vocz6760ehj7gzn


Ask Your Question

If you need more information about this particular error message, you can leave a forum message.

We are replying to this message whenever we have some spare time, so please do not consider this as a private 'solve my critical issue asap' service.

Should you need professional Oracle Assistance to make your project a success, please have a look at our consultancy services.


Spam Protection

In order to prevent automatic generation of messages, we are asking for a validation code. This code is unique and is generated every time a new message is asked.

If you do not enter the validation correctly, your message will not be recorded.


Forum Rules

Please be polite, do not USE ALL UPPERCASE, no insults, violance or any other threats.