oracle 锁用户
oracle 线上用户老是被锁:
1,查明所有的用户哪些被锁了
SQL> select username,account_status,lock_date from dba_users; USERNAME ACCOUNT_STATUS ------------------------------ -------------------------------- LOCK_DATE ------------------- USER1 OPEN USER2 OPEN MGMT_VIEW OPEN
2,查看某个用户(ABCuser这个用户)是否被锁:
select LOCK_DATE,username from dba_users where username='ABCecuser';
LOCK_DATE为空说明没有锁定,非空为锁定。
3,解锁方法
ALTER USER USER_NAME ACCOUNT UNLOCK;
4,一般数据库默认是10次尝试失败后锁住用户
4.1、查看FAILED_LOGIN_ATTEMPTS的值
SQL> select * from dba_profiles where resource_name like 'FAILED_LOGIN_ATTEMPTS%';
PROFILE RESOURCE_NAME RESOURCE
------------------------------ -------------------------------- --------
LIMIT
----------------------------------------
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD
10
MONITORING_PROFILE FAILED_LOGIN_ATTEMPTS PASSWORD
UNLIMITED
4.2、修改为30次
alter profile default limit FAILED_LOGIN_ATTEMPTS 30;
4.3、修改为无限次(为安全起见,不建议使用)
alter profile default limit FAILED_LOGIN_ATTEMPTS unlimited;