Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
difference in dba_tables and dba_segments??
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ben  
View profile  
 More options Jun 20 2006, 10:58 am
Newsgroups: comp.databases.oracle.server
From: "Ben" <bal...@comcast.net>
Date: 20 Jun 2006 07:58:45 -0700
Local: Tues, Jun 20 2006 10:58 am
Subject: difference in dba_tables and dba_segments??
Running Enterprise 9.2.0.5 with the compatible parameter set to 8.1.0
on an IBM Unix/AIX5L system.
Why would the following selects return a different value for blocks?
This table is analyzed using dbms_stats.gather_schema_stats.

select owner, segment_name, round(blocks*8/1024,2) as Megs
from dba_segments
where owner = 'PRODDTA'
and segment_name = 'F0911'

returns 35840.02 for Megs

select owner, table_name, round(blocks*8/1024,2) as Megs
from dba_tables
where owner = 'PRODDTA'
and table_name = 'F0911'

returns 35750.84 for Megs

I'd rather use dba_table instead of joining between the two to get
num_rows, last_analyzed, and size values, but if these are returning
different values how do I know which one is correct?
Thank you,
Ben


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Peasland  
View profile  
 More options Jun 20 2006, 11:17 am
Newsgroups: comp.databases.oracle.server
From: Brian Peasland <oracle_...@nospam.peasland.net>
Date: Tue, 20 Jun 2006 15:17:37 GMT
Local: Tues, Jun 20 2006 11:17 am
Subject: Re: difference in dba_tables and dba_segments??

In DBA_TABLES, the BLOCKS column is populated when you calculate
statistics on the object. When you *estimate* stats, you may not get a
truly accurate number.

In DBA_SEGMENTS, the BLOCKS column is the actual number of blocks
allocated for that segment. I use this view for my true value.

HTH,
Brian

--
===================================================================

Brian Peasland
oracle_...@nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.

"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mladen Gogala  
View profile  
 More options Jun 20 2006, 10:58 pm
Newsgroups: comp.databases.oracle.server
From: Mladen Gogala <gog...@sbcglobal.net>
Date: Wed, 21 Jun 2006 02:58:18 GMT
Local: Tues, Jun 20 2006 10:58 pm
Subject: Re: difference in dba_tables and dba_segments??

On Tue, 20 Jun 2006 07:58:45 -0700, Ben wrote:
> I'd rather use dba_table instead of joining between the two to get
> num_rows, last_analyzed, and size values, but if these are returning
> different values how do I know which one is correct?
> Thank you,

Very simple: go through DBA_EXTENTS and sum up sizes of all extents
comprising the table. See which number will you get. My guess is that
the number will be the one from DBA_SEGMENTS for the reason mentioned
by Brian.

--
http://www.mgogala.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben  
View profile  
 More options Jun 21 2006, 9:21 am
Newsgroups: comp.databases.oracle.server
From: "Ben" <bal...@comcast.net>
Date: 21 Jun 2006 06:21:42 -0700
Local: Wed, Jun 21 2006 9:21 am
Subject: Re: difference in dba_tables and dba_segments??

Mladen Gogala wrote:
> On Tue, 20 Jun 2006 07:58:45 -0700, Ben wrote:

> > I'd rather use dba_table instead of joining between the two to get
> > num_rows, last_analyzed, and size values, but if these are returning
> > different values how do I know which one is correct?
> > Thank you,

> Very simple: go through DBA_EXTENTS and sum up sizes of all extents
> comprising the table. See which number will you get. My guess is that
> the number will be the one from DBA_SEGMENTS for the reason mentioned
> by Brian.

> --
> http://www.mgogala.com

So why would you use DBA_EXTENTS as the golden rule as to what it
should be?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hpuxrac  
View profile  
 More options Jun 21 2006, 11:03 am
Newsgroups: comp.databases.oracle.server
From: "hpuxrac" <johnbhur...@sbcglobal.net>
Date: 21 Jun 2006 08:03:30 -0700
Local: Wed, Jun 21 2006 11:03 am
Subject: Re: difference in dba_tables and dba_segments??

Umm because it is the accurate answer?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gazzag  
View profile  
 More options Jun 21 2006, 11:19 am
Newsgroups: comp.databases.oracle.server
From: "gazzag" <gar...@jamms.org>
Date: 21 Jun 2006 08:19:16 -0700
Local: Wed, Jun 21 2006 11:19 am
Subject: Re: difference in dba_tables and dba_segments??

Ben wrote:
> So why would you use DBA_EXTENTS as the golden rule as to what it
> should be?

http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14237/sta...

HTH

-g


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Peasland  
View profile  
 More options Jun 21 2006, 11:55 am
Newsgroups: comp.databases.oracle.server
From: Brian Peasland <oracle_...@nospam.peasland.net>
Date: Wed, 21 Jun 2006 15:55:07 GMT
Local: Wed, Jun 21 2006 11:55 am
Subject: Re: difference in dba_tables and dba_segments??

Why is DBA_EXTENTS more accurate than DBA_SEGMENTS?

SQL> select bytes from dba_segments where segment_name='SDE_BLK_9037';

            BYTES
----------------
   65,781,366,784

SQL> select sum(bytes) as bytes from dba_extents
   2  where segment_name='SDE_BLK_9037';

            BYTES
----------------
   65,781,366,784

The segment shown above has 1,165 extents.

Querying DBA_SEGMENTS and DBA_EXTENTS for the total size of the segment
should, and does produce the same result. To say one view is more
accurate than the other is not correct. DBA_SEGMENTS relies heavily on
SYS.SEG$ for its information, as does DBA_EXTENTS. However, DBA_EXTENTS
does also query X$KTFBUE (assuming LMT's, or SYS.UET$ for DMT's) which
is the file bitmap used extent fixed table. But DBA_EXTENTS needs
X$KTFBUE because you are looking on a different level...at the extent
level. DBA_SEGMENTS looks one level higher, the segment level. In either
case, the number of BYTES reported for the segment in both views should
be the same. And in all of my tests, it is.

Chers,
Brian

--
===================================================================

Brian Peasland
oracle_...@nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.

"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »