-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Author       : Sameer S Choudhari
-- Description  : Get the tablespace usage in GB using SYS.DBA_TABLESPACE_USAGE_METRICS. Assumption  : db_block_size=8192
-- Call Syntax  : @tablespace_usage.sql
-- Last Modified: 17/03/2015
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SET lines 220 pages 49999 
SELECT tablespace_name ,
  tablespace_size/128/1024 tablespace_size_gb,
  used_space/128/1024 used_space_gb,
  used_percent
FROM sys.dba_tablespace_usage_metrics
ORDER BY 4;