Oracle: usage of the tablespaces

SET pagesize 10000

SET COLSEP ‘|’
SET VERIFY off
SET serveroutput ON SIZE 1000000
BREAK ON report

COLUMN tablespace_name format a30 heading ‘TABLESPACE’
COLUMN sizegb   format 9999999999D9 heading ‘SIZE-Gb’
COLUMN usedproc format 999D99 heading ‘USED-%’
COLUMN status format a10 heading ‘STATUS’
COMPUTE SUM LABEL ‘Total size:’ OF sizegb ON report

SELECT b.tablespace_name ,
       b.bytes/1024/1024/1024 AS sizegb ,
       NVL(100-((a.bytes/b.bytes)*100), 100) usedproc,
    [...]