原文出處: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.