Oracle使用者密碼使用特殊符號,例如&(AND)、$(Dollar)、#(Pound)、*(Star)等

來源:互聯網
上載者:User

原文出處:http://www.askmaclean.com/archives/password-symbol.html 

補充目的:http://www.cnblogs.com/AlbertCQY/archive/2013/03/29/2989764.html

我們在管理ORACLE使用者密碼安全的時候總會用到各種由工具產生的密碼帶有特殊符號的問題,例如&、*、#、$等,但是在使用如上特殊密碼往往會遇到各種錯誤,例如:

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 – Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options

SQL> create user maclean_password identified by #$%^&*!; create user maclean_password identified by #$%^&*! * ERROR at line 1: ORA-00911: invalid character

[oracle@database ~]$ oerr ora 911

00911, 00000, “invalid character” //

*Cause: identifiers may not start with any ASCII character other than //

letters and numbers. $#_ are also allowed after the first //

character. Identifiers enclosed by doublequotes may contain //

any character other than a doublequote. Alternative quotes //

(q’#…#’) cannot use spaces, tabs, or carriage returns as //

delimiters. For all other contexts, consult the SQL Language //

Reference Manual. //

*Action:

注意Oracle使用者的密碼必須以字母或者數字開頭(letters and numbers),否則將出現ORA-00911 錯誤

當已經確保以字母或者數字開頭的情況仍出現錯誤,則考慮使用雙引號”將密碼括起來,注意不要用中文IME的雙引號!!

SQL> create user maclean_password identified by 1#$%^&*!;

create user maclean_password identified by 1#$%^&*! *

ERROR at line 1: ORA-00911: invalid character

SQL> create user maclean_password identified by “1#$%^&*!”;

User created.

SQL> grant connect to maclean_password 2 ;

Grant succeeded.

SQL> conn maclean_password/”1#$%^&*!” Connected.

還有一種可能性是在SQLPLUS或者其他IDE(例如PL/SQL DEVELOPER下)存在&(AND)符號時,用戶端將&理解為變數,如:

SQL> create user maclean_password1 identified by “0000&a”; Enter value for a:

此時只需要將define修改為非&的其他符號即可,例如:

SQL> set define +

SQL> show define define “+” (hex 2b)

SQL> create user maclean_password1 identified by “0000&a”;

User created.

SQL> grant connect to maclean_password1;

Grant succeeded.

SQL> conn maclean_password1/”0000&a” Connected.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.