Solved

How to grant a user with CREATE SESSION privilege?

Posted on 2010-11-13
6
1,457 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
ID: 34129774
GRANT CREATE SESSION TO <user>;

0
 
LVL 3

Assisted Solution

by:mpaladugu
mpaladugu earned 300 total points
ID: 34129780
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
ID: 34129794
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
ID: 34129802
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
ID: 34129859
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
ID: 34129902
Thanks everyone.  Your information is very helpful!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

867 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

18 Experts available now in Live!

Get 1:1 Help Now