Tables - Analyze chained rows for all tables of the current user/schema login
set echo off
----------------------------------------------------------------------------------------
--
--  Name: analyze_chained_rows.sql    
--
--  Desc: Analyze chained rows for all tables of the current user/schema login
--
--  Author: 
--
--  Usage: @analyze_chained_rows
--
--  The chained rows table must be created prior to running this script.  
--  To view the output: 
--  	select * from chained_rows;
--  	select table_name, count(*) from chained_rows group by table_name;
--
--  Revision History:
--
--  DATE       WHO		   WHAT
--  ---------  ----------  ------------------
--
--
----------------------------------------------------------------------------------------

set termout off
set verify off
set doc off
set feedback off
set recsep off
set pagesize 0
--
define lsize=200
set linesize &&lsize
--
define out_file=analyze_chained_rows.ddl
spool &&out_file
--
SELECT 'analyze table '||table_name||' list chained rows;'
FROM user_tables
;
spool off
set doc off
set feedback on
set pagesize 30
set termout on
set echo on
start &&out_file
-- exit