Onesqltocalculatetheschema & amp; #39; stablecapacity

Source: Internet
Author: User
SELECTowner, table_name, TRUNC (SUM (bytes) (1024*1024) MBFROM (SELECTsegment_nametable_name, owner, region, I. owner, s. bytesFROMdba_indexesi, dba_segmentss

SELECT owner, table_name, TRUNC (SUM (bytes)/(1024*1024) MBFROM (SELECT segment_name table_name, owner, bytes FROM dba_segments WHERE segment_type = 'table' union all select I. table_name, I. owner, s. bytes FROM dba_indexes I, dba_segments s

SELECT owner,  table_name,  TRUNC(SUM(bytes)/(1024*1024)) MBFROM  (SELECT segment_name table_name,    owner,    bytes  FROM dba_segments  WHERE segment_type = 'TABLE'  UNION ALL  SELECT i.table_name,    i.owner,    s.bytes  FROM dba_indexes i,    dba_segments s  WHERE s.segment_name = i.index_name  AND s.owner          = i.owner  AND s.segment_type   = 'INDEX'  UNION ALL  SELECT l.table_name,    l.owner,    s.bytes  FROM dba_lobs l,    dba_segments s  WHERE s.segment_name = l.segment_name  AND s.owner          = l.owner  AND s.segment_type   = 'LOBSEGMENT'  UNION ALL  SELECT l.table_name,    l.owner,    s.bytes  FROM dba_lobs l,    dba_segments s  WHERE s.segment_name = l.index_name  AND s.owner          = l.owner  AND s.segment_type   = 'LOBINDEX'  )GROUP BY table_name,  ownerORDER BY SUM(bytes) DESC ;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.