Question:
I am getting the ORA-12504 error when I I am not able to connect
to target via SQL*Plus. It fails with the error:
ORA-12504: TNS:listener was not given the SERVICE_NAME in
CONNECT_DATA.
How do I prevent this ORA-12504 error?
Answer: The ORA-12504 says that your service_name in your tnsnames.ora
has no SID.
Also see problem 556996.1 in
MOSC for known issues causing a false ORA-12504.
The
oerr utility gives details on the ORA-12504 error:
ORA-12504: TNS:listener was not given the SID
in CONNECT_DATA
Cause: The SID was missing from the CONNECT_DATA.
Action: Check that the connect descriptor corresponding to the
service name in TNSNAMES.ORA has an SID component in the
CONNECT_DATA.