consulta de espaço utilizado

Espaço em disco consumido pelo schema
select   owner,    sum(bytes)/1024/1024/1024 schema_size_gig
from  dba_segments
group by owner;

select owner, segment_type, sum(bytes)/1024/1024/1024 as size_in_gig
from dba_segments
group by owner, segment_type;

Espaço em disco consumido por tabelas e índices do schema
select owner, segment_name, segment_type,
sum(bytes)/1024/1024/1024 as size_in_gig
from dba_segments
group by owner, segment_name, segment_type;

Espaço da Tablespace
select df.tablespace_name “Tablespace”,
totalusedspace “Used MB”,
(df.totalspace – tu.totalusedspace) “Free MB”,
df.totalspace “Total MB”,
round(100 * ( (df.totalspace – tu.totalusedspace)/ df.totalspace)) “Pct. Free”
from
(select tablespace_name,round(sum(bytes) / 1048576) TotalSpace
from dba_data_files
group by tablespace_name) df,
(select round(sum(bytes)/(1024*1024)) totalusedspace, tablespace_name
from dba_segments
group by tablespace_name) tu
where df.tablespace_name = tu.tablespace_name ;

Add a Comment

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *