SQL*Plus Command Line Behavior for Easy Connection Identifiers Does Not Match Documentation (Doc ID 1065303.1)

Last updated on MARCH 08, 2017

Applies to:

SQL*Plus - Version 10.1.0.2 to 11.1.0.6 [Release Oracle10g to 11.1]
Information in this document applies to any platform.
"Checked for relevance on 29-Jan-2013"


Symptoms

When using an Easy Connection identifier in command line, SQL*Plus requires password to be specified in command line, otherwise, it fails with errors.

ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
SP2-0751: Unable to connect to Oracle. Exiting SQL*Plus


For example:
Execute from command line:

sqlplus -L userid@localhost/mymachine.mydomain.com

SQL*Plus does not ask for a password and it returns:

SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 17 18:20:24 2010

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

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


SP2-0751: Unable to connect to Oracle. Exiting SQL*Plus



However, in the SQL*Plus documentation (specifically, "SQL*Plus User's Guide and Reference Release 10.2") ,  it gives the following syntax as an example:

sqlplus hr@//mymachine.mydomain:port/MYDB

This example does not work.

The same behavior appears in 10gR2, 11g and 11gR2.

The successful connection can be established with password only:


$ sqlplus -L userid/password@localhost/mymachine.mydomain.com

SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 17 18:21:06 2010

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Data Mining and Real Application Testing options

SQL>



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms