/* ************************************************ */
/*                                                  */
/* format the report:                               */
/*        Count Of Extents For Database Objects     */
/*                                                  */
/* name:    @c:\oracle\sql\ext.sql                  */
/* date:    12-MAY-95                               */
/* creator: Rick Kupcunas (Oracle)                  */
/*                                                  */
/* ************************************************ */

set termout off
break on today
column today new_value dba_date
select to_char(sysdate, 'mm/dd/yy  hh:mi AM') today
       from dual;
clear breaks
set termout on

set pagesize 60 linesize 132 verify off
set space 6
ttitle left 'Date: ' format a18 dba_date -
 center 'Count Of Extents For Database Objects' -
       right 'Page: ' format 999 sql.pno skip 2
rem set echo on

spool ext.lst

column tablespace heading Tablespace
column object heading Object
column owner heading Owner
column type heading Type
column extents heading Extents
column bytes heading Bytes

select substr(tablespace_name,1,15) tablespace,
       substr(segment_name,1,32) object,
       substr(owner,1,15) owner, segment_type type,
       count(extent_id) extents, sum(bytes) bytes
from dba_extents;

group by tablespace_name, segment_name, owner, segment_type
order by tablespace_name, segment_name, owner;

exit;
