0

I am trying to connect to an Oracle database schema whose username contains $, ex: ABCD$EFG

./sql.bat ABCD$EFG/dbpassword@dbhostname:1521:dbservicename 

The username is wrongly identified as ABCD instead of ABCD$EFG.

  USER          = ABCD
  URL           = jdbc:oracle:thin:@dbhostname:1521:dbservicename
  Error Message = ORA-01017: invalid username/password; logon denied

I have tried "ABCD$EFG", "ABCD\$EFG". Nothing works.

How to escape $ symbol in the username?

1 Answers1

0

It could be necessary to escape the $ on linux/mac that mean an env variable which it will try and replace.

Here's it working and notice the \$

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0


SQL> create user "ABCD$EFG" identified by dbpassword;

User "ABCD$EFG" created.

SQL> grant connect,resource to "ABCD$EFG";

Grant succeeded.


SQL> 
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0



dhcp-10-10-180-36:ords klrice$ sql "ABCD\$EFG"/dbpassword@//localhost:1521/xe

SQLcl: Release 18.4 Production on Wed Jan 16 14:14:16 2019

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

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0


SQL> 
Kris Rice
  • 3,300
  • 15
  • 33