-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Author       : Sameer S Choudhari
-- Description  : Find the table size (GB)
-- Call Syntax  : @db_space_usage_table_size.sql
-- Last Modified: 17/03/2015
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SET LINES 220 PAGES 49999
COLUMN owner FORMAT a30
COLUMN segment_name FORMAT a30
COLUMN segment_type FORMAT a30
SELECT owner,
       segment_name,
       segment_type,
       bytes/1024/1024/1024 AS size_gb
FROM dba_segments
WHERE owner=upper('&owner')
  AND segment_name=upper('&segment_name')
  AND segment_type='TABLE'
ORDER BY size_gb DESC;