1. View all table space size, Remaining amount:
Select Dbf.tablespace_name,
Dbf.totalspace "Total (M)",
Dbf.totalblocks as total block number,
Dfs.freespace "Total remaining (M)",
Dfs.freeblocks "Number of remaining blocks",
(dfs.freespace/dbf.totalspace) * 100 "idle ratio"
From (select T.tablespace_name,
SUM (t.bytes)/1024/1024 Totalspace,
SUM (t.blocks) totalblocks
From Dba_data_files t
Group by T.tablespace_name) DBF,
(Select Tt.tablespace_name,
SUM (tt.bytes)/1024/1024 FreeSpace,
SUM (tt.blocks) freeblocks
From Dba_free_space TT
GROUP by Tt.tablespace_name) DFS
where trim (dbf.tablespace_name) = Trim (dfs.tablespace_name)
2. View the table space of the current user table
Select segment_name,sum (bytes)/1024/1024 from User_extents Group by segment_name
3. Use the following statement to see who is using the temporary segment
SELECT se.username, SE. SID, se.serial#, se.sql_address, Se.machine, Se.program, Su. Tablespace, Su.segtype, Su. CONTENTS
From V$session SE, v$sort_usage su
WHERE se.saddr = su.session_addr;
Oracle View the remaining amount of table space