Actions to take when tablespace full.
640612Apr 15 2009 — edited Apr 16 2009Hello,
I ran the following script against my database in order to know what tablespace is 80% full:
select tsu.tablespace_name "Tablespace"
*, ceil(tsu.used_mb) "Size MB"*
*, 100 - floor(tsf.free_mb/tsu.used_mb*100) "%Used"*
*, ceil((tsu.used_mb - tsf.free_mb) / .8) - tsu.used_mb "Add (80%)"*
from (select tablespace_name, sum(bytes)/1024/1024 used_mb
from dba_data_files group by tablespace_name) tsu
*, (select ts.tablespace_name*
*, nvl(sum(bytes)/1024/1024, 0) free_mb*
from dba_tablespaces ts, dba_free_space fs
where ts.tablespace_name = fs.tablespace_name (+)
group by ts.tablespace_name) tsf
where tsu.tablespace_name = tsf.tablespace_name (+)
and 100 - floor(tsf.free_mb/tsu.used_mb100) >= 80*
order by 3,4
*;*
The result was the following:
Tablespace Size MB %Used Add (80%)
------------------------------ ---------- ---------- ----------
SYSAUX 410 96 80
SYSTEM 600 99 137
M4PROD 6900 100 1699
SQL>
What actions should I take in order to avoidtroubles ahead, particularly with the SYSAUX and the SYSTEM tablespaces?
Thanks in advance.