創建賬號或修改賬號密碼時有可能會遇到ORA-00988: missing or invalid password(s),那麼什麼情況下會遇到這種錯誤呢? 一般是因為密碼的設置不符合命名規範: 1:密碼是關鍵字,但是沒有用雙引號包裹起來。 2:密碼以數字開頭,但是沒有用雙引號包裹起來 3:密碼包含特殊...
創建賬號或修改賬號密碼時有可能會遇到ORA-00988: missing or invalid password(s),那麼什麼情況下會遇到這種錯誤呢? 一般是因為密碼的設置不符合命名規範:
1:密碼是關鍵字,但是沒有用雙引號包裹起來。
2:密碼以數字開頭,但是沒有用雙引號包裹起來
3:密碼包含特殊字元,並且沒有用雙引號包裹起來。
官方文檔關於passwor的介紹如下:
The BY password clause lets you creates a local user and indicates that the user must specify password to log on to the database. Passwords can contain only single-byte characters from your database character set regardless of whether the character set also contains multibyte characters.
Passwords must follow the rules described in the section "Schema Object Naming Rules", unless you are using the Oracle Database password complexity verification routine. That routine requires a more complex combination of characters than the normal naming rules permit. You implement this routine with the UTLPWDMG.SQL script, which is further described in Oracle Database Security Guide.
而Schema Object Naming Rules就包含下麵這些規則。
More usernames than passwords were specified in a GRANT statement. A valid password must be specified for each username listed in the GRANT statement. This error indicates that you are violating the object names and qualifiers for Oracle. The following rules apply when naming objects:
1) Names must be from 1 -30 characters long with the exceptions: - Names of database are limited to 8 characters. - Names of database links can be as long as 128 characters.
2) Names cannot contain quotation marks.
3) Names are not case-sensitive. (註意,這條只適用於ORACLE 10g)
4)A name must begin with and contain an alphanumeric character from your database character set unless surrounded by double quotation marks. 5) Oracle strongly discourages using $ and #.
下麵我們通過幾個案例來瞭解一下上面的內容吧
1:密碼是關鍵字,但是沒有用雙引號。
SQL> create user test identified by table;
create user test identified by table
*
ERROR at line 1:
ORA-00988: missing or invalid password(s)
SQL> create user test identified by 'table';
create user test identified by 'table'
*
ERROR at line 1:
ORA-00988: missing or invalid password(s)
SQL> create user test identified by "table";
User created.
2:密碼以數字開頭,但是沒有使用雙引號
SQL> create user test identified by 123456;
create user test identified by 123456
*
ERROR at line 1:
ORA-00988: missing or invalid password(s)
SQL> create user test identified by '123456';
create user test identified by '123456'
*
ERROR at line 1:
ORA-00988: missing or invalid password(s)
SQL> create user test identified by "123456";
User created.
3:密碼包含特殊字元,並且沒有用雙引號。
SQL> drop user test;
User dropped.
SQL> create user test identified by k*123$6;
create user test identified by k*123$6
*
ERROR at line 1:
ORA-00922: missing or invalid option
SQL> create user test identified by 'k*123$6';
create user test identified by 'k*123$6'
*
ERROR at line 1:
ORA-00988: missing or invalid password(s)
SQL> create user test identified by "k*123$6";
User created.