You can join dba_tables to dba_segments
Only you CANNOT do it by table_name to segment_name, you must use the OWNER as well as the segment type!
I can have a table named T, with an index named T.
So can you.
So can they.
So can lots of people.
The point was -- not only was the use of dbms_space flawed (would not show unbalanced freelists, heck it would not even show all of the freelists), the query itself was not "correct" in a real database - I'm sure in many databases the same segment name would appear twice.
1 select owner, segment_name, segment_type
2 from dba_segments
3* where segment_name = 'T'
ops$tkyte@ORA10G> /
OWNER SEGMENT_NAME SEGMENT_TYPE
------------------------------ ------------------------------ ------------------
BIG_TABLE T TABLE
OPS$TKYTE T TABLE
SCOTT T TABLE
SCOTT T CLUSTER
OPS$TKYTE T INDEX
SCOTT T INDEX
6 rows selected.
which T is which....
So, those two views CAN be joined to each other.
But you do have to use the proper join conditions.
Based on my experience - why do that is my typical answer. What is the point? But if you really really find the desire to do so
</code>
http://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:258815248980 <code>