Creating new Oracle user, new instance

Running Oracle 19c in Docker, I connected with sqlplus and attempted to create a new user:

create user example identified by password;

and got this cryptic error:

ORA-65096: invalid common user or role name

Per answers on this post, this is usually because you connected to the root container database (CDB) instead of a pluggable container database (PDB).

You can cofirm what you are connected to with:

show con_name

and sure enough, I’m connected to CDB$ROOT:

CON_NAME 
------------------------------
CDB$ROOT

List available PDBs with:

show pdbs

shows:

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

Updating my connection properties to connect to SERVICE=ORCLPDB1 and now I’m good.

To grant all privs to a new user:

grant all privileges to username

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.