본문 바로가기

Database/Oracle

70 - [Oracle 19C] to Create pluggable admin

 

 

  • Login as sysdba
SQL> show con_name
CON_NAME 
------------------------------
CDB$ROOT


SQL> show user
USER is "SYS"


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


SQL> show con_name;
CON_NAME 
------------------------------
ORCLPDB


SQL> show con_id;
CON_ID 
------------------------------
3


SQL> select * from V$TABLESPACE;
       TS# NAME                           INC BIG FLA ENC     CON_ID
---------- ------------------------------ --- --- --- --- ----------
         0 SYSTEM                         YES NO  YES              3
         1 SYSAUX                         YES NO  YES              3
         2 UNDOTBS1                       YES NO  YES              3
         3 TEMP                           NO  NO  YES              3
         5 USERS                          YES NO  YES              3

 

 

 

  • to Create orclpdb_admin @orclpdb
SQL> create user orclpdb_admin identified by orclpdb_admin
     default tablespace users temporary tablespace temp account unlock;
User ORCLPDB_ADMIN created.


SQL> grant create session, dba to orclpdb_admin;
Grant succeeded.


SQL> select * from dba_users
where username=upper('orclpdb_admin');
/*

*/

 

 

 

  • Login as new admin user @orclpdb
SQL> conn orclpdb_admin/orclpdb_admin@orclpdb
Connected.


SQL> show user
USER is "ORCLPDB_ADMIN"


SQL> show con_name

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


SQL> select * from session_privs;

PRIVILEGE
----------------------------------------
ALTER SYSTEM
AUDIT SYSTEM
CREATE SESSION
...

237 rows selected.

 

 

 

This user is only for the PDB as orclpdb, not root container.

 

SQL> alter session set container=cdb$root;
ERROR:
ORA-01031: insufficient privileges