1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| col schema for A10
col nom_objet for A30
col type_objet for A10
col nom_TBS for A20
set pagesize 50
set linesize 250
@./compile/volumetrie/cr_f_numrow.sql
select schema, nom_objet, type_objet, nom_TBS, taille_extent, taille_tot_TBS/1024/1024/1024 taille_TBS_Go, nb_extent, f_numrow(nom_objet) nb_lignes
from
(select e.owner schema, e.segment_name nom_objet, e.segment_type type_objet, e.tablespace_name nom_TBS, t.next_extent taille_extent, count(e.owner) nb_extent
from dba_extents e, dba_tablespaces t
where e.owner='XXX' and t.tablespace_name=e.tablespace_name
group by e.segment_name, e.owner, e.segment_type, e.tablespace_name, t.next_extent) extents,
(select tablespace_name,sum(bytes) taille_tot_TBS from dba_data_files
group by tablespace_name) tailleTBS
where extents.nom_TBS(+) = tailleTBS.tablespace_name
and schema is not null
and type_objet='TABLE'
order by extents.nb_extent asc;
@./compile/volumetrie/drop_f_numrow.sql |
Partager