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: table size

Re: table size

From: <deharo_at_my-dejanews.com>
Date: Wed, 28 Oct 1998 17:26:46 GMT
Message-ID: <717k4l$nkl$1@nnrp1.dejanews.com>


In article <714dvs$g93$1_at_venus.uvsq.fr>,   "Fei Sha" <shaf_at_prism.uvsq.fr> wrote:
> Hi everyone,
> How to know the size of a table in Mb or number of blocks?
> Thank!
>
> Fei
>
> Hi,

this is a little script to get essential informations with sqlplus. It's also useful to see when extents reachs the max number of extents :

  set verify off
  set termout off
  set feedback off
  set echo off
  set head on
  set pages 64
  set lines 80
  clear computes

  column segment_name   format a20        heading 'Table Name'
  column pct_increase   format 999        heading 'Pctin.'
  column sum(bytes)     format 9999999999 heading 'Nb Bytes'
  column initial_extent format 9999999999 heading 'Init. Ext.'
  column next_extent    format 9999999999 heading 'Next Ext.'
  column max_extents    format 9999       heading 'Max Ext.'
  column count(*)       format 9999       heading 'Nb Ext.'
  spool outfile
  select segment_name, pct_increase, sum(bytes), initial_extent, next_extent, max_extents, count(*) from dba_extents a, dba_tables b where segment_name =
b.table_name and segment_type = 'TABLE' and a.owner='YOU' group  by
segment_name, pct_increase, max_extents, initial_extent, next_extent order by
segment_name, max_extents;

  spool off;

I hope that helps you.
Regards,

        Thierry

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Oct 28 1998 - 11:26:46 CST

Original text of this message

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