Sql – Oracle 11g: Why doesn’t “grant create session” allow user to log in

oracleoracle-11goracle10gsql

I'm working on an Oracle 11g database, and simply need to create a user and log in with it. I successfully create the user, but after running the second line below, I still can't log in. Is there something I'm missing?

create user "oskar" identified by "oskar_pass";
grant create session to "oskar";

select * from DBA_USERS; --oskar is there, but can't log in

(I tired "grant connect" as well, to no avail.)

Best Answer

This worked for me (10.2.0.3)

SQL> connect dbauser/dbauser
Connected.
SQL> CREATE USER johndoe IDENTIFIED BY johndoe
  2   DEFAULT TABLESPACE "USERS"
  3   TEMPORARY TABLESPACE "TEMP";

User created.

SQL> GRANT CREATE SESSION TO johndoe;

Grant succeeded.

SQL> connect johndoe/johndoe
Connected.