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