analyze.sql
Download Script
rem file: analyze.sql
rem
rem purpose: spool a listing of tables and indexes owned by one user.
rem
rem parameters: p1=spool_file
rem p2=username
rem
rem subroutine: called by dbat:[vms]analyze.com
rem
rem ......................................................................
rem
set echo off
set termout off
set feedback off
set verify off
set pages 0
set heading off
spool &&1
select 'set echo on' from dual;
select 'analyze table &&2' || '.' || table_name || ' estimate statistics;'
from sys.dba_tables
where owner = '&&2'
order by table_name;
select 'exit' from dual;
spool off
exit