0

I connected to an Oracle 19c database and executed the following SQL:

alter user sys identified by "a b" container=all;

It executed successfully. However, after that I can't connect to Oracle using SQLPlus. Below is my trying:

oracle:[~]$ sqlplus
Enter user-name: sys as sysdba
Enter password:
SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}] [edition=value]]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
      <proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
Enter user-name: oracle:[~]$
oracle:[~]$
oracle:[~]$
oracle:[~]$ sqlplus sys/"a b"@localhost:1521/ORCLCDB as sysdba
... (not work)
oracle:[~]$ sqlplus sys/\"a b\"@localhost:1521/ORCLCDB as sysdba
... (not work)
oracle:[~]$ sqlplus sys@localhost:1521/ORCLCDB as sysdba
... (type "a b" without quotes and not work)

How can I connect to the database?

  • Off the top of my head you can connect as “internal” – Gaius Jul 30 at 21:12
  • I'm using Oracle 19c and it seems no "internal". <logon> is: {<username>[/<password>][@<connect_identifier>] | / } [AS {SYSDBA | SYSOPER | SYSASM | SYSBACKUP | SYSDG | SYSKM | SYSRAC}] [EDITION=value] – Just a learner Jul 30 at 21:16
2

Not able to login to oracle using sqlplus utility because username and password contain space

[oracle@o71 ~]$ sqlplus sys/Oracle123@\'localhost/MIN19_O71\' as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Jul 30 23:12:19 2019
Version 19.4.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.4.0.0.0

SQL> alter user sys identified by "Oracle 123";

User altered.

SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.4.0.0.0

[oracle@o71 ~]$ sqlplus sys/\""Oracle 123\""@\'localhost/MIN19_O71\' as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Jul 30 23:19:25 2019
Version 19.4.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.4.0.0.0

SQL>
  • Hi @Balazs, thanks for your answer! I'm able to log into the database now. I want to confirm that, by running alter user sys identified by "a b" container=all;, my password is a b or "a b"? Thank you! – Just a learner Jul 30 at 21:23
  • 1
    @Justalearner docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/… "Passwords can contain any single-byte, multibyte, or special characters, or any combination of these, from your database character set, with the exception of the double quotation mark (") and the return character." – Balazs Papp Jul 30 at 21:28

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.