Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Total space occupied by table in tablespace

Sandyboy036May 19 2013 — edited May 19 2013
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.
This post has been answered by unknown-698157 on May 19 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 16 2013
Added on May 19 2013
6 comments
10,567 views