Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Package Object Privilege Question
I had a package which had the code:
FOR clm_curr_index IN (SELECT * FROM ALL_IND_PARTITIONS WHERE STATUS
= 'UNUSABLE')
LOOP
EXECUTE IMMEDIATE 'ALTER INDEX '||clm_curr_index.index_name||'
REBUILD PARTITION '||clm_curr_index.partition_name||' NOLOGGING
PARALLEL';
END LOOP;
Which was getting 01555's, so I switched it to:
TYPE TPartTable IS TABLE OF ALL_IND_PARTITIONS%ROWTYPE;
t_PartTable TPartTable;
SELECT *
BULK COLLECT INTO t_PartTable
FROM ALL_IND_PARTITIONS
WHERE STATUS = 'UNUSABLE';
FOR x IN t_PartTable.First..t_PartTable.Last
LOOP
EXECUTE IMMEDIATE 'ALTER INDEX '||t_PartTable(x).index_name||
' REBUILD PARTITION'||t_PartTable(x).partition_name||' NOLOGGING PARALLEL ONLINE'; END LOOP; But now I am getting ORA-01031 (insufficient priv) on the ALTER INDEX statement. I am reluctant to add specific Object priv's to all the indexes and I am wondering why I need them now and didn't in the prior code. The only difference is one uses variables via cursor and the other via table.
Any advice would be appreciated.. Thanks. Received on Fri Jun 25 2004 - 14:19:24 CDT