Total space occupied by table in tablespace
hi,
I am looking for information to find total space occupied by a table stored in a tablespace. We can consider a scenario , wherein the table has data present in it , has constraints , indexes , LOB columns and some free space left out of the total it was allocated. I've tried two queries, but do not think they give me what im looking for.
select bytes from user_segments where segment_name = 'EMPLOYEES';
SELECT
lower( owner ) AS owner
,lower(table_name) AS table_name
,tablespace_name
,num_rows
,blocks*8/1024 AS size_mb
,pct_free
,compression
,logging
FROM all_tables
WHERE owner LIKE UPPER('HR')
AND table_name ='EMPLOYEES'
ORDER BY 1,2;
Basically I need to get this information before performing some DML's on the table, after which I will again check how much space is free post the operation. So kind of giving information to customers about space used and freed for a table in a tablespace.
Now how can I go around finding the total space occupied by the table combining the factors mentioned above.
Thanks in advance.