Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Bytes to Gigabytes

622229Aug 28 2008 — edited Aug 29 2008
hello,

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;

i will insert this to a table...
--HOW DO I MAKE IT TO see in Gigabytes?

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 26 2008
Added on Aug 28 2008
7 comments
7,711 views