watergrinder
MIS
I have a tablespace that has two data files. The second data file is 2gb. Initially it is 500 mb and is autoextensible. The following script takes the initial 500 mb only to give free space details.
Can somebody give a script which takes the entire 2gb into consideration?
Can somebody give a script which takes the entire 2gb into consideration?
Code:
SELECT
fs.tablespace_name TABLESPACE_NAME,
df.totalspace TABLESPACE_TOTAL_SIZE,
(df.totalspace - fs.freespace) MB_USED,
fs.freespace MB_FREE,
round(100 * (fs.freespace / df.totalspace),2) PCT_FREE
FROM (SELECT tablespace_name, ROUND(SUM(bytes) / 1048576) TotalSpace FROM dba_data_files GROUP BY tablespace_name ) df, (SELECT tablespace_name, ROUND(SUM(bytes) / 1048576) FreeSpace FROM dba_free_space GROUP BY tablespace_name ) fs WHERE df.tablespace_name = fs.tablespace_name(+)
order by MB_FREE ASC