无法使用EzConnect语法使用包含$的用户名连接到sqlcl

时间:2018-11-30 06:45:07

标签: oracle sqlcl

我正在尝试连接到用户名包含$的Oracle数据库模式,例如:ABCD $ EFG

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

用户名被错误地标识为ABCD而不是ABCD $ EFG。

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

我尝试过“ ABCD $ EFG”,“ ABCD \ $ EFG”。什么都没有。

如何在用户名中转义$符号?

1 个答案:

答案 0 :(得分:0)

可能有必要在linux / mac上转义$,这意味着它将尝试替换的env变量。

在这里工作,并注意到\ $

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>