SET VERIFY OFF;
SET LINESIZE 300
COLUMN SEGMENT_TYPE FORMAT A20
COLUMN TABLESPACE_NAME FORMAT A30

SELECT TABLESPACE_NAME, SEGMENT_TYPE, COUNT(*),ROUND(SUM(BYTES)/1024/1024,2) MB
FROM DBA_SEGMENTS
WHERE OWNER=upper('&1')
GROUP BY TABLESPACE_NAME,SEGMENT_TYPE
order BY TABLESPACE_NAME,SEGMENT_TYPE;

SELECT SEGMENT_TYPE, COUNT(*),ROUND(SUM(BYTES)/1024/1024,2) MB
FROM DBA_SEGMENTS
WHERE OWNER=upper('&1')
GROUP BY SEGMENT_TYPE
order BY SEGMENT_TYPE;

select object_type, count(1)
from dba_objects
where owner = upper('&1')
group by object_Type
order by object_type;

column constraint_type format a20
select constraint_type, count(1)
from dba_constraints
where owner = upper('&1')
group by constraint_type
order by constraint_type;

SELECT ROUND(SUM(BYTES)/1024/1024,2) TOTAL_MB
FROM DBA_SEGMENTS
WHERE OWNER=upper('&1');


SET VERIFY ON;

