Database Administration (MOSC)

MOSC Banner

Query to check tablespace usage

edited May 27, 2022 9:30PM in Database Administration (MOSC) 7 commentsAnswered ✓

Hello Guys,


I am using the query bellow to check the usage of tablespaces in my oracle DBs:

select t.tablespace_name, t.size_mb, f.free_mb, round((f.free_mb*100)/t.size_mb,2) percent_free

from (select tablespace_name, round(sum(bytes)/1024/1024,2) size_mb

   from dba_data_files

   group by tablespace_name) t,

   (select tablespace_name, round(sum(bytes)/1024/1024,2) free_mb

   from dba_free_space

   group by tablespace_name) f

where t.tablespace_name=f.tablespace_name

order by percent_free desc;


We are using zabbix external scripts to check it ad-hoc and It failing because the time this query takes is more than 30 seconds, which is the limit for Zabbix.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center