-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Author       : Sameer S Choudhari
-- Description  : Find the schema size (GB)
-- Call Syntax  : @db_space_usage_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
WHERE owner=upper('&owner')
GROUP BY
  owner
ORDER BY size_gb DESC;