ORA-65096: invalid common user or role name in Oracle 12c

ORA-65096: invalid common user or role name

Error: ORA-65096: invalid common user or role name in 12c

Oracle in 12c onwards installed in two ways:
1. Same as 11g (standalone database one instance and one database)
2. Installed as container database. so later on you can add pluggable database into it. (one instance handle multiple pluggable database).

In 12c Environment, if you installed with 2nd option and you tried to CREATE USER the following command it will generated error. It is the container database in which you got the following error.


SQL> create user hr identified by hr;
create user hr identified by hr
*
ERROR at line 1:
ORA-65096: invalid common user or role name

Solution
Two solution for this 12c Container database:
1. You can use hidden parameter “_oracle_script”.
2. You need to put C## prefix for create the user in 12c Container Database.

1. Use Hidden parameter “_oracle_script”
You can use the name according to your need.

SQL> alter session set "_oracle_script"=true;
Session altered.

SQL> create user hr identified by hr;
User created.

2. Use the prefix C## in front of username.
Container database act as master database having all information of data dictionary and all pluggable database.
Note: C## is stand for common user. It is created in all databases present in 12c when we create it in ROOT container.(and pluggable database)

--check you are in ROOT container
show con_name

CON_NAME
——————————
CDB$ROOT

---For creating user in CDB$ROOT container then use prefix C##
#Create C##scott indentified by tiger;

1 thought on “ORA-65096: invalid common user or role name in Oracle 12c

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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