tonydba
asked on
tablespace full
How we find that tablespacespace is full..?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That query is only reporting on tablespaces that the user can see where the tablespace name is someone's default tablespace
Also (with apologies to dvz), it uses non Ansi standard joins - which I personally find non intuitive.
This gives all tablespaces (and requires you have access to the dba_ views as opposed to the user_ views).
I use a variation on that script for my own use:
Instead of just showing space free, shows Tablespace name, size of tablespace, freespace and percent freespace.
Also (with apologies to dvz), it uses non Ansi standard joins - which I personally find non intuitive.
SELECT
ts.tablespace_name,
TO_CHAR(SUM(NVL(fs.bytes,0))/1024/1024, '99,999,990.99') AS MB_FREE
FROM
dba_free_space fs
left join dba_tablespaces ts on fs.tablespace_name = ts.tablespace_name
GROUP BY
ts.tablespace_name
This gives all tablespaces (and requires you have access to the dba_ views as opposed to the user_ views).
I use a variation on that script for my own use:
set feedback off
set echo off
set linesize 165
set pagesize 500
set heading on
clear breaks
col fname heading "Filename" format a60
col ts heading "Tablespace|Name" format a15
col cb heading "Total|Current|File Size" format 999,999,999,999
col free heading "Potential|Bytes Free" like cb
col percentfree heading "% Free|of|Pot.|Total|Bytes" format 999
ttitle "Percentage Freespace by Tablespace"
set markup html on preformat on
select a.tablespace_name ts, totb cb, freeb free, freeb/totb*100 percentfree
from (select tablespace_name, sum(bytes) totb from dba_data_files group by tablespace_name) a,
(select tablespace_name, sum(bytes) freeb from dba_free_space group by tablespace_name) b
where a.tablespace_name = b.tablespace_name
order by a.tablespace_name
/
Instead of just showing space free, shows Tablespace name, size of tablespace, freespace and percent freespace.
Technically, since the question is "How we find that tablespacespace is full" the answer is when you get a "ORA-01653: unable to extend table" error.
ASKER
Thanks good.
Tablespace-Free.txt