-1

Using oracle SQL Plus command prompt i able to login with user "p 6". for login connect command is used. enter image description here

but i want to login with sqlplus command line utility and using window command prompt. but it not working due to space in username and password. i tried many thing double quote, single quote, / etc. does not work. enter image description here

  • 2
    You shouldn't be using usernames with spaces in, basically. Tom Kyte eludes to it here: asktom.oracle.com/pls/asktom/… - But basically you shouldn't be creating a username that would have to be a quoted identifier – Philᵀᴹ Sep 28 '16 at 13:43
  • I do not see any error message, fail is a vague description. Usernames are case-sensitive. user2 and "user2" are different users. The first one is automatically converted to uppercase (USER2), while the second one remains lowercase because of the quoting marks, so I would not be surprised, if you received an ORA-01017. – Balazs Papp Oct 1 '16 at 7:35
  • please post text input/output as text (e.g. between <pre></pre> tags and not as screenshots – miracle173 Oct 1 '16 at 11:29
7
C:\Users\balaz>sqlplus bp/bp@orcl

SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 28 15:51:40 2016

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

Last Successful login time: Wed Sep 28 2016 15:51:30 +02:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics,
Real Application Testing and Unified Auditing options

SQL> create user "U 1" identified by "PASS WORD";

User created.

SQL> grant create session to "U 1";

Grant succeeded.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics,
Real Application Testing and Unified Auditing options

C:\Users\balaz>sqlplus \""U 1"\"/\""PASS WORD"\"@orcl

SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 28 15:52:07 2016

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics,
Real Application Testing and Unified Auditing options

SQL> show user
USER is "U 1"
SQL>
-1

Try doing a sqlplus /nolog then connect. That should work.

SQL> create user bob identified by "     ";

User created.

Elapsed: 00:00:00.10
SQL> grant connect, create session to bob;

Grant succeeded.

Elapsed: 00:00:00.10
SQL> connect bob/"     "
Connected.
SQL > show user
USER is "BOB"
SQL > exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 28 09:25:28 2016

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

@ > connect bob/"     "
Connected.
SQL > show user
USER is "BOB"
  • The screenshot in the question shows that it's possible to connect once already in sqlplus itself, so this answer adds no value (sorry!) – Philᵀᴹ Sep 28 '16 at 13:42
  • Maybe you just can't do what you want. Have you though about getting rid of the spaces in the password? I can't connect with a password that has spaces from Linux. – Gandolf989 Sep 28 '16 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.