ORA-01045: user xxx lacks CREATE SESSION privilege; logon denied
In the Oracle database, if you have created a new user and tried to log in with a newly created user, you might get an error ORA-01045: user xxx lacks CREATE SESSION privilege; logon denied error.

This normally happens when you didn’t give CREATE SESSION privilege while creating the user. To grant the CREATE SESSION privilege follow the below steps.
Step 1: Open the Oracle’s Run SQL Command Line terminal. And connect as sysdba.
Step 2: Enter your system dba username and password that you have created during the installation of the database(if you didn’t create any, try login with SYS
as a username and empty(no password)
password).
SQL> connect as sysdba
Enter user-name: sys
Enter password:
Connected.
SQL>

Step 3: Execute the GRANT CREATE SESSION TO user_name;
query.
SQL> GRANT CREATE SESSION TO root;
Grant succeeded.
SQL>
Step 4: Now try to connect with the new user again. You will be able to connect.

References
- Oracle-CREATE USER
- Overview, Editions, and Features of Oracle Database
- Overview and Architecture of Oracle Database Server