oracle tablespace free space

Solutions on MaxInterview for oracle tablespace free space by the best coders in the world

showing results for - "oracle tablespace free space"
Lennard
05 Mar 2020
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;