{"id":977,"date":"2024-12-27T22:55:54","date_gmt":"2024-12-27T22:55:54","guid":{"rendered":"https:\/\/w3buddy.com\/?p=977"},"modified":"2026-01-15T13:17:31","modified_gmt":"2026-01-15T07:47:31","slug":"how-to-find-oracle-database-size","status":"publish","type":"post","link":"https:\/\/w3buddy.com\/blog\/how-to-find-oracle-database-size\/","title":{"rendered":"How to Find Oracle Database Size"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This post provides SQL queries to find the size of an Oracle database, including the total database size, data size, used and free space, and size by owner. It also includes methods to check the overall database size, the space occupied by data segments, and more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. The Actual Size of the Database in GB<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To find the total size of the database:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-sql\">SELECT SUM(bytes) \/ 1024 \/ 1024 \/ 1024 AS GB FROM dba_data_files;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2. <strong>Size Occupied by Data in the Database<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To check the size occupied by data in the database:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-sql\">SELECT SUM(bytes) \/ 1024 \/ 1024 \/ 1024 AS GB FROM dba_segments;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3. Overall\/Total Database Size<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To get the overall size of the database, including data files, temp files, redo logs, and control files:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-sql\">SELECT \n  (SELECT SUM(bytes) \/ 1024 \/ 1024 \/ 1024 data_size FROM dba_data_files) +\n  (SELECT NVL(SUM(bytes), 0) \/ 1024 \/ 1024 \/ 1024 temp_size FROM dba_temp_files) +\n  (SELECT SUM(bytes) \/ 1024 \/ 1024 \/ 1024 redo_size FROM sys.v_$log) +\n  (SELECT SUM(BLOCK_SIZE * FILE_SIZE_BLKS) \/ 1024 \/ 1024 \/ 1024 controlfile_size FROM v$controlfile) \"Size in GB\"\nFROM dual;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">4. Database Size and Space Usage<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Alternatively, use the following query to check the total database size, used space, and free space:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-sql\">SELECT \n  ROUND(SUM(used.bytes) \/ 1024 \/ 1024 \/ 1024) || ' GB' AS \"Database Size\",\n  ROUND(SUM(used.bytes) \/ 1024 \/ 1024 \/ 1024) - ROUND(free.p \/ 1024 \/ 1024 \/ 1024) || ' GB' AS \"Used Space\",\n  ROUND(free.p \/ 1024 \/ 1024 \/ 1024) || ' GB' AS \"Free Space\"\nFROM \n  (SELECT bytes FROM v$datafile \n   UNION ALL \n   SELECT bytes FROM v$tempfile \n   UNION ALL \n   SELECT bytes FROM v$log) used,\n  (SELECT SUM(bytes) AS p FROM dba_free_space) free\nGROUP BY free.p;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This post provides SQL queries to find the size of an Oracle database, including the total database size, data size, used and free space, and size by owner. It also includes methods to check the overall database size, the space occupied by data segments, and more. 1. The Actual Size of the Database in GB [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowu461DA:productID":"","footnotes":""},"categories":[1225],"tags":[],"class_list":["post-977","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/comments?post=977"}],"version-history":[{"count":1,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/977\/revisions"}],"predecessor-version":[{"id":978,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/977\/revisions\/978"}],"wp:attachment":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media?parent=977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/categories?post=977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/tags?post=977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}