Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Number of Extents in each table? and how to use Analyze?
In article <362e1381.89718496_at_news.earthlink.net>, mleung_at_earthlink.net (m.L.) writes:
>mleung_at_intelus.com
select segment_type, segment_name, count(blocks) num_extents, sum(bytes)/1024
k_bytes, sum(bytes)/1048576 m_bytes
from dba_extents
where tablespace_name in ('CASHSHEET', 'CASHSHEET_IDX') group by segment_type, segment_name order by segment_type, num_extents desc, segment_name;
2. run SQL script to generate (and run) dynamic SQL
set echo off
set pagesize 0
set feedback off
ttitle ' '
spool AnalTab.sql
SELECT 'ANALYZE TABLE ' || TABLE_NAME || ' COMPUTE STATISTICS;' command
FROM DBA_TABLES
WHERE owner = 'CASHSHEET';
spool off
@AnalTab
host rm AnalTab.sql Received on Wed Oct 21 1998 - 19:33:45 CDT