Way to success...

--"Running Away From Any PROBLEM Only Increases The DISTANCE From The SOLUTION"--.....--"Your Thoughts Create Your FUTURE"--.....--"EXCELLENCE is not ACT but a HABIT"--.....--"EXPECT nothing and APPRECIATE everything"--.....

Thursday, July 28, 2016

Query To Check Oracle Database Size


Download(dbsize.sql)

REM +======================================================================+
REM                    
REM File Name: dbsize.sql
REM 
REM Description:
REM   Query To Check Oracle Database Size
REM   
REM Notes:
REM   Usage: sqlplus "/ as sysdba" @dbsize.sql
REM   
REM +======================================================================+

clear columns
set lines 180
SELECT "DATABASE_SIZE(GB)", "DATABASE_SIZE(GB)" - "FREE_SPACE(GB)" "USED_SPACE(GB)", "FREE_SPACE(GB)"
  FROM (SELECT (SELECT SUM (BYTES / (1014 * 1024 * 1024))
                  FROM dba_data_files) "DATABASE_SIZE(GB)", (SELECT SUM (BYTES / (1024 * 1024 * 1024))
                                                               FROM dba_free_space) "FREE_SPACE(GB)"
          FROM DUAL);

3 comments:

  1. Hi,

    Thank you for sharing the scripts. nice shell scripts your are posted.

    I want to monitor DB monthly growth through script. Kindly share the script.

    ReplyDelete
    Replies
    1. Hi Younoos,

      Nice to hear that my shell scripts helped you.
      Sure, I will post the DB Monthly growth monitoring script soon.

      Regards,
      Kiran

      Delete
    2. Hi Younoos,

      Please check out below link for the script - To Monitor Current Database Size and its Growth Since Last Run:

      https://h2hdba.blogspot.in/2016/11/script-to-monitor-current-database-size.html

      Regards,
      Kiran

      Delete