Skip to content

Instantly share code, notes, and snippets.

@joaovitor
Created December 27, 2012 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joaovitor/4387769 to your computer and use it in GitHub Desktop.
Save joaovitor/4387769 to your computer and use it in GitHub Desktop.
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) FRAG_INDEX
FROM SYS.DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME
ORDER BY 4 DESC, 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment