oracle使用者密碼設定的特殊字元問題

2021-09-22 19:06:13 字數 2452 閱讀 2054

當oracle使用者的密碼裡帶有如@、$、!等特殊字元時,會出現一些問題。

以hr使用者為例:

當oracle使用者的密碼裡帶有@時:

sys@orcl> alter user hr identified by qwet@2017;

alter user hr identified by qwet@2017 *

error at line 1:

ora-00922: missing or invalid option

sys@orcl> alter user hr identified by 'qwet@2017';

alter user hr identified by 'qwet@2017' *

error at line 1:

ora-00988: missing or invalid password(s)

sys@orcl> alter user hr identified by "qwet@2017";

user altered.

修改密碼需用雙引號包含密碼;

[oracle@hhu desktop]$ sqlplus hr/qwet@2017

sql*plus: release 11.2.0.4.0 production on thu sep 7 10:09:09 2017

error:

ora-12543: tns:destination host unreachable

enter user-name:

[oracle@hhu desktop]$ sqlplus 'hr/"qwet@2017"'

sql*plus: release 11.2.0.4.0 production on thu sep 7 10:08:28 2017

connected to:

oracle database 11g enterprise edition release 11.2.0.4.0 - 64bit production

hr@orcl>

在linux指令碼或shell中需要填寫使用者名稱和密碼時候按以下格式稍加修改;

'使用者名稱/"密碼"',加一對單引號和一對雙引號

當使用!時:

hr@orcl> alter user hr identified by qwet!2017;

alter user hr identified by qwet!2017 *

error at line 1:

ora-00922: missing or invalid option

hr@orcl> alter user hr identified by "qwet!2017";

user altered.

[oracle@hhu desktop]$ sqlplus 'hr/"qwet!2017"'

sql*plus: release 11.2.0.4.0 production on thu sep 7 10:01:38 2017

connected to:

oracle database 11g enterprise edition release 11.2.0.4.0 - 64bit production

hr@orcl>

當使用$時:

hr@orcl> alter user hr identified by qwet$2017;

user altered.

hr@orcl> conn hr/qwet$2017;

connected.

[oracle@hhu desktop]$ sqlplus hr/qwet$2017

sql*plus: release 11.2.0.4.0 production on thu sep 7 10:00:21 2017

error:

ora-01017: invalid username/password; logon denied

enter user-name:

[oracle@hhu desktop]$ sqlplus hr/"qwet$2017"

sql*plus: release 11.2.0.4.0 production on thu sep 7 10:00:35 2017

error:

ora-01017: invalid username/password; logon denied

enter user-name:

[oracle@hhu desktop]$ sqlplus 'hr/"qwet$2017"'

sql*plus: release 11.2.0.4.0 production on thu sep 7 10:00:44 2017

connected to:

oracle database 11g enterprise edition release 11.2.0.4.0 - 64bit production

hr@orcl>

Oracle 重新設定使用者密碼

重新設定密碼的語法 alter user user name identified by new password 當忘記sys使用者的密碼時,可通過以下方式來修改密碼 通過執行完成下面的命令 2 在輸入使用者名稱textfied中輸入 b as sysdba b 3 alter user syst...

oracle設定使用者

剛學使用oracle,首先使用oracle sql developer,建立連線的時候要有乙個使用者名稱 密碼 我又不想用系統使用者,所以就要建立乙個自己的使用使用者。首先開啟sql plus 登入輸入 sys pass as sysdba 建立表空間 create tablespace demos...

mysql 設定使用者密碼

方法1 用set password命令 mysql u root mysql set password for root localhost password newpass 記住 這裡修改了密碼和遠端訪問密碼不是一樣的,也就是,遠端訪問的密碼和這裡設定的密碼是單獨分開的,互補影響。方法2 用mys...