$ sqlplus / as sysdba
SQL> create user tq84_ora_65096_demo identified by aWeakPassword;
--
-- ORA-65096: invalid common user or role name
--
Check to which container we're connected:
SQL> select
ses.con_id,
case when con.con_id = ses.con_id then 'X' end cur_con, -- current container
con.name
from
v$session ses cross join
v$containers con
where
ses.sid = sys_context('userenv', 'sid') -- Identify own session
;
--
-- CON_ID C NAME
-- ------ - ------------
-- 1 X CDB$ROOT
-- PDB$SEED
-- PDBTQ84
We're connected to the root container (CDB$ROOT).
Trying again to create a user (without c## prefix) on a PDB:
SQL> select
ses.con_id,
case when con.con_id = ses.con_id then 'X' end cur_con, -- current container
con.name
from
v$session ses cross join
v$containers con
where
ses.sid = sys_context('userenv', 'sid');
--
-- CON_ID C NAME
-- ------ - ----------------
-- 3 X PDBTQ84
We're on a PDB (which is the only visible container now) and ii's now possible to create the user:
SQL> create user tq84_ora_65096_demo identified by aWeakPassword;
--
-- User created.