Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to grant a user with CREATE SESSION privilege?

Posted on 2010-11-13
6
1,462 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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get the parent node - XMLTYPE 9 98
exp/imp 25 85
ORA-04071: missing BEFORE, AFTER or INSTEAD OF keyword 2 62
make null the repeated levels 2 31
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 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

856 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