In this Document
Goal |
Solution |
APPLIES TO:
Oracle Database - Enterprise Edition - Version 12.1.0.1 and laterInformation in this document applies to any platform.
When trying to create a user with the same syntax from earlier versions, an ORA-65096 or ORA-65049 can occur if using a pluggable database.
*** Checked for relevance on 22-Mar-2016 ***
GOAL
Creating a new user in 12c in a pluggable database.
SOLUTION
First, one needs to decide if the new user will be considered type COMMON_USERS or LOCAL_USERS.
For acommon user, the c## prefix must be used in the user creation:
sqlplus / as sysdba
SQL>create user scott identified by tiger;
ORA-65096: invalid common user or role name
SQL>create user c##scott identified by tiger;
User created.
v$services will list the available pluggable databases:
SQL>select PDB from v$services;
PDB
--------------------------
PDBORCL
CDB$ROOT
CDB$ROOT
CDB$ROOT
CDB$ROOT
show con_name
CON_NAME
-----------------
CDB$ROOT
If it is prefered to create alocal userfor one pluggable database, this must be selected prior to creating the user:
SQL> alter session set container=PDBORCL;
SQL> show con_name
CON_NAME
-----------------
PDBORCL
SQL>create user scott1 as tiger1;
User created.