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            LIMIToracle登录命令
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------- -------- ---------------------------------------------------------------------------------------------------------------
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次

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。