Solved

How to grant a user with CREATE SESSION privilege?

Posted on 2010-11-13
6
1,453 Views
Last Modified: 2013-11-11
Hi

I'm trying to create a new user for my oracle database, but after I use the CREATE USER command, I cannot log in using that account.  It returns the error "user lacks CREATE SESSION privilege", so I guess the next step would be to grand CREATE SESSION privilege for the user.  How should I do so?  Thanks.

Tom
0
Comment
Question by:pisceswzh2010
6 Comments
 
LVL 17

Accepted Solution

by:
sweetfa2 earned 100 total points
Comment Utility
GRANT CREATE SESSION TO <user>;

0
 
LVL 3

Assisted Solution

by:mpaladugu
mpaladugu earned 300 total points
Comment Utility
a user in oracle needs to have privileges to do any action, even to log in you need is a create seeeion privilege.  Privileges to a user are granted by a DBA when the user is created.

Privileges can be granted to a user either directly or through a role. For a better understating of managing user roles and prvileges read:-

http://download.oracle.com/docs/cd/B10501_01/server.920/a96521/privs.htm

to ling with the user account you just created: grant the connect role to user by executing the following command logging in as dba:-

GRANT CONNECT TO your_usernae_here;
0
 
LVL 3

Assisted Solution

by:mpaladugu
mpaladugu earned 300 total points
Comment Utility
CONNECT is role in oracle which has some privileges assigned to it, if you assign this role to a user, that user will get all the privileges in the role.  

but from oracle 10g r2 forward this role has only create session privilege.

prior to oracle 10g r2 Connect role used to contain all of the below privileges:- Alter Session,
,Create Session, Create Cluster, Create Synonym, Create Database Link, Create Table
Create Sequence,      Create View
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 3

Assisted Solution

by:mpaladugu
mpaladugu earned 300 total points
Comment Utility
A predefined role, named "DBA", is automatically created with every Oracle database. This role contains all database system privileges. Therefore, it is very powerful and should be granted only to fully functional database administrators.  If you are working on database installation that is personal to your use OR for your practice, you can assign this role to the user created and continue practicing.

0
 
LVL 12

Assisted Solution

by:praveencpk
praveencpk earned 100 total points
Comment Utility
creating an user in oracle is suggest allocating some schema to the user but to do some work i.e login to server, creating table etc.. you have assign appropriate privileges to that user.

after creating a new user the basic or first privilege you should assigne is create session.

i.e
CREATE USER myuser IDENTIFIED BY password
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON users
QUOTA 100M ON my_data;

Grant create session to myuser;

have a look on this doc for more info...

http://www.dba-oracle.com/concepts/grant_user_privileges.htm
0
 

Author Closing Comment

by:pisceswzh2010
Comment Utility
Thanks everyone.  Your information is very helpful!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to recover a database from a user managed backup

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now