set ver on;
set define on;

column segment_name format a30
column status format a15
column TABLESPACE_NAME format a30

define propietario=&1 ;
define tipo=&2;
define nombre=&3;
define tab=&4;

select owner,segment_type,segment_name,TABLESPACE_NAME,trunc(bytes/1024/1024) MB
from dba_segments
where OWNER like upper('%&propietario%')
and segment_type like upper('%&tipo%')
and segment_name like upper('%&nombre%')
and segment_type not like '%PARTITION%'
and tablespace_name like upper('%&tab%')
order by owner,segment_type,segment_name
/



set ver on;
