Monday, January 30, 2012

How to find top 10 largest sized tables in Oracle

col    owner format a15
col    segment_name format a30
col    segment_type format a15
col    gb format 999,999,999
select  owner
,    segment_name
,    segment_type
,    gb
from    (
    select    owner
    ,    segment_name
    ,    segment_type
    ,    bytes / 1024 / 1024 / 1024 "gb"
    from    dba_segments
    where segment_type = 'TABLE'
    order    by bytes desc
    )
where    rownum < 10

1 comment:

Unknown said...

, bytes / 1024 / 1024 / 1024 GB should be without quotes