I'm trying to estimate the table sizes within my schema (in MB). This is what I have so far:
SELECT table_name, owner, last_analyzed
FROM all_tables
I'm fairly new to SQL so I have no idea how I would go around doing this.
Thank you.
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.
Sign up to join this communityLook at the "dba_segments" view (or user_segments if you don't have dba rights). The following query should give you what you're looking for:
select
owner as "Schema"
, segment_name as "Object Name"
, segment_type as "Object Type"
, round(bytes/1024/1024,2) as "Object Size (Mb)"
, tablespace_name as "Tablespace"
from dba_segments
order by owner;
Mi
rather than M
(see Binary prefix)
Apr 8, 2020 at 19:47