ORA-65096: invalid common user or role name and ORA-65049: creation of local user or role is not allowed in CDB$ROOT

This error usually occurs due to we are trying to create user ( common user ) under root container. In oracle 12c there is two type of users: common user and local user.

Common users belongs to CBD’s as well as current and future PDB’s. It means it can performed operation in Container or Pluggable according to Privileges assigned. For more information about common user.

Local users is purely database that belongs to only single PDB. This user may have administrative privileges but this only belongs to that PDB. For more information about local user.

// Consider following example in which i am trying to create common user in container root.

SQL> show con_name

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

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

SQL> create user scott identified by scott container=current;
create user scott identified by scott container=current
*
ERROR at line 1:
ORA-65049: creation of local user or role is not allowed in CDB$ROOT

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

//If you wish to create common user under CDB$ROOT than create user start with C## and c##, as follows:
Note:

  • Common user will be created under root container only.
  • Current container must be set to CDB$ROOT.

SQL> create user C##scott identified by scott;

User created.

SQL> create user c##scott identified by scott container=all;

User created.

OR

// Creating local user in PDB:

SQL> alter session set container=sales;

Session altered.

SQL> sho con_name

CON_NAME
——————————
SALES

SQL> create user test identified by test;

User created.

***********************************************************************

abc

Note: Please don’t hesitate to revert in case of any query OR feedback.

Thanking you.

Have a easy life ahead.

6 thoughts on “ORA-65096: invalid common user or role name and ORA-65049: creation of local user or role is not allowed in CDB$ROOT”

    • Thank you Chaitanya for writing..
      Please show me error message, steps you are trying to and database version you are using.

  1. am getting this error during import. export was taken from 11g . Please find below the error messages

    Starting “SYS”.”SYS_IMPORT_FULL_01″: /******** AS SYSDBA CONTENT=ALL FULL=Y DIRECTORY=DATA_PUMP_DIR DUMPFILE=exp_digite.dmp LOGFILE=DIGI_import.log
    Processing object type SCHEMA_EXPORT/USER
    ORA-39083: Object type USER:”DIGITE” failed to create with error:
    ORA-65096: invalid common user or role name
    Failing sql is:
    CREATE USER “DIGITE” IDENTIFIED BY VALUES ‘436B764069E6B3EA’ DEFAULT TABLESPACE “DIGITE_DATA_DIGITE” TEMPORARY TABLESPACE “TEMP”
    ORA-39083: Object type USER:”DIGITEGUEST” failed to create with error:
    ORA-65096: invalid common user or role name
    Failing sql is:
    CREATE USER “DIGITEGUEST” IDENTIFIED BY VALUES ’38A6FFF7A823F672′ DEFAULT TABLESPACE “USERS” TEMPORARY TABLESPACE “TEMP”
    Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
    ORA-39083: Object type SYSTEM_GRANT failed to create with error:
    ORA-01917: user or role ‘DIGITE’ does not exist
    Failing sql is:
    GRANT EXECUTE ANY PROCEDURE TO “DIGITE”
    ORA-39083: Object type SYSTEM_GRANT failed to create with error:
    ORA-01917: user or role ‘DIGITE’ does not exist
    Failing sql is:
    GRANT CREATE ANY TABLE TO “DIGITE”
    ORA-39083: Object type SYSTEM_GRANT failed to create with error:
    ORA-01917: user or role ‘DIGITE’ does not exist
    Failing sql is:
    GRANT UNLIMITED TABLESPACE TO “DIGITE”
    ORA-39083: Object type SYSTEM_GRANT failed to create with error:
    ORA-01917: user or role ‘DIGITEGUEST’ does not exist
    Failing sql is:
    GRANT SELECT ANY TABLE TO “DIGITEGUEST”
    ORA-39083: Object type SYSTEM_GRANT failed to create with error:
    ORA-01917: user or role ‘DIGITEGUEST’ does not exist
    Failing sql is:
    GRANT UNLIMITED TABLESPACE TO “DIGITEGUEST”
    Processing object type SCHEMA_EXPORT/ROLE_GRANT
    ORA-39083: Object type ROLE_GRANT failed to create with error:
    ORA-01917: user or role ‘DIGITE’ does not exist
    Failing sql is:
    GRANT “CONNECT” TO “DIGITE”
    ORA-39083: Object type ROLE_GRANT failed to create with error:
    ORA-01917: user or role ‘DIGITE’ does not exist
    Failing sql is:
    GRANT “RESOURCE” TO “DIGITE”
    ORA-39083: Object type ROLE_GRANT failed to create with error:
    ORA-01917: user or role ‘DIGITE’ does not exist
    Failing sql is:
    GRANT “DBA” TO “DIGITE”
    ORA-39083: Object type ROLE_GRANT failed to create with error:
    ORA-01917: user or role ‘DIGITEGUEST’ does not exist
    Failing sql is:
    GRANT “CONNECT” TO “DIGITEGUEST”
    ORA-39083: Object type ROLE_GRANT failed to create with error:
    ORA-01917: user or role ‘DIGITEGUEST’ does not exist
    Failing sql is:
    GRANT “RESOURCE” TO “DIGITEGUEST”
    Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
    ORA-39083: Object type DEFAULT_ROLE:”DIGITE” failed to create with error:
    ORA-01918: user ‘DIGITE’ does not exist
    Failing sql is:
    ALTER USER “DIGITE” DEFAULT ROLE ALL
    ORA-39083: Object type DEFAULT_ROLE:”DIGITEGUEST” failed to create with error:
    ORA-01918: user ‘DIGITEGUEST’ does not exist
    Failing sql is:
    ALTER USER “DIGITEGUEST” DEFAULT ROLE ALL
    Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
    ORA-39083: Object type PROCACT_SCHEMA failed to create with error:
    ORA-31625: Schema DIGITE is needed to import this object, but is unaccessible
    ORA-01435: user does not exist
    Failing sql is:
    BEGIN
    sys.dbms_logrep_imp.instantiate_schema(schema_name=>SYS_CONTEXT(‘USERENV’,’CURRENT_SCHEMA’), export_db_name=>’DIGITE.REGRESS.RDBMS.DEV.US.ORACLE.COM’, inst_scn=>’90850983′);COMMIT; END;

    ORA-39083: Object type PROCACT_SCHEMA failed to create with error:
    ORA-31625: Schema DIGITEGUEST is needed to import this object, but is unaccessible
    ORA-01435: user does not exist
    Failing sql is:

    what should i do in this case as this is import activity. Please suggest!!

    • Thank you hema for writing.
      Export/import method allows you to move data directly to a pluggable database only. You are trying to export in container database.
      Import to 12c is only possible if your source database version is 11.2.0.3+, If not than upgrade it to 11.2.0.3 than try export import with “FULL=Y TRANSPORTABLE=ALWAYS VERSION=12” parameters.

Leave a Reply to bauiCancel reply