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: dba_segments

Re: dba_segments

From: Graham C Thornton <graham.thornton_at_ln.ssw.abbott.com>
Date: Thu, 22 Apr 1999 10:23:12 -0500
Message-ID: <7fnetr$am8@news.abbott.com>


There *might* be a good reason for the sum.....

The query as listed will return the total number of bytes used by a segment across the entire database, regardless of whether it is a table or an index, and regardless of which schema it is in.

If you set up your database with multiple identical schemas (same tables/ indexes/sequences etc.) in each schema, you might at some point want to know how much space (total) is being used to store the table WIDGET and it's associated main index across all schemas.

I am suprised they didn't break it down by segment_type, but maybe they had thier reasons? Then again, Sybrand might be right, and it might just be the result of somebody not understanding the DBA_SEGMENTS table.

Mystery solved??

HTH Graham

Sybrand Bakker wrote in message
<923805865.5929.0.spot.d4ee154e_at_news.demon.nl>...
>Hi Joe,
>
>dba_segments contains the characteristics of a segment, the physical
mapping
>of a table, an index and so on. A segment can consist of multiple extents,
>just as a file can consist of multiple extents. dba_segments calculates the
>number of extents and the sum of all bytes in those extents. So the query
>below has an unnecessary sum, as dba_segments is already doing that
>calculation. What you get there, is the segments AAA, BBB,CCC and the total
>space allocated to them in Megabytes.
>
>Hth,
>
>Sybrand Bakker, Oracle DBA
>
>
>Joe B wrote in message <37101ae5.48324131_at_news.ntplx.net>...
>>Hello
>>I am new to Oracle so please excuse me if this question is something I
>should
>>know...
>>
>>What does the dba_segments table contain and if someone gave me a query
>like
>>this ...
>>
>>select segment_name, sum(bytes)/1024/1024 from dba_segments
>>where segmnet_name in ('AAA', 'BBB', 'CCC')
>>group by segment_name;
>>
>>what bit of information were they trying to extract?
>>
>>
>>TIA
>>
>>---------------------------------------------------------
>>Reply to: joeba AT ntplx.net
>
>
Received on Thu Apr 22 1999 - 10:23:12 CDT

Original text of this message

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