Getting the total size and free space in the database

I want the following results
 
 1 total size of the database
 2 currently occupied size
 3 free size
for the entire database.

    Requires Free Membership to View

Total size of the database is typically just a measure of the allocated space. The following query can give you that number:

SELECT SUM(bytes) AS total_size FROM dba_data_files;
The occupied space is the amount of space taken up by the objects in the database. This can be found by the following query:
SELECT SUM(bytes) AS occupied_space FROM dba_segments;
The amount of free space is the difference between the two number obtained above!

For More Information


This was first published in June 2002

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.