select * from dba_profiles where profile= DEFAULT  ..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Oracle 用戶登錄錯誤次數(shù)修改

發(fā)布時間:2020-07-06 07:02:26 來源:網(wǎng)絡(luò) 閱讀:1220 作者:hbxztc 欄目:關(guān)系型數(shù)據(jù)庫

Oracle默認(rèn)允許用戶輸入10次錯誤密碼,超過10次后賬戶就會被鎖定

sys@ORCL>select * from dba_profiles where profile='DEFAULT' and resource_name='FAILED_LOGIN_ATTEMPTS';

PROFILE 	RESOURCE_NAME		       RESOURCE_TYPE		LIMIT
--------------- ------------------------------ ------------------------ -------------------
DEFAULT 	FAILED_LOGIN_ATTEMPTS	       PASSWORD 		10

測試zx用戶,使用錯誤的密碼連接11次

[oracle@rhel6 ~]$ cat login.sh 
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
[oracle@rhel6 ~]$ sh login.sh

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:16 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:16 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:16 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:16 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:17 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:19 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:22 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:26 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:31 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:37 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:45 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-28000: the account is locked
#提示用戶被鎖定
#查詢視圖zx用戶被鎖定
sys@ORCL>select username,account_status,profile from dba_users where username='ZX';

USERNAME   ACCOUNT_STATUS	PROFILE
---------- -------------------- ---------------
ZX	   OPEN 		DEFAULT

基于這個特性,如果在生產(chǎn)上修改了數(shù)據(jù)庫用戶密碼,但是應(yīng)用部分沒有修改完全,則應(yīng)用啟動后有問題的應(yīng)用會一直嘗試連接數(shù)據(jù)庫導(dǎo)致數(shù)據(jù)庫用戶被鎖定,影響業(yè)務(wù)正常運(yùn)行??梢孕薷挠脩魢L試登錄次數(shù)為ulimited來防止這種情況發(fā)生。

sys@ORCL>alter user zx account unlock;

User altered.

sys@ORCL>alter profile default limit failed_login_attempts unlimited;

Profile altered.

sys@ORCL>select * from dba_profiles where profile='DEFAULT' and resource_name='FAILED_LOGIN_ATTEMPTS';

PROFILE 	RESOURCE_NAME		       RESOURCE_TYPE		LIMIT
--------------- ------------------------------ ------------------------ -------------------
DEFAULT 	FAILED_LOGIN_ATTEMPTS	       PASSWORD 		UNLIMITED

至此,用戶zx無論使用多少次錯誤密碼都不會導(dǎo)致賬戶鎖定。


官方文檔:http://docs.oracle.com/cd/E11882_01/network.112/e36292/authentication.htm#CHDEGBEG

參考文檔:http://www.2cto.com/database/201203/124001.html


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI