Create a user in 12c--avoid ORA-65096 or ORA-65049 errors
From:
Creating users in 12c-avoiding ORA-65096 or ORA-65049. (Document ID 1572404.1)
Apply to:
Oracle database-enterprise edition-version 12.1.0.1 and later
Information in this document applies to any platform.
When you use the previous version of SQL syntax to create user in 12c, if you use pluggable Database,an ORA-65096 or ORA-65049 encounter.
Goal:
A new user is created in the pluggable database.
Solution:
First, determine whether the new user is common_users or local_users. Sqlplus/as SYSDBA
For common_users, user names must be in C # #开头
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 display the available PDB
Sql>select PDB from V$services;
PDB
--------------------------
pdborcl
cdb$root
cdb$root
cdb$root
cdb$root show
con _name
con_name
-----------------
cdb$root
If you create a local user for a pluggable database, you must select the pluggable database before you establish the user.
Sql> alter session set CONTAINER=PDBORCL;
Sql> show Con_name
con_name
-----------------
pdborcl
sql>create user scott1 by Tiger1;
User created.