Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-04-26
5
Medium Priority
?
2,957 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 120 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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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.
Via a live example, show how to take different types of Oracle backups using RMAN.
Suggested Courses

972 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