Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Analyze
You can use "execute dbms_utility.analyze_schema(''SCHEMA'',''COMPUTE'');"
in a SQL+ script
Hope this help!
sooz wrote:
> Josef Huber wrote:
> >
> > Hello,
> >
> > Is there a command with that i can analyze a entire schema ?
>
> Not that I know of ... but there is this:
>
> set heading off
> set pages 999
> set feedback off
> spool analyze_all.sql
> select 'analyze '||segment_type||' '||owner||'.'||segment_name||
> ' compute statistics;'
> from dba_segments
> where segment_type in ('TABLE','INDEX','CLUSTER')
> /
> spool off;
>
> You can change the 'compute statistics' to any other valid clause in the
> ANALYZE statement. This is generally the method used to do "mass"
> changes, that is create the SQL from the data dictionary itself.
>
> Now just run that ... it creates the analyze statements for the entire
> schema, well at least those segments that can be analyzed. Then you
> just need to run the analyze_all.sql script.
>
> Good luck.
> - sooz
Received on Thu Oct 08 1998 - 07:08:01 CDT
![]() |
![]() |