Ora-01031: insufficient privileges when I create the first user

1k views Asked by At

I tried to create a user after creating tablespaces but there is an error at line 1, ORA-01031: insufficient privileges.

This is what I wrote and the effect ...

Enter user-name: sys as sysdba
Enter password:
Connected to:

Oracle Database 12c Enterprise Release 12.1.0.1.0

SQL> create user c##ntoi identified by botho123
2    container=all
3    default tablespace perm_ntoi_tbs
4    temporary tablespace temp_ntoi_tbs;

create user c##ntoi identified by botho123
                                   *
ERROR at line 1:
ORA-01031: insufficient privileges
2

There are 2 answers

1
Jeff Holt On

According to the create user command for the version you're connected to:

To specify the CONTAINER clause, you must be connected to a multitenant container database (CDB). To specify CONTAINER = ALL, the current container must be the root. To specify CONTAINER = CURRENT, the current container must be a pluggable database (PDB).

Maybe your environment is set such that connecting to "sys as sysdba" is connecting to:

  1. a pluggable instead of its container
  2. a current container that is not the root
0
Korotsoane Ntoi Justice On

I have created the user by connecting with

SQL> conn c##sys

I got another problem when granting the user

SQL> grant sysdba, connect, create user, create session to c##ntoi;

ERROR at line 1:

ORA-47410: Realm violation for GRANT on CREATE SESSION