Solved

Ora-01031 when execute immediate 'create table ...'

Posted on 2004-04-26
5
2,909 Views
Last Modified: 2012-08-14

Dear advisor !

i have user leaseline with connect, resource, DBA role.

I have a 'CreateData' procedure and i could run it well before. Now, i run it with error.

ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "LEASELINE.CreateData", line 3
ORA-06512: at line 1

the CreateData procedure

As
Begin
    Execute Immediate 'Create table aaaaaaaaaaa (a varchar2(1))'      ;
end ;

Please show me how to corecct it. Maybe, i have change some configure at Oracle , but i do not remember.

Why error

Thank for all consider
0
Comment
Question by:namcit99
5 Comments
 
LVL 8

Accepted Solution

by:
baonguyen1 earned 30 total points
ID: 10924923
You may need to grant CREATE TABLE privilege to the user. By defaut users are granted via role:

SQL>Grant CREATE TABLE to <user>

the try again

0
 
LVL 8

Expert Comment

by:annamalai77
ID: 10925070
dear friend

once again grant all the roles to the user and try it.

regards
annamalai
0
 

Author Comment

by:namcit99
ID: 10925135

the 'leaseline' user has DBA, connect, resource Role. So the Leaseline user has 'Create Table' priviledge

Why ? i has modify some Role before, but i just test and the 'Create tbel ' still exist on connect and DBA role
0
 
LVL 8

Expert Comment

by:annamalai77
ID: 10925163
hi

even though u give the resource its for the unlimited quota on the tablespace. and dba role is for performing certain dba privilieges.

try this for the user.
grant create session to <user>;

regards
annamalai
0
 
LVL 15

Expert Comment

by:ishando
ID: 10925236
Privileges granted through roles are not recognised in PL/SQL, only eplicitly granted privileges.

As baonguyen1 said - grant the create table privilege to the user and you should be ok.
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

Title # Comments Views Activity
Need help with Oracle syntax 4 56
Oracle Subquery bad Join 11 59
sql query 9 37
Why  don't I see Below columns in my  Stored Procedure  under TMP_RS? 8 11
Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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…

932 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

14 Experts available now in Live!

Get 1:1 Help Now