— col_stats
— mdw 21/03/2003
— more detailed info on cols
col owner        form a6 word wrap
col table_name   form a12 word wrap
col column_name  form a22 word wrap
col M            form a1
col num_vals     form 999,999,999
col dnsty        form 0.9999
col num_nulls    form 999,999,999
break on owner nodup on table_name nodup
spool col_counts.lst
select owner
      ,table_name
      ,column_name
      ,decode (nullable,’N’,’Y’,’N’)  M
      ,num_distinct num_vals
      ,num_nulls
      ,density dnsty
from dba_tab_columns
where table_name like upper(nvl(‘&tab_name’,’WHOOPS’)||’%’)
and   owner      like upper(‘&tab_own’||’%’)
ORDER BY owner,table_name,COLUMN_ID
/
clear colu
spool off
clear breaks