"오라클 사용자 LOCK"의 두 판 사이의 차이
DB CAFE
(새 문서: -- 사용자 LOCK ALTER USER XXAPP ACCOUNT LOCK; ALTER USER XXBAT ACCOUNT LOCK; -- 사용자 UNLOCK ALTER USER XXXAPP ACCOUNT UNLOCK; ALTER USER XXXBAT ACCOUNT UNLOCK;) |
(→사용자 락/발생원인 유저 찾기) |
||
(같은 사용자의 중간 판 3개는 보이지 않습니다) | |||
1번째 줄: | 1번째 줄: | ||
− | + | === 사용자 LOCK === | |
+ | <source lang=sql> | ||
ALTER USER XXAPP ACCOUNT LOCK; | ALTER USER XXAPP ACCOUNT LOCK; | ||
ALTER USER XXBAT ACCOUNT LOCK; | ALTER USER XXBAT ACCOUNT LOCK; | ||
− | + | </source> | |
− | + | === 사용자 UNLOCK === | |
+ | <source lang=sql> | ||
ALTER USER XXXAPP ACCOUNT UNLOCK; | ALTER USER XXXAPP ACCOUNT UNLOCK; | ||
ALTER USER XXXBAT ACCOUNT UNLOCK; | ALTER USER XXXBAT ACCOUNT UNLOCK; | ||
+ | </source> | ||
+ | |||
+ | === 사용자 락/발생원인 유저 찾기 === | ||
+ | <source lang=sql> | ||
+ | select os_username,username, userhost, terminal | ||
+ | , to_char(timestamp, 'YYYY/MM/DD HH24:MI:SS') date_time | ||
+ | , to_char(extended_timestamp, 'YYYY/MM/DD HH24:MI:SS') ext_date_time | ||
+ | , action_name | ||
+ | , returncode | ||
+ | , case when returncode = '1017' then 'invalid username/password..' | ||
+ | when returncode = '28000' then 'account is locked' | ||
+ | end returncode_why | ||
+ | from dba_audit_session | ||
+ | where action_name = 'LOGON' | ||
+ | and returncode in (1017, 28000) -- returncode 1017(invalid username/password ... ), 28000 (the account is locked) | ||
+ | and timestamp > trunc(sysdate) | ||
+ | -- and username = '디비계정' | ||
+ | order by date_time desc; | ||
+ | </source> | ||
+ | |||
+ | [[Category:oracle]] |
2021년 1월 20일 (수) 13:40 기준 최신판
thumb_up 추천메뉴 바로가기
- DBA { Oracle DBA 명령어 > DBA 초급 과정 > DBA 고급 과정 }
- 튜닝 { 오라클 튜닝 목록 }
- 모델링 { 데이터 모델링 가이드 }
1 사용자 LOCK[편집]
ALTER USER XXAPP ACCOUNT LOCK;
ALTER USER XXBAT ACCOUNT LOCK;
2 사용자 UNLOCK[편집]
ALTER USER XXXAPP ACCOUNT UNLOCK;
ALTER USER XXXBAT ACCOUNT UNLOCK;
3 사용자 락/발생원인 유저 찾기[편집]
select os_username,username, userhost, terminal
, to_char(timestamp, 'YYYY/MM/DD HH24:MI:SS') date_time
, to_char(extended_timestamp, 'YYYY/MM/DD HH24:MI:SS') ext_date_time
, action_name
, returncode
, case when returncode = '1017' then 'invalid username/password..'
when returncode = '28000' then 'account is locked'
end returncode_why
from dba_audit_session
where action_name = 'LOGON'
and returncode in (1017, 28000) -- returncode 1017(invalid username/password ... ), 28000 (the account is locked)
and timestamp > trunc(sysdate)
-- and username = '디비계정'
order by date_time desc;