您好,登錄后才能下訂單哦!
Oracle默認允許用戶輸入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
基于這個特性,如果在生產上修改了數據庫用戶密碼,但是應用部分沒有修改完全,則應用啟動后有問題的應用會一直嘗試連接數據庫導致數據庫用戶被鎖定,影響業務正常運行。可以修改用戶嘗試登錄次數為ulimited來防止這種情況發生。
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無論使用多少次錯誤密碼都不會導致賬戶鎖定。
官方文檔:http://docs.oracle.com/cd/E11882_01/network.112/e36292/authentication.htm#CHDEGBEG
參考文檔:http://www.2cto.com/database/201203/124001.html
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。