Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to know the specific size of a field in oracle table

Me_101Dec 4 2012 — edited Dec 4 2012
Hello,

oracle 11.2.0.3 on redhat
i have three tables with same structure, table0, table50, table100:

create table table0 (id number, shipment RAW(2000), options RAW(2000));

i inserted 10000 rows in each but with some differences:
table0 has 10000 id, but shipment and options has null values
table50 has 10000 id, but shipment and options has only 5000 rows, the other 5000 are null values
table100 has 10000 rows of id, shipment and options. No null values.

I want to know the specific size of each column, also the size of each row, to know the exactly size of the field.

for example:

row 1, column options of table100 has "asdfasdfagasdgasbabsdgoasdpgiahnwe1129u412094u12"
row 2, column options of table100 has "a".
both are raw datatype, but i think its space will has different size (bytes), how to know it? any query?

I found this query:
select owner,tablespace_name,segment_name,sum((bytes/1024/1024)) Bytes
from sys.dba_extents
where owner in 'MAA' and segment_type='TABLE' and segment_name ='TABLE00'
group by tablespace_name,owner,segment_name
order by owner,tablespace_name,segment_name, bytes; 
but i think it isn't my solution.
This post has been answered by JustinCave on Dec 4 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2013
Added on Dec 4 2012
9 comments
1,093 views