SET PAGESIZE     9999
SET VERIFY       OFF
SET SERVEROUTPUT ON  SIZE 500000 FORMAT WORD_WRAPPED
SET FEEDBACK     OFF
SET TRIMSPOOL    ON
SET LINESIZE 3500
SET PAGESIZE 35000

COLUMN FILE_NAME FORMAT A70

ALTER SESSION set nls_numeric_characters = ',.';

-- Disect the input argument, and get the owner filter and table filter into two seperate 
-- substitution variables. The owner filter defaults to the current user.

DEFINE InputTablespaceFilter = ' '
COLUMN Tablespace NOPRINT NEW_VALUE InputTablespaceFilter

column GB_USED format a12
column GB_MAX format a12


--SELECT TABLESPACE_NAME, FILE_NAME, TO_CHAR(BYTES/1024/1024/1024, '9999.00') GB_USED, TO_CHAR(MAXBYTES/1024/1024/1024, '9999.00') GB_MAX, AUTOEXTENSIBLE, INCREMENT_BY*8/1024 MB_INC
--FROM DBA_DATA_FILES
--WHERE TABLESPACE_NAME LIKE UPPER('&&1')
--ORDER BY TABLESPACE_NAME, FILE_NAME;


--SELECT TABLESPACE_NAME, FILE_NAME, TO_CHAR(BYTES/1024/1024/1024, '9999.00') GB_USED, TO_CHAR(MAXBYTES/1024/1024/1024, '9999.00') GB_MAX, AUTOEXTENSIBLE, INCREMENT_BY*8/1024 MB_INC
--FROM DBA_TEMP_FILES
--WHERE TABLESPACE_NAME LIKE UPPER('&&1')
--ORDER BY TABLESPACE_NAME, FILE_NAME;







SELECT F.TABLESPACE_NAME, F.FILE_NAME, TO_CHAR(F.BYTES/1024/1024/1024, '9999.00') GB_USED, TO_CHAR(F.MAXBYTES/1024/1024/1024, '9999.00') GB_MAX, F.AUTOEXTENSIBLE, F.INCREMENT_BY*T.BLOCK_SIZE/1024/1024 MB_INC
FROM DBA_DATA_FILES F, DBA_TABLESPACES T
WHERE F.TABLESPACE_NAME LIKE UPPER('&&1')
AND T.TABLESPACE_NAME = F.TABLESPACE_NAME
ORDER BY F.TABLESPACE_NAME, F.FILE_NAME;


SELECT F.TABLESPACE_NAME, F.FILE_NAME, TO_CHAR(F.BYTES/1024/1024/1024, '9999.00') GB_USED, TO_CHAR(F.MAXBYTES/1024/1024/1024, '9999.00') GB_MAX, F.AUTOEXTENSIBLE, F.INCREMENT_BY*T.BLOCK_SIZE/1024/1024 MB_INC
FROM DBA_TEMP_FILES F, DBA_TABLESPACES T
WHERE F.TABLESPACE_NAME LIKE UPPER('&&1')
AND T.TABLESPACE_NAME = F.TABLESPACE_NAME
ORDER BY F.TABLESPACE_NAME, F.FILE_NAME;


SELECT * FROM DBA_TABLESPACE_GROUPS;

SET FEEDBACK ON
SET PAGESIZE 9999
