我想知道帶有雙引號名稱的用戶應該如何登錄?
create user test_default identified by test_pass;
GRANT CREATE SESSION TO test_default;
sqlplus test_default/test_pass@localhost/DBRAZRAB <-- works fine, I'm connected
create user "test_lowercase" identified by test_pass;
GRANT CREATE SESSION TO "test_lowercase";
sqlplus "test_lowercase"/test_pass@localhost/DBRAZRAB <-- ORA-01017: invalid username/password; logon denied
SQL*Plus:版本 19.0.0.0.0 - 2022 年 1 月 5 日星期三 12:34:56 生產
版本 19.3.0.0.0
我想,我應該以某種方式修改連接字串,但是如何修改?
uj5u.com熱心網友回復:
當然,您可以做到這一點 - 前提是您知道如何:)
創建用戶 blabla - 如您所知,它可以作業:
SQL> connect sys as sysdba
Enter password:
Connected.
SQL> create user "test_lowercase" identified by test_pass;
User created.
SQL> grant create session to "test_lowercase";
Grant succeeded.
SQL> connect "test_lowercase"/test_pass
Connected.
SQL> exit
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
但是,您可以使用sqlplus可執行檔案從作業系統連接嗎?
c:\Temp>sqlplus "test_lowercase"/test_pass
SQL*Plus: Release 11.2.0.2.0 Production on Sri Sij 5 20:46:04 2022
Copyright (c) 1982, 2014, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
哎呀!那是行不通的。
但是,如果你轉義雙引號,那么它可以作業:
c:\Temp>sqlplus \"test_lowercase\"/test_pass
SQL*Plus: Release 11.2.0.2.0 Production on Sri Sij 5 20:46:09 2022
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL>
達達!
uj5u.com熱心網友回復:
在我的 Windows 機器上,嘗試啟動 SQLPlus 或 SQLcl 并使用相同的命令登錄時,似乎沒有保留區分大小寫。
您可以做的一個選擇是使用類似的命令啟動 SQLPlus(或 SQLcl)sqlplus /nolog,然后使用如下conn命令進行連接:
C:\temp>sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jan 5 14:41:21 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> conn "test_lowercase"/test_pass@tnsinfo
Connected.
SQL>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/407691.html
標籤:
上一篇:SQL查詢不起作用ORA-00979:不是GROUPBY運算式
下一篇:如何替換下一行存在的字串
