REM show data files usage

set linesize 188
set pagesize 26
SET FEEDBACK OFF
set heading on
set echo off
set timing off
variable xxx char(150)

column "Tablespace" format a16
COLUMN "File ID" FORMAT 9999999
column "Data file" format a43
column "Mb" format 9,999,999
column "Blocks" format 9,999,999
column "Status" format a10
COLUMN "USED SIZE(Mb)" FORMAT 9,999,999,999
COLUMN "USED BLOCKS" FORMAT 999,999,999
COLUMN "USED USAGE" FORMAT A10
COLUMN "FREE SIZE(Mb)" FORMAT 9,999,999,999
COLUMN "FREE BLOCKS" FORMAT 999,999,999
COLUMN "FREE USAGE" FORMAT A10
COLUMN "TOTAL SIZE(Mb)" FORMAT 99,999,999,999
COLUMN "TOTAL BLOCKS" FORMAT 9999,999,999

break on "Tablespace"

declare
cursor c1 is select 'Print Date:'||to_char(sysdate,'yyyy/mm/dd')||' ***** Datafile Information from DataBase :'||name||' Instance:'||instance||' *****' xxx
from v$database,v$thread
where rownum=1;
begin
open c1;
fetch c1 into :xxx;
close c1;
end;
/


set pagesize 1
print xxx
set pagesize 24

TTITLE RIGHT FORMAT 999 'Page:' SQL.PNO
BTITLE CENTER