Wednesday, August 22, 2012


 Query to find Tablespace Fragmentation


Use the below query to find out the level of tablespace fragmentation.

 select tablespace_name, count(*) free_chunks, decode (round((max(bytes) / 1024000), 2), null, 0,
 round((max(bytes) / 1024000), 2)) largest_chunk, 
 nvl (round(sqrt(max(blocks)/sum(blocks))*(100/sqrt(sqrt(count(blocks)) )), 2), 0) fragmentation_index
from sys.dba_free_space 
group by tablespace_name
order by 2 desc, 1

No comments:

Post a Comment

Oracle Database & Applications R12.2 Log file locations

Many times, we forget the path for the log files since there are too many.  Below is the list of frequently used log files which can help us...