오라클 HR 계정을 해제하기 위해서

오라클 공식 문서(아래 링크)에 나와있는데로 해보자.

sqlplus 나  Oracle SQL Developer 에서 SYSTEM 또는 sys로 접속 후 아래와 같이 하면된다.

 

 

요약>

SYSTEM or SYS 유저 로그인

ALTER USER hr ACCOUNT UNLOCK;

ALTER USER hr IDENTIFIED BY <hr-password>;

 

 

처리>

1) 로그인 사용자 확인

2) hr 상태 확인

3) hr 잠김해제 - ACCOUNT_STATUS 가 EXPIRED & LOCKED 에서 EXPIRED 로 바뀌고, 

4) hr 비밀번호 설정 - ACCOUNT_STATUS 가 EXPIRED 에서 OPEN 으로 바뀐다.

 

 

Oracle SQL Developer 로 접속

1) 로그인 사용자 확인

SHOW USER

 

스크립트 출력(Script Output)>

USER is "SYS"

 

 

2) hr 상태 확인

SELECT 

    USERNAME

    , ACCOUNT_STATUS

    , LOCK_DATE

    , EXPIRY_DATE

    , DEFAULT_TABLESPACE
  FROM DBA_USERS

 WHERE USERNAME = 'HR';

 

질의 결과(Query Result)>

USERNAME ACCOUNT_STATUS LOCK_DATE EXPIRY_DATE DEFAULT_TABLESPACE

HR EXPIRED & LOCKED 14/FEB/19 14/FEB/19 USERS

 

 

3) hr 잠김해제 - ACCOUNT_STATUS 가 EXPIRED & LOCKED 에서 EXPIRED 로 바뀌고, 

ALTER USER hr ACCOUNT UNLOCK;

 

스크립트 출력(Script Output)>

User HR이(가) 변경되었습니다.(User HR altered.)

 

 

4) hr 유저 비밀번호 설정 - ACCOUNT_STATUS 가 EXPIRED 에서 OPEN 으로 바뀐다.

ALTER USER hr IDENTIFIED BY hr;

 

스크립트 출력(Script Output)>

User HR이(가) 변경되었습니다.(User HR altered.)

 

 

hr 유저로 접속이 가능하다.

 

 

출처>

오라클 공식 문서

https://docs.oracle.com/cd/E17781_01/admin.112/e18585/toc.htm#XEGSG121

 

Database Express Edition Getting Started Guide

5 Unlocking the Sample User Account

5.1 Unlock HR Using the SQL Command Line

  1. Display the SQL command prompt window. For example, on Windows, click Start, then Programs (or All Programs), then Oracle Database 11g Express Edition, and then Run SQL Command Line.

  2. Connect as the SYSTEM user:

    • Type: connect

    • Enter user-name: system

    • Enter password: <password-for-system>

  3. Enter the following statement to unlock the HR account:

    SQL> ALTER USER hr ACCOUNT UNLOCK;

  4. Enter a statement in the following form to specify the password that you want for the HR user:

    SQL> ALTER USER hr IDENTIFIED BY <hr-password>;

  5. Optionally, exit SQL*Plus (which also closes the command window):

    SQL> exit

 

+ Recent posts