본문 바로가기

Oracle/Error

How to unlock Oracle user account


 

How to unlock Oracle user account

Here's how to lock or unlock Oracle database user accounts.

SQL> ALTER USER username ACCOUNT LOCK;

SQL> ALTER USER username ACCOUNT UNLOCK;


[ORACLE] ORA-28000: the account is locked 오류시

sqlplus hr/hr

-- ORA-28000: the account is locked 오류시
-- 30일동안(Default) 해당 계정으로 로그인을 하지 않았을 경우 lock 걸림
--

sqlplus "/ as sysdba"  로 접속 

-- lock 걸린 User 찾기
SELECT username, account_status, to_char(lock_date,'yy/mm/dd hh24:mi') lock_date, profile
  FROM dba_users;
 
-- Lock 풀기 (유저가 system 일 경우)
ALTER USER SYSTEM account unlock; 

-- 패스워드 변경
ALTER USER SYSTEM IDENTIFIED BY manager;

sqlplus hr/hr
conn hr/hr

C:\oraclexe\app\oracle\product\10.2.0\server\RDBMS\ADMIN(실행계획)

@utlxplan.sql
desc plan_table
set autotrace traceonly explan
select * from employees;