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

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

Posted on 2004-04-26
5
2,915 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle query output question 4 47
Fill Date time Field 12 23
Toad 12.10 Enterprise visual interface 4 20
Migration from sql server to oracle 5 24
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 post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to recover a database from a user managed backup
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

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