Posts tagged ‘oracle’

Compute statistics in Oracle

sqlplus user/password@db

SQL> set echo off
SQL> set feed off
SQL> set head off
SQL> spool analyze_tables.sql
SQL> select ‘analyze table ‘||table_name||’ compute statistics;’ from user_tables;
SQL> spool off
SQL> exit

sqlplus user/password@db @analyze_tables.sql