0

我正在尝试连接到用户名包含 $ 的 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”。没有任何效果。

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

4

1 回答 1

0

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

这是它的工作并注意 \$

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> 
于 2019-01-16T19:16:03.297 回答