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;
1-- Size and usage of tablespaces
2SELECT T1.TABLESPACE_NAME,
3 T1.BYTES / 1024 / 1024 as "bytes_used (Mb)",
4 T2.BYTES / 1024 / 1024 as "bytes_free (Mb)",
5 T2.largest / 1024 / 1024 as "largest (Mb)",
6 round(((T1.BYTES - T2.BYTES) / T1.BYTES) * 100, 2) percent_used
7FROM (
8 select TABLESPACE_NAME,
9 sum(BYTES) BYTES
10 from dba_data_files
11 group by TABLESPACE_NAME
12 ) T1,
13 (
14 select TABLESPACE_NAME,
15 sum(BYTES) BYTES,
16 max(BYTES) largest
17 from dba_free_space
18 group by TABLESPACE_NAME
19 ) T2
20where T1.TABLESPACE_NAME = T2.TABLESPACE_NAME
21order by ((T1.BYTES - T2.BYTES) / T1.BYTES) desc;
1CREATE TABLESPACE
2TBS_NOME_TABLESPACE
3DATAFILE 'NOME_DATAFILE.dbf' SIZE 40M ONLINE;
1CREATE TABLE TB_NOME_TABELA
2(
3CODIGO NUMBER(38)
4)TABLESPACE TBS_NOME_TABLESPACE;