How to Resolve ORA-01045: user lacks CREATE SESSION privilege; logon denied

  • by

ORA-01045 means that the user who tried to connect to the database has no privilege to connect. Therefore, the database refused the user to logon.

SQL> conn hr/hr@orcl
ERROR:
ORA-01045: user hr lacks CREATE SESSION privilege; logon denied

Solution to ORA-01045

Since the error message indicated that the user has no CREATE SESSION privilege, so we can just follow the instruction.

SQL> grant create session to hr;

Grant succeeded.

We connect again.

SQL> conn hr/hr@orcl
Connected.

Please note that, the predefined role CONNECT that we used to grant it to a new user contains only CREATE SESSION system privilege since 11g. That is to say, using CONNECT instead of CREATE SESSION also solves ORA-01045, but it has no secret ingredient anymore.

To grant some proper privileges for new accounts, you can check the complete list of 19c system privileges.

Leave a Reply

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