Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Number of Extents in each table? and how to use Analyze?

Re: Number of Extents in each table? and how to use Analyze?

From: MTNorman <mtnorman_at_aol.com>
Date: 22 Oct 1998 00:33:45 GMT
Message-ID: <19981021203345.23760.00001824@ngol03.aol.com>

In article <362e1381.89718496_at_news.earthlink.net>, mleung_at_earthlink.net (m.L.) writes:

>mleung_at_intelus.com

  1. count blocks in dba_extents or user_extents.blocks

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US