Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> rebuild index from a stored procedure permissions problem

rebuild index from a stored procedure permissions problem

From: <Tony.Adolph_at_o2.com>
Date: Fri, 25 Feb 2005 14:33:55 +0100
Message-ID: <OF1CA1680E.41275005-ONC1256FB3.0049BC5E-C1256FB3.004A5E61@viaginterkom.de>


Hi folks,
Another day, another problem......

I have some partitioned tables on date. Each month I plan to add a new partition and drop an old one.

I've written some procedures to do this and apart from a small hitch they all seem to work well... to my query:

The following commands run via execute immediate (by the stored procedure)

adding a new partition:
alter table AUDIT_TRAILS split partition P12 at (to_date('200512','YYYYMM')) into (partition P12, partition p13)

adding new partition P09 to AUDIT_TRAILS_ARC: alter table AUDIT_TRAILS_ARC add partition P09 values less than (TO_DATE(' 2005-09-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) swaping partition P09 to AUDIT_TRAILS_TEMPARC: alter table AUDIT_TRAILS exchange partition P09 with table AUDIT_TRAILS_TEMPARC including indexes without validation

swaping partition P09 to AUDIT_TRAILS_ARC: alter table AUDIT_TRAILS_ARC exchange partition P09 with table AUDIT_TRAILS_TEMPARC including indexes without validation

droping partition P09 from AUDIT_TRAILS: alter table AUDIT_TRAILS drop partition P09

All works ok, but if there was data in the partition that was split then its indexes go UNUSABLE, so I run:
"alter index PK_AUDIT_TRAILS rebuild partition P12 online" again from the sp, but this fails reporting that I don't have permissions.

If I cut and paste the line it works. I guessed it might be a problem of getting a permission through a role, so I gave my user ALTER ANY INDEX system priv, but get the same error.

Any ideas?

Cheers
Tony

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Feb 25 2005 - 08:35:23 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US