How to find Database size in Oracle

October 8, 2020
()

Below commands to find Database size in Oracle which includes Total DB size, Free size, used size of DB along with DB name & Hostname, etc.


SQL command which fetches database size in GB. Click here to get a sample output of the Oracle client version.

set lines 999
set pages 999
col HOST_NAME for a20

SELECT SYSDATE DATED, A.HOST_NAME, A.INSTANCE_NAME, A.VERSION,  C.TOTAL_ALLOCATED_GB, B.USED_GB, D.FREE_GB FROM V$INSTANCE A,
(SELECT SUM(BYTES)/1024/1024/1024 USED_GB FROM DBA_SEGMENTS) B,
(SELECT SUM(BYTES)/1024/1024/1024 TOTAL_ALLOCATED_GB FROM DBA_DATA_FILES) C,
(SELECT SUM(BYTES)/1024/1024/1024 FREE_GB FROM DBA_FREE_SPACE) D;

SQL command which fetch database size in MB. Click here to get a sample output of the Oracle client version.

set lines 999
set pages 999
col HOST_NAME for a20

SELECT SYSDATE DATED, A.HOST_NAME, A.INSTANCE_NAME, A.VERSION,  C.TOTAL_ALLOCATED_MB, B.USED_MB, D.FREE_MB FROM V$INSTANCE A,
(SELECT SUM(BYTES)/1024/1024 USED_MB FROM DBA_SEGMENTS) B,
(SELECT SUM(BYTES)/1024/1024 TOTAL_ALLOCATED_MB FROM DBA_DATA_FILES) C,
(SELECT SUM(BYTES)/1024/1024 FREE_MB FROM DBA_FREE_SPACE) D;

We always encourage the technical person to visit section SCRIPTS to get more daily usage SQL commands.


Hope so you like this script
!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the latest update. Click here to know more about our pursuit.

Loading

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

<strong>Hello and welcome to DBsGuru,</strong>DBsGuru is a group of experienced DBA professionals and serves databases and their related community by providing technical blogs, projects, training. Technical blogs are the source of vast information not about databases but its related product like middleware, PL/SQL, replication methodology, and so on.Thanks for the visits!<strong>Share Learn Grow!</strong>

Leave a Reply

Your email address will not be published. Required fields are marked *