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次
