Problem solve Get help with specific problems with your technologies, process and projects.

Size of database in gigabytes

I'm new to Oracle. How do I find out the total size of a database in gigabytes?

I'm new to Oracle. How do I find out the total size of a database in gigabytes?
The "size" of a database can mean different things to different people.

If you want to know how much space the database uses on the server's disk system, you can issue the following...


SELECT SUM(bytes) AS bytes FROM dba_data_files;
However, the datafiles could be a little empty, mostly empty or somewhere in between. So many people look at the amount of space occupied by the tables and indexes in the database. Any object that allocates space in the database is called a segment, so a different query is used:
SELECT SUM(bytes) AS bytes FROM dba_segments;
Just like datafiles, the segments could be mostly empty. In this case, you will have to use the DBMS_SPACE package segment by segment to see how much of the segment's allocated space is actually used.
This was last published in September 2006

Dig Deeper on Oracle database design and architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.