Oracle – error: ORA-65096: invalid common user or role name in oracle

oracleoracle12c

I just installed Oracle, and it was missing the Scott schema. So i am trying to generate it myself. I got the sql script of Scott schema, but when i try to run the query:

create user Scott identified by tiger; 

it displays the following error:

ORA-65096: invalid common user or role name in oracle.

Basically it is not allowing me to create a user Scott.

Why is that, and how can I fix my problem?

Best Answer

99.9% of the time the error ORA-65096: invalid common user or role name means you are logged into the CDB when you should be logged into a PDB. For example, if you used the default 19c installation settings, you should login to ORCLPDB (the PDB) instead of ORCL (the CDB).


DANGER - If you insist on creating users the wrong way, follow the steps below.

Setting undocumented parameters like this (as indicated by the leading underscore) should only be done under the direction of Oracle Support. Changing such parameters without such guidance may invalidate your support contract. So do this at your own risk.

Specifically, if you set "_ORACLE_SCRIPT"=true, some data dictionary changes will be made with the column ORACLE_MAINTAINED set to 'Y'. Those users and objects will be incorrectly excluded from some DBA scripts. And they may be incorrectly included in some system scripts.

If you are OK with the above risks, and don't want to create common users the correct way, run this command before creating the user:

alter session set "_ORACLE_SCRIPT"=true;  

I found the answer here

Related Topic