Enter the Oracle database and enter the following code to
Select Total.tablespace_name,
Round (total. MB, 2) as TOTAL_MB,
Round (total. Mb-free. MB, 2) as USED_MB,
Round (1-free. Mb/total. MB)
100, 2) | | '% ' as used_pct
From (select Tablespace_name, sum (bytes)/1024/1024 as MB
From Dba_free_space
Group by Tablespace_name) free,
(select Tablespace_name, sum (bytes)/1024/1024 as MB
From Dba_data_files
Group BY Tablespace_name) total
where free.tablespace_name = Total.tablespace_name;
Select A.tablespace_name, A.bytes total, A.bytes-nvl (b.bytes, 0) free from (SELECT tablespace_name, SUM (BYTES) BYTES FR OM dba_temp_files GROUP by Tablespace_name) A, (SELECT tablespace_name, SUM (bytes_cached) bytes from V$temp_extent_pool GR OUP by Tablespace_name) b WHERE a.tablespace_name = B.tablespace_name (+)
Select Temp_used.tablespace_name,total-used as "free", total as "total", round (NVL (total-used, 0)100/total, 3) "Free percent" from (select Tablespace_name, SUM (bytes
used)/1024/1024 used from GV$TEMP _space_header GROUP by Tablespace_name) temp_used, (SELECT tablespace_name, SUM (bytes)/1024/1024 total from Dba_te Mp_files GROUP by Tablespace_name) temp_total WHERE temp_used.tablespace_name = temp_total.tablespace_name;
Those statements to use temporary table space
SELECT se.username,sid,serial#,sql_address,machine,program,tablespace,segtype,contents from V$session SE, V$sort_ Usage su WHERE se.saddr = su.session_addr;
How the Database Views table space usage