Oracle修改用戶密碼錯誤次數及解鎖用戶


ORACLE11g錯誤密碼登錄默認是10次,10次錯誤后用戶將被鎖定,如下:

SQL> conn test/123456

ERROR: ORA-28000: the account is locked

 

1.查看被鎖定的用戶

SQL> select LOCK_DATE,username from dba_users where username='GXGAT';

LOCK_DATE USERNAME
--------- ------------------------------
16-JUN-20 TEST
LOCK_DATE為空說明沒有鎖定,非空為鎖定。

SELECT S.USERNAME,
DECODE(L.TYPE, 'TM', 'TABLE LOCK', 'TX', 'ROW LOCK', NULL) LOCK_LEVEL,
O.OWNER,
O.OBJECT_NAME,
O.OBJECT_TYPE,
S.SID,
S.SERIAL#,
S.TERMINAL,
S.MACHINE,
S.PROGRAM,
S.OSUSER
FROM V$SESSION S, V$LOCK L, DBA_OBJECTS O
WHERE S.SID = L.SID
AND O.OBJECT_ID = L.ID1
AND S.USERNAME IS NOT NULL;

2.解鎖用戶方式:

登陸sys用戶,執行解鎖命令

SQL> alter user test account unlock;

User altered.

SQL> conn test/password

Connected.

 

3.現在我們來查看下默認連接錯誤鎖定次數

SQL> select * from dba_profiles where resource_name like 'FAILED_LOGIN_ATTEMPTS%';

PROFILE RESOURCE_NAME RESOURCE            LIMIT
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------- -------- ---------------------------------------------------------------------------------------------------------------
COM INH IMP
--- --- ---
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD 10
NO NO NO

 

4.修改默認的錯誤登錄次數,為不限制(為安全起見,不建議使用)

SQL> alter profile DEFAULT limit FAILED_LOGIN_ATTEMPTS UNLIMITED;

SQL>alter profile default limit failed_login_attempts 20;    //修改為20次


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM