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 -> Re: Analyze

Re: Analyze

From: sooz <sooz_at_pobox.com>
Date: Wed, 07 Oct 1998 22:36:22 -0700
Message-ID: <361C4F56.75656B9B@pobox.com>


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 - 00:36:22 CDT

Original text of this message

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