ORA-01031: insufficient privileges [message #383122] |
Tue, 27 January 2009 05:55  |
rakeshramm
Messages: 175 Registered: September 2006 Location: Oracle4u.com
|
Senior Member |

|
|
I am getting this error ORA-01031: insufficient privileges when trying to run analyze table table_name compute statistics in a procedure
thanks and regards
|
|
|
|
|
|
|
|
|
|
|
Re: ORA-01031: insufficient privileges [message #383217 is a reply to message #383137] |
Tue, 27 January 2009 16:19   |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
How did you, actually, do that? Which code did you use? Because, even if you don't do anything, it works ...
I'll create a "dummy" user which will do the test; privileges aren't anything special and, besides, were granted via predefined CONNECT and RESOURCE roles:SQL> select privilege from role_sys_privs where role in ('CONNECT', 'RESOURCE');
PRIVILEGE
----------------------------------------
CREATE SEQUENCE
CREATE TRIGGER
CREATE CLUSTER
CREATE PROCEDURE
CREATE TYPE
CREATE SESSION
CREATE OPERATOR
CREATE TABLE
CREATE INDEXTYPE
9 rows selected.
SQL> create user brisime identified by sime;
User created.
SQL> grant connect, resource to brisime;
Grant succeeded.
Now let's create user, let him create a table and analyze it in SQL and PL/SQL:SQL> connect brisime/sime
Connected.
Session altered.
SQL> create table test (id number);
Table created.
SQL> analyze table test compute statistics;
Table analyzed.
SQL> begin
2 execute immediate ('analyze table test compute statistics');
3 end;
4 /
PL/SQL procedure successfully completed.
SQL>
So far so good.
Now, perhaps I didn't get the point, but - what "insufficient privileges" are we talking about?
|
|
|
|
|