How to calculate schema size in Oracle

posted Dec 28, 2011, 7:11 AM by Sachchida Ojha

col tsize heading ‘Total|Schema|Size (Mb)’
col owner head ‘Schema|Name’

SQL>select owner, sum(bytes)/1024/1024 tsizeinMB
from dba_segments
group by owner
order by tsize desc
/

SQL>select sum(bytes)/1024/1024 tsizeinMB
from dba_segments
/

SQL> SELECT sum(bytes)/1024/1024 FROM user_segments

/

SQL> select sum(bytes)/1024/1024 FROM dba_data_files;

SUM(BYTES)/1024/1024
--------------------
        1325

SQL>
SQL> select sum(bytes)/1024/1024 tsizeinMB
from dba_segments ;  2 

 TSIZEINMB
----------
  1225.875

SQL>


Comments