Skip to content
Advertisement

Query to find the tables size occupied in GB in Oracle SQL for various SCHEMAS

I am trying to find the space occupied by list of tables in Oracle DB (for various SCHEMAS ) ,currently i am using this query

QUERY 1 – DBA_SEGMENTS

QUERY 2 – DBA_OBJECTS

when i compare the LIST OF TABLES counts it’s not matching , what could be the reason ?

can you please suggest is this correct or is there a better way to achieve this ?

Reference https://serverfault.com/questions/132620/oracle-how-to-find-out-storage-space-used-by-a-table

Additional Query 1

Additional Query 2

Advertisement

Answer

Here is a fairly accurate query that takes tables, indexes, and any partitioned tables/indexes into account for all tables for a single schema owner. Note that there will be some additional overhead in actual space used due to blocksize, file headers, etc.

Take a look at DBA_LOBS for additional criteria to add to the -- more fun here to pick up LOB information.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement