oracle table size

Solutions on MaxInterview for oracle table size by the best coders in the world

showing results for - "oracle table size"
Jacopo
11 Nov 2019
1SELECT T1.TABLESPACE_NAME,
2       T1.BYTES / 1024 / 1024   as                        "bytes_used (Mb)",
3       T2.BYTES / 1024 / 1024   as                        "bytes_free (Mb)",
4       T2.largest / 1024 / 1024 as                        "largest (Mb)",
5       round(((T1.BYTES - T2.BYTES) / T1.BYTES) * 100, 2) percent_used
6FROM (
7         select TABLESPACE_NAME,
8                sum(BYTES) BYTES
9         from dba_data_files
10         group by TABLESPACE_NAME
11     ) T1,
12     (
13         select TABLESPACE_NAME,
14                sum(BYTES) BYTES,
15                max(BYTES) largest
16         from dba_free_space
17         group by TABLESPACE_NAME
18     ) T2
19where T1.TABLESPACE_NAME = T2.TABLESPACE_NAME
20order by ((T1.BYTES - T2.BYTES) / T1.BYTES) desc;
Mitzi
07 Apr 2018
1SELECT e.OWNER, e.SEGMENT_NAME, e.TABLESPACE_NAME, sum(e.bytes) / 1048576 AS Megs
2FROM dba_extents e
3WHERE
4  e.OWNER = 'SCHEME_NAME' AND
5  e.TABLESPACE_NAME = 'TBS_NAME' AND
6  e.SEGMENT_NAME IN ('TABLE_NAME')
7GROUP BY e.OWNER, e.SEGMENT_NAME, e.TABLESPACE_NAME
8ORDER BY e.TABLESPACE_NAME, e.SEGMENT_NAME;