Privileges for DROP partition [message #512675] |
Tue, 21 June 2011 07:55 |
shamsh_pervaiz
Messages: 22 Registered: September 2005 Location: bangalore
|
Junior Member |
|
|
Hi All,
I have one user CD_APP.
I have one partition table CD.T_FCDR_DT.
User has got ALTER/INSERT/UPDATE/DELETE/SELECT privileges on the table..
Now when I try to drop a partition, I get error as below:
-------------------------------------
SQL> show user
USER is "CD_APP"
SQL> ALTER TABLE CD.T_FCDR_DT DROP PARTITION D01 UPDATE GLOBAL INDEXES;
ALTER TABLE CD.T_FCDR_DT DROP PARTITION D01 UPDATE GLOBAL INDEXES
*
ERROR at line 1:
ORA-01031: insufficient privileges
--------------------------------------
Do I have to grant some other privileges for this user.
Please help.
Thanks in advance.
Shamsh Pervaiz
|
|
|
|
Re: Privileges for DROP partition [message #512681 is a reply to message #512679] |
Tue, 21 June 2011 08:14 |
shamsh_pervaiz
Messages: 22 Registered: September 2005 Location: bangalore
|
Junior Member |
|
|
Thanks for the inputs.
The example I placed here is from a QA env. Similarly I have PROD env where it works with the similar privileges (ALTER/INSERT/UPDATE/DELETE/SELECT privileges on the table).
That is my main concern why it works on PROD env and not on QA env.
Thanks
Shamsh Pervaiz
|
|
|
|
Re: Privileges for DROP partition [message #512808 is a reply to message #512687] |
Wed, 22 June 2011 06:45 |
shamsh_pervaiz
Messages: 22 Registered: September 2005 Location: bangalore
|
Junior Member |
|
|
Got the final answer and solution for this by investigating/experimenting.
It differs based on Oracle version. On oracle version 11.2 it additional requires "DROP ANY TABLE" privilege. But on Oracle version 10.2, it does not require that, just ALTER table privilege is enough.
Regards
Shamsh Pervaiz
|
|
|
|
Re: Privileges for DROP partition [message #512821 is a reply to message #512816] |
Wed, 22 June 2011 07:30 |
shamsh_pervaiz
Messages: 22 Registered: September 2005 Location: bangalore
|
Junior Member |
|
|
Yes I'm sure. I even tried creating two users (X and Y) and created a partition table under user schema X. Gave insert/update/select/delete/alter privileges to user Y on X.partition table. Then tried to drop the table partition using user Y on both 10.2 and 11.2. It worked fine in 10.2 but not in 11.2. Hence it should be a BUG or not sure how it is.
Regards
Shamsh Pervaiz
|
|
|
|
|
|
|
Re: Privileges for DROP partition [message #512843 is a reply to message #512834] |
Wed, 22 June 2011 08:24 |
shamsh_pervaiz
Messages: 22 Registered: September 2005 Location: bangalore
|
Junior Member |
|
|
I have oracle version as "Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production".
Please check the output here:
SQL> CREATE TABLE MACHSPE.TST_FL_T
2 (
3 FL_ID NUMBER(38),
4 PRD VARCHAR2(8 BYTE),
5 TEC_ID NUMBER(38),
6 R_ID NUMBER(38)
7 )
8 TABLESPACE USERS
9 PARTITION BY LIST (PRD)
10 (
11 PARTITION MFS_000000 VALUES ('000000')
12 TABLESPACE USERS,
13 PARTITION MFS_200707 VALUES ('200707')
14 TABLESPACE USERS,
15 PARTITION MFS_200708 VALUES ('200708')
16 TABLESPACE USERS
17 );
Table created.
SQL> show user
USER is "MACHSPE"
SQL> GRANT ALTER, DELETE, INSERT, SELECT, UPDATE, ON COMMIT REFRESH, QUERY REWRITE ON MACHSPE.TST_FL_T TO MACHABH;
Grant succeeded.
SQL> select * from v$version where banner like 'Oracle%';
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
1 row selected.
SQL> connect machabh
Enter password:
Connected.
SQL> alter table MACHSPE.TST_FL_T drop partition MFS_200707;
alter table MACHSPE.TST_FL_T drop partition MFS_200707
*
ERROR at line 1:
ORA-01031: insufficient privileges
SQL>
Hope this is explaining everything.
Regards
Shamsh Pervaiz
|
|
|
|