Q

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

query:

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 first published in September 2006

Dig deeper on Oracle database design and architecture

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close