Home > Software design >  Oracle database SQLPLUS: How to enter password has character @?
Oracle database SQLPLUS: How to enter password has character @?

Time:08-25

Oracle database 21c express edition on Windows 11.

enter image description here

My error

ORA-12154: TNS:could not resolve the connect identifier specified

enter image description here

My password is xxxxxa@ . I see enter image description here

CodePudding user response:

Double quotes are your friend here

SQL> create user XXX identified by 123@456;
create user XXX identified by 123@456
                                 *
ERROR at line 1:
ORA-00922: missing or invalid option


SQL> create user XXX identified by "123@456";

User created.

SQL> grant create session to xxx;

Grant succeeded.

SQL> connect xxx/123@456@db19_pdb1
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified


Warning: You are no longer connected to ORACLE.
SQL> connect xxx/"123@456"@db19_pdb1 as sysdba
Connected.

CodePudding user response:

sqlplus /nolog
connect sys/"123456a@"@xe as sysdba

SQL> alter session set "_ORACLE_SCRIPT"=true;  
SQL> create user donhuvy identified by "123456a@";
SQL> grant create session to donhuvy;
SQL> connect donhuvy/"123456a@"@xe
  • Related