Size of the database

Two ways to determine the size of your Oracle database.

There are at least two ways to determine the size of your Oracle database:

  1. Total size of datafiles that make up tablespaces of the database
  2. Total size of tables and indexes in the database

Method 1

This method sums the total size of datafiles in the DB. Details can be found in the views v$datafile and dba_data_files. This will give your the number of MB allocated to your database:

SELECT sum(bytes/1048576) 
FROM dba_data_files

Remember, a megabyte is not 1000000 bytes but 1024*1024 bytes.

Method 2

Sums the total of extents used for the database. It will not tell you if the extent is 10% or 90% full. Details are found in the dba_extent view.

SELECT sum(bytes/1048576)
FROM dba_extents;
This will give you the total number of MB used by your database.

Try both methods and see for yourself.

For More Information

  • What do you think about this tip? E-mail the editor at tdichiara@techtarget.com with your feedback.
  • The Best Oracle Web Links: tips, tutorials, scripts, and more.
  • Have an Oracle tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize--submit your tip today!
  • Ask your technical Oracle questions--or help out your peers by answering them--in our live discussion forums.
  • Check out our Ask the Experts feature: Our SQL, database design, Oracle, SQL Server, DB2, metadata, and data warehousing gurus are waiting to answer your toughest questions.

This was first published in May 2002

Dig deeper on Oracle database design and architecture

Pro+

Features

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

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