/* ************************************************ */
/*                                                  */
/* format the report:                               */
/*        check various database files              */
/*                                                  */
/* name:    @c:\oracle\sql\file_spa.sql             */
/* date:    12-MAY-95                               */
/* creator: Rick Kupcunas (Oracle)                  */
/*                                                  */
/* ************************************************ */

/* ckfiles.sql 
 * 
 * This program check various database files 
 *
 * SQL> desc sys.dba_data_files
 * Name            
 * ---------------
 * FILE_NAME         ....database file name
 * FILE_ID           ....ID of the database file
 * TABLESPACE_NAME   ....tablespace in which the file reside
 * BYTES             ....size of file in bytes
 * BLOCKS            ....size of file in ORACLE block
 * STATUS            ....file status (INVALID,AVAILABLE) 
 * 
 * RDBMS V6.0.37.3.1
 */


set pagesize 59
set newpage 0     
set ver off 
set linesize 134 
set feedback off 
set termout off
ttitle center  ' INSTANCE NAME  = '&1 right 'page: ' format 999 sql.pno
btitle center 'ORACLE Confidential'
column FileName     format A32      heading 'File Name' 
column Tablespace   format A15      heading 'Tablespace'
column Allocated    format 9,999    heading 'AllocatedMB' 
column div1         format A3       heading ' | '
column Used         format 9,999    heading 'UsedMB'
column Pct_Used     format 999.99   heading 'PctUsed%'
column div2         format A3       heading ' | ' 
column TotalFree    format 9,999    heading 'TotalFreeMB'
column Pct_Free     format 999.99   heading 'PctFree%'
column MaxFree      format 9,999    heading 'MaxFree'
column status       format A10      heading 'Status'

column oneMB noprint new_value MB
select 1024*1024 oneMB from dual
/
break on tablespace skip 1 on report 

compute sum of Allocated on tablespace 
compute sum of Allocated on report 
compute sum of Used      on tablespace 
compute sum of Used      on report 
compute sum of TotalFree on taaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbblespaceeeeeeeeeeeeeeeeeeeeeeeeee                         
compute sum of TotalFree oooooooooooooooooooooooooonnnnnnnnnnnnnnnnnnnnnnnnnn reporrrrrrrrrrrrrrrrrrrrrrrrrrtttttttttttttttttttttttttt 

spool file_spa.rslt;



















































selecccccccccccccccccccccccccctttttttttttttake SysV

If it still doesn't work and you're a C/Unix hack, just fix it - this
program is not rocket science - the only mildly weird stuff is how
it gathers timestamps and CPU usage from the OS.  When you're done
fixing it, email me (tbray@textuality.com) with what the problem was
and I'll roll your fix in.

If you can't fix it, email me all the details you can think of and
I'll try to fix it.
SHAR_EOF
fi # end of overwriting check
if test -f 'Bonnie.c'
then
       echo shar: will not over-write existing file "'Bonnie.c'"
else
cat << \SHAR_EOF > 'Bonnie.c'
/*
 * Th