rem -------------------------------------------------------------------------
rem           Trivadis AG,  	Mellingen/Basel/Glattbrugg/Bern
rem				Switzerland
rem -------------------------------------------------------------------------
rem   Group/Privileges.: SYS
rem   Script-Name......: cstsfree.sql
rem   Developer........: Andri Kisseleff (ank) akissele@trivadis.ch
rem   Date.............: 07.1993
rem   Version..........: 1.0
rem   Usage............: create view tsfreeunder SYS
rem			 			 (free space per tablespace)
rem   Input parameters.:
rem   Output.......... : 
rem   Called by........:
rem   Remarks..........: use also sdtsfree.sql
rem -----------------------------------------------------------------------
rem Changes:
rem DD.MM.YYYY Consultant Change
rem -----------------------------------------------------------------------
rem 18.06.1996 ank	  title and new header
rem 02.08.1997 ank        Oracle8
rem -----------------------------------------------------------------------
rem
rem
	CREATE OR REPLACE VIEW tsfree
		(TABLESPACE,COUNT_FREE,FREE_BLOCKS,
		 FREE_MB,MAX_FREE_BLOCKS)
	AS SELECT TABLESPACE_NAME,COUNT(*),SUM(BLOCKS),
		  SUM(BYTES)/1024000,MAX(BLOCKS)
	FROM SYS.DBA_FREE_SPACE
	GROUP BY TABLESPACE_NAME;
	COMMENT ON TABLE tsfree IS 
	    'free space per tablespace - DBA only';
	GRANT SELECT ON tsfree TO DBA;
	CREATE PUBLIC SYNONYM tsfree FOR SYS.DBA_TOTAL_FREE;

prompt 
prompt	the view tsfree has been created
prompt
