This forum is currently locked. You can't register or post questions at this time. (read more)

failed to easy connect:ORA-12504: TNS:listener was not given

All posts relating to Oracle database administration.

Moderator: Tim...

kytemaniac
Senior Member
Posts: 234
Joined: Tue May 19, 2009 12:59 am

failed to easy connect:ORA-12504: TNS:listener was not given

Postby kytemaniac » Mon Dec 31, 2012 6:15 pm

Hi,

my oracle version is Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

my platform is as follow:

Code: Select all

SYS@orcl>select platform_id, platform_name from v$database;

PLATFORM_ID
-----------
PLATFORM_NAME
--------------------------------------------------------------------------------
    13
Linux x86 64-bit




tnsname.ora is as follow:

Code: Select all

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.localdomain)
    )
  )


when I do the following

Code: Select all

[oracle@localhost ~]$ sqlplus scott@"localhost/orcl"

SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 1 02:10:46 2013

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

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


Enter user-name:




I get the above error, is there any way I can resolve the error?

thanks

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: failed to easy connect:ORA-12504: TNS:listener was not g

Postby Tim... » Mon Dec 31, 2012 6:19 pm

Hi.

Why would you expect this to work? I've never seen anyone trying to connect like this. Do you perhaps mean the EZ Connect URL, like this:

Code: Select all

//localhost:1521/orcl.localdomain


Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

kytemaniac
Senior Member
Posts: 234
Joined: Tue May 19, 2009 12:59 am

Re: failed to easy connect:ORA-12504: TNS:listener was not g

Postby kytemaniac » Mon Dec 31, 2012 6:25 pm

No I did not have a url host, what should I replace localhost? the above set up is set up locally in a linux box

I try replacing with 127.0.0.1

Code: Select all

[oracle@localhost ~]$ sqlplus scott@"127.0.0.1:1521/orcl"

SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 1 02:26:15 2013

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

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


Enter user-name:




still fail

thanks

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: failed to easy connect:ORA-12504: TNS:listener was not g

Postby Tim... » Mon Dec 31, 2012 9:08 pm

Hi.

No. The EZ Connect URL is a way of connecting without needing to define a full TNS alias. for example.

Code: Select all

sqlplus scott@//localhost:1521/orcl.localdomain


If you have a regular TNS alias defined in the tnsnames.ora file, then you can use that.

Code: Select all

sqlplus scott@orcl


This has nothing to do with any specific OS. This is the same way Oracle works on all platforms.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog


Return to “Oracle Database Administration”

Who is online

Users browsing this forum: No registered users and 6 guests