본문 바로가기

Database/Oracle

17 - [Oracle 19C] unlock the HR schema

To unlock the HR schema in the pluggable database

 

 

 

SQL> startup;
ORACLE instance started.

Total System Global Area 1526723608 bytes
Fixed Size		    9135128 bytes
Variable Size		  889192448 bytes
Database Buffers	  620756992 bytes
Redo Buffers		    7639040 bytes
Database mounted.
Database opened.

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 ORCLPDB			  MOUNTED

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

SQL> alter session set container=orclpdb;
Session altered.

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 3 ORCLPDB			  MOUNTED

SQL> show con_name

CON_NAME
------------------------------
ORCLPDB
SQL>

 

 

 

set lines 20
set pages 20
col USERNAME for a30
col LIMIT for a30

 

 

 

샘플 스키마 HR 로 접속하기

 

ssion set container=orclpdb;
Session altered.

SQL> alter user hr account unlock;
User altered.

SQL> alter user hr identified by hr;
User altered.

SQL> show con_name

CON_NAME
------------------------------
ORCLPDB

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 3 ORCLPDB			  READ WRITE NO

SQL> conn hr/hr@orclpdb;
Connected.

SQL> select table_name from user_tables;

TABLE_NAME
--------------------------------------------------------------------------------
COUNTRIES
REGIONS
LOCATIONS
DEPARTMENTS
JOBS
EMPLOYEES
JOB_HISTORY

7 rows selected.

SQL>