Monday, 13 August 2012

Tablespace Used Free Space "Amazing"

Hi Buddy,

Use this script. This Will Definetly Help the DBA.


*TABLESPACE USED FREE %USED % FREE AND AUTOEXTENSIBLE SCRIPT*
*****************************************************************

set linesize 200
column F_NAME format a38
column TABLESPACE format a15
set pagesize 400

 select t.tablespace,F_NAME,auto,MAX_GB,t.totalspace as " Total_MB", round((t.totalspace-fs.freespace),2) as "Used_MB", fs.freespace as "Free_MB", round(((t.totalspace-fs.freespace)/t.totalspace)*100,2) as "%Used", round((fs.freespace/t.totalspace)*100,2) as "% Free" from (select round(sum(d.bytes)/(1024*1024)) as totalspace, d.tablespace_name tablespace,d.autoextensible as auto,d.file_name as F_NAME,round(sum(d.maxbytes)/(1024*1024*1024))as MAX_GB  from dba_data_files d group by d.tablespace_name,d.autoextensible,d.file_name) t,(select round(sum(f.bytes)/(1024*1024)) as freespace, f.tablespace_name tablespace from dba_free_space f group by f.tablespace_name) fs where t.tablespace=fs.tablespace order by t.tablespace;


Thanks
Ravi Kr Shrivastava
Senior Oracle DBA.

No comments:

Post a Comment