set pages 0 termout off spool ana.tmp prompt set echo on prompt set termout on prompt spool ana.log select 'analyze table '||table_name||chr(10)|| ' estimate statistics sample 32 percent;' from user_tables order by table_name / select 'analyze index '||index_name||' compute statistics;' from user_indexes order by index_name / rem rem account number is NOT uniformly distributed... rem select distinct 'analyze table '||table_name||' compute statistics'||chr(10)|| 'for columns account_number size 254;' from user_ind_columns where column_name = 'ACCOUNT_NUMBER' / spool off @ana.tmp -- -- run some test scripts -- col segment_name format a25 col tablespace_name format a25 set pages 66 select segment_name,tablespace_name,count(*) from user_extents having count(*) > 50 group by segment_name,tablespace_name order by count(*) desc / select table_name,chain_cnt,pct_free,num_rows,avg_row_len from user_tables where chain_cnt > 1 / exit