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

Home -> Community -> Usenet -> c.d.o.server -> Package Object Privilege Question

Package Object Privilege Question

From: Aaron <aaron.kurz_at_acs-inc.com>
Date: 25 Jun 2004 12:19:24 -0700
Message-ID: <bfb346c4.0406251119.bb47af7@posting.google.com>


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

Original text of this message

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