表锁:
SELECT OBJECT_NAME,
SESSION_ID SID,
MACHINE,
VS.MODULE,
'ALTER SYSTEM KILL SESSION ''' || SESSION_ID || ', ' || SERIAL# ||'''; ' KILL_SESSION,
VS.STATUS,
VS.ACTION,
SERIAL#,
ORACLE_USERNAME,
OS_USER_NAME
FROM V$LOCKED_OBJECT VO, V$SESSION VS, ALL_OBJECTS AO
WHERE VO.SESSION_ID = VS.SID
AND AO.OBJECT_ID = VO.OBJECT_ID
AND NVL(VS.ACTION, ' ') <> 'Service Management '
ORDER BY OBJECT_NAME, MACHINE, VS.MODULE;
用户锁:
--查看用户是否锁住
select username,account_status from dba_users where username='xxx';
--锁定用户
alter user xxx account lock;
--解锁用户
alter user xxx account unlock;
--查看用户限制登录次数(默认10次)
select * from dba_profiles where resource_name='FAILED_LOGIN_ATTEMPTS';
--修改用户无论输入多少次都不会被锁定
alter profile default limit failed_login_attempts unlimited;