Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create table command fails when user has create table privilege

Status
Not open for further replies.

scb1776

Programmer
Dec 29, 2006
31
US
selecting from dba_sys_privs shows the grantee with CREATE SESSION, CREATE TABLE, and UNLIMITED TABLESPACE permissions (the ADM column is NO)

The command :
create table s ( valkey varchar2(40), today float, primary key (valkey));
Fails with ORA-01031: insufficient privileges

What other privileges are necessary if CREATE TABLE is already granted?
 
What is the user's default tablespace? At a guess, I am thinking it is not the same as the tablespace he has unlimited permissions on.
 
SCB,

Here is my transcript that duplicates your scenario:

Code:
SQL> create user scb identified by scb;

User created.

SQL> grant create session, create table, unlimited tablespace to scb;

Grant succeeded.

SQL> conn scb/scb
Connected.
SQL> create table s ( valkey varchar2(40), today float, primary key (valkey));

Table created.

So, everything seems to work satisfactorily given your specifications. Do you see any differences between my creation/specification of my user "SCB" and yours?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
“People may forget what you say, but they will never forget how you made them feel.
 
Thanks all for your help. We ended up delegating the specific tasks needed to one user with DBA privilege.
 
But, SCB, given my CREATE USER statement, above, that table-creating user has only create session, create table, and unlimited tablespace privileges. A DBA should not be necessary to successfully CREATE TABLE. Can you or your DBA please troubleshoot the differences between my successful experience and your initial, unsuccessful experience?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
“People may forget what you say, but they will never forget how you made them feel.
 
This is being done for an existing user. As I am not the DBA I am not sure how the user was created, however using the DBA account :
setting current_schema to dvpp717

Session altered.

dvpp717> grant create session, create table, unlimited tablespace to ops$scb;

Grant succeeded.

Then, logging in as scb in a different xterm:
setting current_schema to dvpp717

Session altered.

dvpp717> create table s (valkey varchar2(40), today float, primary key (valkey));
create table s (valkey varchar2(40), today float, primary key (valkey))
*
ERROR at line 1:
ORA-01031: insufficient privileges


So although it appears that it should work my user still does not have sufficient privileges. I have also tried running the grant command without setting the current schema and that has the same results.

As the user who needs to be able to perform this task performs very specific functionality it was deemed acceptable to allow him DBA status which resolved the problem.

 
Can you toss in a
Code:
select user from dual;
in there, just for yuks and grins?
 
Sure:

setting current_schema to dvpp717

Session altered.

dvpp717> select user from dual;

USER
------------------------------
OPS$SCB



 
Doesn't ops$scb need "create any table" privileges to create a table in the dvpp717 schema?

karluk.png
 
Ah, SCB, there's the rub...in your original post, you left out the teensy, tiny fact that user X was creating a table in the user Y schema. So, KarlUK is absolutely correct...if you wish to create a table in another schema, the creator needs the create any table privilege, which user OPS$SCB apparently does not have, even if s/he does successfully run the alter session set current_schema=dvpp717 command.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
“People may forget what you say, but they will never forget how you made them feel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top