- Código: Seleccionar todo
select segment_name table_name,
sum(bytes)/(1024*1024*1024) table_size_gigas
from user_extents
where segment_type='TABLE'
and segment_name in (select table_name from tabs)
group by segment_name
order by 2 desc
Si quereis los datos en MB quitarle un factor a: 1024*1024*1024 es decir dejad: 1024*1024, si lo quereis en KB tan solo dejad 1024.
Si os interesa solo las tablas de tamaño superior a un umbral, pongamos 1 GB:
- Código: Seleccionar todo
select segment_name table_name,
sum(bytes)/(1024*1024*1024) table_size_gigas
from user_extents
where segment_type='TABLE'
and segment_name in (select table_name from tabs)
group by segment_name
having sum(bytes)/(1024*1024*1024) > 1
order by 2 desc
Para saber el tamaño de una tabla en concreto, pongamos : MI_TABLA
- Código: Seleccionar todo
select segment_name table_name,
sum(bytes)/(1024*1024*1024) table_size_gigas
from user_extents
where segment_type='TABLE'
and segment_name = 'MI_TABLA'
group by segment_name
Es todo