Oracle 12C: user creation behaviors

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBORCL                        READ WRITE NO

Behavior 1: one cannot create schema in con_id 1. 

SQL> CREATE USER "VPX1" PROFILE "DEFAULT" IDENTIFIED BY "oracle" DEFAULT TABLESPACE "MYPASSWORD" ACCOUNT UNLOCK;

CREATE USER "VPX1" PROFILE "DEFAULT" IDENTIFIED BY "oracle" DEFAULT TABLESPACE "MYPASSWORD" ACCOUNT UNLOCK
            *
ERROR at line 1:
ORA-65096: invalid common user or role name


NOTE: however, dba can create a "common" user. It must start with c##

SQL>  create user c##_VPX identified by MYPASSWORD;

User created.

SQL> alter session set container=PDBORCL;

Session altered.

SQL> create user "VPX1" identified by "MYPASSWORD";

User created.


SQL> select username, default_tablespace,TEMPORARY_TABLESPACE, account_status from dba_users where username like '%VPX%';

USERNAME             DEFAULT_TABLESPACE             TEMPORARY_TABLESPACE           ACCOUNT_STATUS
-------------------- ------------------------------ ------------------------------ --------------------------------
VPX1                 USERS                          TEMP                           OPEN


Note: default tablespaces to be created for new user. SYSTEM, SYSAUX, USER and TEMP.


SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
TEMP
USERS

SQL> show con_name;

CON_NAME
------------------------------
PDBORCL

SQL> select file_name, tablespace_name from dba_data_files;

FILE_NAME                                                                                  TABLESPACE_NAME
------------------------------------------------------------------------------------------ ------------------------------
/u01/data/ORCL/E1428863D6CF20F7E043CB41830AFB4F/datafile/o1_mf_system_8xy2dwhf_.dbf        SYSTEM
/u01/data/ORCL/E1428863D6CF20F7E043CB41830AFB4F/datafile/o1_mf_sysaux_8xy2dwhd_.dbf        SYSAUX
/u01/data/ORCL/E1428863D6CF20F7E043CB41830AFB4F/datafile/o1_mf_users_8xy2fwlk_.dbf         USERS

No comments:

Post a Comment