/* ************************************************ */
/*                                                  */
/* fnctn:   TSQUOTA - DBA TS Quotas Report          */
/*                                                  */
/* name:    @c:\oracle\sql\tsquota.sql              */
/* date:    12-MAY-95                               */
/* creator: Rick Kupcunas (Oracle)                  */
/*                                                  */
/* ************************************************ */

set verify    on
set feedback  on
set wrap      off
set pagesize  60
set linesize  92
set newpage   0
set space     10
set trimout   on
set underline =
set echo      on
set termout   on

whenever sqlerror exit failure

column today new_value dba_date
select to_char(sysdate, 'mm/dd/yy hh:miam') today
       from dual;

spool tsquota.rslt

ttitle center 'TSQUOTA - DBA TS Quotas Report ' skip 1 -
left "PAGE:" sql.pno format 999 -
right 'Date: 'format a18 dba_date skip 2

 col  username          format A8
 col  tablespace_name   format A14  heading Tablespace
 col  bytes             format 999,999,999
 col  blocks            format 999,999

compute sum of bytes  on tablespace_name
compute sum of blocks on tablespace_name

break on tablespace_name skip 1

select tablespace_name, 
     username, 
     bytes, 
     blocks
from sys.dba_ts_quotas
where tablespace_name <> 'SYSTEM'
order by tablespace_name, 
     username;

spool off;

