-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Author       : Sameer S Choudhari
-- Description  : Find the schema size (GB) group by segment_type
-- Call Syntax  : @db_space_usage_groupby_schema_segment_type.sql
-- Last Modified: 17/03/2015
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SET LINES 220 PAGES 49999
COLUMN owner FORMAT a30
COLUMN segment_type FORMAT a30
SELECT owner,
       SUM(bytes)/1024/1024/1024 AS size_gb,
       segment_type
FROM dba_segments
GROUP BY
  owner,
  segment_type
ORDER BY
  owner,
  segment_type;