Following is the script to find out the percentage used of all tablespaces.
SELECT a.tablespace_name,
a.bytes bytes_used,
b.bytes bytes_free,
b.largest,
ROUND(((a.bytes-b.bytes)/a.bytes)*100,2) percent_used
FROM (SELECT tablespace_name,
SUM(bytes) bytes
FROM DBA_DATA_FILES
GROUP BY tablespace_name)a,
(SELECT tablespace_name,
SUM(bytes) bytes,
MAX(bytes) largest
FROM dba_free_space
GROUP BY tablespace_name) b
WHERE a.tablespace_name=b.tablespace_name
ORDER BY ((a.bytes-b.bytes)/a.bytes) DESC
/
No comments:
Post a Comment
Thanks for your comment.