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

Home -> Community -> Usenet -> c.d.o.misc -> Re: problem with cursor and analyze index

Re: problem with cursor and analyze index

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Fri, 28 Feb 2003 08:24:14 -0800
Message-ID: <3E5F8D2E.688CE3FE@exesolutions.com>


Marc Eggenberger wrote:

> hi there.
>
> i found some articles on oracle that said I can determ when an index is
> fragmented by doing
>
> analyze index &index_name validate structure;
>
> and then I have to check the index_stats view ... I wanted to do this
> analyze on all indexes of a database with the follwoing code:
>
> set serveroutput on size 1000000
>
> declare
> CURSOR cur_name is select INDEX_NAME from DBA_INDEXES where owner =
> 'AMS';
> indexname dba_indexes.INDEX_NAME%TYPE;
> begin
> open cur_name;
> loop
> fetch cur_name into indexname;
> exit when cur_name%NOTFOUND;
> analyze index 'ams.'||indexname validate structure;
> end loop;
> close cur_name;
> end;
>
> but I get an error "Found Symbol INDEX where of these has been expected:
> := . ( @ % ;
> (error was in German so I translated it to English)
>
> The system is Oracle 8.1.7.
>
> Why does this not work?
> Any hints?
>
> --
> mfg
> Marc Eggenberger

Use native dynamic SQL ...

   EXECUTE IMMEDIATE ... Daniel Morgan Received on Fri Feb 28 2003 - 10:24:14 CST

Original text of this message

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