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
from sys.dba_free_space
group by tablespace_name
order by 2 desc, 1
order by 2 desc, 1
No comments:
Post a Comment